From dc8b90892420b4bd9b3ae226369cf51334c13abc Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Thu, 23 Jul 2026 14:31:54 -0700 Subject: [PATCH 1/5] Add Rubocop with shared rubocop-gusto config and adopt rubyfmt Pulls in rubocop-gusto for linting and rubocop-rubyfmt/rubyfmt for formatting, fixes the resulting violations, and moves CI onto the shared-config reusable workflow with an added rubyfmt check. --- .github/workflows/ci.yml | 42 +- .rubocop.yml | 38 + .rubocop_todo.yml | 64 + .rubyfmtignore | 1 + Gemfile | 3 +- Gemfile.lock | 30 +- Rakefile | 7 +- lib/pack_stats.rb | 84 +- lib/pack_stats/gauge_metric.rb | 13 +- lib/pack_stats/private.rb | 4 +- lib/pack_stats/private/datadog_reporter.rb | 31 +- lib/pack_stats/private/metrics.rb | 22 +- .../private/metrics/dependencies.rb | 25 +- lib/pack_stats/private/metrics/files.rb | 14 +- lib/pack_stats/private/metrics/packages.rb | 89 +- .../private/metrics/packages_by_team.rb | 76 +- .../private/metrics/packwerk_checker_usage.rb | 38 +- .../private/metrics/public_usage.rb | 12 +- lib/pack_stats/private/source_code_file.rb | 1 + lib/pack_stats/tag.rb | 6 +- lib/pack_stats/tags.rb | 7 +- pack_stats.gemspec | 66 +- spec/lib/gauge_metric_spec.rb | 17 +- spec/pack_stats_spec.rb | 4361 +++++++++++++---- spec/spec_helper.rb | 42 +- 25 files changed, 3890 insertions(+), 1203 deletions(-) create mode 100644 .rubocop.yml create mode 100644 .rubocop_todo.yml create mode 100644 .rubyfmtignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3397e58..2b3d764 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,35 +7,17 @@ on: pull_request: jobs: - rspec: + call-workflow-from-shared-config: + uses: rubyatscale/shared-config/.github/workflows/ci.yml@main + secrets: inherit + rubyfmt: + name: "Rubyfmt" runs-on: ubuntu-latest - strategy: - matrix: - ruby: - - '3.3' - - '3.4' - - '4.0' - env: - BUNDLE_GEMFILE: Gemfile - name: "RSpec tests: Ruby ${{ matrix.ruby }}" steps: - - uses: actions/checkout@v4 - - name: Set up Ruby ${{ matrix.ruby }} - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - ruby-version: ${{ matrix.ruby }} - - name: Run tests - run: bundle exec rspec - static_type_check: - name: "Type Check" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - ruby-version: '4.0' - - name: Run static type checks - run: bundle exec srb tc + - uses: actions/checkout@v7 + - name: Install rubyfmt + run: | + curl -sL "https://github.com/fables-tales/rubyfmt/releases/download/v0.14.1/rubyfmt-v0.14.1-Linux-x86_64.tar.gz" | tar xz + sudo install -m 755 tmp/releases/v0.14.1-Linux/rubyfmt /usr/local/bin/rubyfmt + - name: Check formatting + run: rubyfmt --check lib/ spec/ Rakefile pack_stats.gemspec Gemfile diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..23460de --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,38 @@ +inherit_from: .rubocop_todo.yml + +inherit_mode: + merge: + - Exclude + - Include + +inherit_gem: + rubocop-gusto: + - config/default.yml + +plugins: + - rubocop-gusto + - rubocop-rubyfmt + +# The behavior of RuboCop can be controlled via the .rubocop.yml +# configuration file. It makes it possible to enable/disable +# certain cops (checks) and to alter their behavior if they accept +# any parameters. The file can be placed either in your home +# directory or in some project directory. +# +# RuboCop will start looking for the configuration file in the directory +# where the inspected file is and continue its way up to the root directory. +# +# See https://docs.rubocop.org/rubocop/configuration +AllCops: + NewCops: enable + SuggestExtensions: false + Exclude: + - bin/**/* + - vendor/bundle/**/** + TargetRubyVersion: 3.3 + +RSpec/NotToNot: + Enabled: true + +Style/BlockDelimiters: + Enabled: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..de3b64e --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,64 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2026-07-23 21:28:09 UTC using RuboCop version 1.88.0. +# 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: 8 +# Configuration parameters: EnforcedStyle, AllowedGems. +# SupportedStyles: Gemfile, gems.rb, gemspec +Gemspec/DevelopmentDependencies: + Exclude: + - 'pack_stats.gemspec' + +# Offense count: 2 +# Configuration parameters: AllowComments, AllowEmptyLambdas. +Lint/EmptyBlock: + Exclude: + - 'spec/pack_stats_spec.rb' + +# Offense count: 1 +# Configuration parameters: CountKeywordArgs, MaxOptionalParameters. +Metrics/ParameterLists: + Max: 8 + +# Offense count: 14 +# Configuration parameters: Prefixes, AllowedPatterns. +# Prefixes: when, with, without +RSpec/ContextWording: + Exclude: + - 'spec/pack_stats_spec.rb' + - 'spec/spec_helper.rb' + +# Offense count: 2 +RSpec/RepeatedExampleGroupBody: + Exclude: + - 'spec/pack_stats_spec.rb' + +# Offense count: 2 +# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector. +# SupportedInflectors: default, active_support +RSpec/SpecFilePathFormat: + Exclude: + - 'spec/lib/gauge_metric_spec.rb' + - 'spec/pack_stats_spec.rb' + +# Offense count: 1 +Sorbet/ForbidTUnsafe: + Exclude: + - 'lib/pack_stats.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: SuggestedStrictness. +Sorbet/StrictSigil: + Exclude: + - 'spec/spec_helper.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/CombinableLoops: + Exclude: + - 'lib/pack_stats/private/metrics/dependencies.rb' diff --git a/.rubyfmtignore b/.rubyfmtignore new file mode 100644 index 0000000..d9de98d --- /dev/null +++ b/.rubyfmtignore @@ -0,0 +1 @@ +bin/** diff --git a/Gemfile b/Gemfile index bfea595..6c597de 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,5 @@ -source 'https://rubygems.org' +# frozen_string_literal: true +source "https://rubygems.org" # Specify your gem's dependencies in pack_stats.gemspec gemspec diff --git a/Gemfile.lock b/Gemfile.lock index 44eba9b..173cedf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -176,6 +176,16 @@ GEM rubocop-ast (1.49.1) parser (>= 3.3.7.2) prism (~> 1.7) + rubocop-gusto (11.3.0) + code_teams + lint_roller + rubocop (>= 1.76) + rubocop-performance + rubocop-rake + rubocop-rspec + rubocop-sorbet + smart_todo + thor rubocop-packs (0.0.45) activesupport base64 @@ -185,6 +195,20 @@ GEM rubocop (~> 1.0) rubocop-sorbet (>= 0.8.4) sorbet-runtime + rubocop-performance (1.26.1) + lint_roller (~> 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.47.1, < 2.0) + rubocop-rake (0.7.1) + lint_roller (~> 1.1) + rubocop (>= 1.72.1) + rubocop-rspec (3.10.2) + lint_roller (~> 1.1) + regexp_parser (>= 2.0) + rubocop (~> 1.86, >= 1.86.2) + rubocop-rubyfmt (0.1.1) + lint_roller (~> 1.1) + rubocop (>= 1.72.2) rubocop-sorbet (0.12.0) lint_roller rubocop (>= 1.75.2) @@ -194,6 +218,8 @@ GEM rubydex (0.2.6-x86_64-linux) securerandom (0.4.1) smart_properties (1.17.0) + smart_todo (1.11.0) + prism (~> 1.0) sorbet (0.6.13321) sorbet-static (= 0.6.13321) sorbet-runtime (0.6.13321) @@ -253,8 +279,10 @@ DEPENDENCIES pry rake rspec (~> 3.0) + rubocop-gusto + rubocop-rubyfmt sorbet tapioca BUNDLED WITH - 4.0.15 + 4.0.15 diff --git a/Rakefile b/Rakefile index 806deab..89233b8 100644 --- a/Rakefile +++ b/Rakefile @@ -1,8 +1,9 @@ # typed: ignore +# frozen_string_literal: true -require 'bundler/gem_tasks' -require 'rspec/core/rake_task' +require "bundler/gem_tasks" +require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) -task default: :spec +task(default: :spec) diff --git a/lib/pack_stats.rb b/lib/pack_stats.rb index 0eaddb0..4d6e72e 100644 --- a/lib/pack_stats.rb +++ b/lib/pack_stats.rb @@ -1,31 +1,33 @@ # typed: strict - -require 'sorbet-runtime' -require 'json' -require 'yaml' -require 'benchmark' -require 'code_teams' -require 'code_ownership' -require 'pathname' -require 'packs' -require 'pack_stats/private' -require 'pack_stats/private/source_code_file' -require 'pack_stats/private/datadog_reporter' -require 'parse_packwerk' -require 'pack_stats/tag' -require 'pack_stats/tags' -require 'pack_stats/gauge_metric' +# frozen_string_literal: true + +require "sorbet-runtime" +require "json" +require "yaml" +require "benchmark" +require "code_teams" +require "code_ownership" +require "pathname" +require "packs" +require "pack_stats/private" +require "pack_stats/private/source_code_file" +require "pack_stats/private/datadog_reporter" +require "parse_packwerk" +require "pack_stats/tag" +require "pack_stats/tags" +require "pack_stats/gauge_metric" module PackStats extend T::Sig - ROOT_PACKAGE_NAME = T.let('root'.freeze, String) + ROOT_PACKAGE_NAME = T.let("root", String) DEFAULT_COMPONENTIZED_SOURCE_CODE_LOCATIONS = T.let( [ - Pathname.new('components'), - Pathname.new('gems'), - ].freeze, T::Array[Pathname] + Pathname.new("components"), + Pathname.new("gems") + ].freeze, + T::Array[Pathname] ) sig do @@ -40,36 +42,36 @@ module PackStats packaged_source_code_locations: T.nilable(T::Array[Pathname]), # See note on get_metrics max_enforcements_tag_value: T::Boolean - ).void + ) + .void end def self.report_to_datadog!( datadog_client:, app_name:, source_code_pathnames:, componentized_source_code_locations: DEFAULT_COMPONENTIZED_SOURCE_CODE_LOCATIONS, - report_time: Time.now, # rubocop:disable Rails/TimeZone + report_time: Time.now, verbose: false, packaged_source_code_locations: [], max_enforcements_tag_value: false ) - all_metrics = self.get_metrics( - source_code_pathnames: source_code_pathnames, - componentized_source_code_locations: componentized_source_code_locations, - app_name: app_name, - max_enforcements_tag_value: max_enforcements_tag_value, + source_code_pathnames:, + componentized_source_code_locations:, + app_name:, + max_enforcements_tag_value: ) # This helps us debug what metrics are being sent if verbose all_metrics.each do |metric| - puts "Sending metric: #{metric}" + puts("Sending metric: #{metric}") end end Private::DatadogReporter.report!( - datadog_client: datadog_client, - report_time: report_time, + datadog_client:, + report_time:, metrics: all_metrics ) end @@ -86,7 +88,8 @@ def self.report_to_datadog!( # Once with the violation counts as configured in the app # Another time with the violation counts after turning on all enforcements and running `bin/packwerk update`. max_enforcements_tag_value: T::Boolean - ).returns(T::Array[GaugeMetric]) + ) + .returns(T::Array[GaugeMetric]) end def self.get_metrics( source_code_pathnames:, @@ -95,31 +98,32 @@ def self.get_metrics( packaged_source_code_locations: [], max_enforcements_tag_value: false ) - GaugeMetric.set_max_enforcements_tag(max_enforcements_tag_value) Private::DatadogReporter.get_metrics( source_code_files: source_code_files( - source_code_pathnames: source_code_pathnames, - componentized_source_code_locations: componentized_source_code_locations, + source_code_pathnames:, + componentized_source_code_locations: ), - app_name: app_name + app_name: ) end sig do params( source_code_pathnames: T::Array[Pathname], - componentized_source_code_locations: T::Array[Pathname], - ).returns(T::Array[Private::SourceCodeFile]) + componentized_source_code_locations: T::Array[Pathname] + ) + .returns(T::Array[Private::SourceCodeFile]) end def self.source_code_files( source_code_pathnames:, componentized_source_code_locations: ) - # Sorbet has the wrong signatures for `Pathname#find`, whoops! - componentized_file_set = Set.new(componentized_source_code_locations.select(&:exist?).flat_map { |pathname| T.unsafe(pathname).find.to_a }) + componentized_file_set = Set.new( + componentized_source_code_locations.select(&:exist?).flat_map { |pathname| T.unsafe(pathname).find.to_a } + ) packaged_file_set = Packs.all.flat_map do |pack| pack.relative_path.find.to_a @@ -132,7 +136,7 @@ def self.source_code_files( packaged_file = packaged_file_set.include?(pathname) Private::SourceCodeFile.new( - pathname: pathname, + pathname:, team_owner: CodeOwnership.for_file(pathname.to_s), is_componentized_file: componentized_file, is_packaged_file: packaged_file diff --git a/lib/pack_stats/gauge_metric.rb b/lib/pack_stats/gauge_metric.rb index d5975e7..269a588 100644 --- a/lib/pack_stats/gauge_metric.rb +++ b/lib/pack_stats/gauge_metric.rb @@ -1,4 +1,5 @@ # typed: strict +# frozen_string_literal: true module PackStats class GaugeMetric < T::Struct @@ -14,20 +15,20 @@ def self.for(metric_name, count, tags) # https://docs.datadoghq.com/metrics/custom_metrics/#naming-custom-metrics # Metric names must not exceed 200 characters. Fewer than 100 is preferred from a UI perspective if name.length > 200 - raise StandardError.new("Metrics names must not exceed 200 characters: #{name}") # rubocop:disable Style/RaiseArgs + raise StandardError, "Metrics names must not exceed 200 characters: #{name}" end all_tags = [*tags, max_enforcements_tag] new( - name: name, - count: count, + name:, + count:, tags: all_tags ) end sig { returns(String) } def to_s - "#{name} with count #{count}, with tags #{tags.map(&:to_s).join(', ')}" + "#{name} with count #{count}, with tags #{tags.join(", ")}" end sig { params(other: GaugeMetric).returns(T::Boolean) } @@ -40,12 +41,12 @@ def ==(other) sig { params(tag_value: T::Boolean).void } def self.set_max_enforcements_tag(tag_value) @max_enforcements_tag = T.let(@max_enforcements_tag, T.nilable(Tag)) - @max_enforcements_tag = Tag.new(key: 'max_enforcements', value: tag_value ? 'true' : 'false') + @max_enforcements_tag = Tag.new(key: "max_enforcements", value: tag_value ? "true" : "false") end sig { returns(Tag) } def self.max_enforcements_tag - @max_enforcements_tag || Tag.new(key: 'max_enforcements', value: 'false') + @max_enforcements_tag || Tag.new(key: "max_enforcements", value: "false") end end end diff --git a/lib/pack_stats/private.rb b/lib/pack_stats/private.rb index 070f1b9..9186fa8 100644 --- a/lib/pack_stats/private.rb +++ b/lib/pack_stats/private.rb @@ -1,13 +1,15 @@ # typed: strict +# frozen_string_literal: true module PackStats module Private extend T::Sig - sig { params(package: ParsePackwerk::Package).returns(T.nilable(String) )} + sig { params(package: ParsePackwerk::Package).returns(T.nilable(String)) } def self.package_owner(package) pack = Packs.find(package.name) return nil if pack.nil? + CodeOwnership.for_package(pack)&.name end end diff --git a/lib/pack_stats/private/datadog_reporter.rb b/lib/pack_stats/private/datadog_reporter.rb index 35d7051..dcf9260 100644 --- a/lib/pack_stats/private/datadog_reporter.rb +++ b/lib/pack_stats/private/datadog_reporter.rb @@ -1,14 +1,14 @@ # typed: strict # frozen_string_literal: true -require 'dogapi' -require 'pack_stats/private/metrics' -require 'pack_stats/private/metrics/files' -require 'pack_stats/private/metrics/public_usage' -require 'pack_stats/private/metrics/packwerk_checker_usage' -require 'pack_stats/private/metrics/dependencies' -require 'pack_stats/private/metrics/packages' -require 'pack_stats/private/metrics/packages_by_team' +require "dogapi" +require "pack_stats/private/metrics" +require "pack_stats/private/metrics/files" +require "pack_stats/private/metrics/public_usage" +require "pack_stats/private/metrics/packwerk_checker_usage" +require "pack_stats/private/metrics/dependencies" +require "pack_stats/private/metrics/packages" +require "pack_stats/private/metrics/packages_by_team" module PackStats module Private @@ -19,7 +19,8 @@ class DatadogReporter params( source_code_files: T::Array[SourceCodeFile], app_name: String - ).returns(T::Array[GaugeMetric]) + ) + .returns(T::Array[GaugeMetric]) end def self.get_metrics(source_code_files:, app_name:) packages = ParsePackwerk.all @@ -27,7 +28,7 @@ def self.get_metrics(source_code_files:, app_name:) [ *Metrics::Files.get_metrics(source_code_files, app_name), *Metrics::Packages.get_package_metrics(packages, app_name), - *Metrics::PackagesByTeam.get_package_metrics_by_team(packages, app_name), + *Metrics::PackagesByTeam.get_package_metrics_by_team(packages, app_name) ] end @@ -38,7 +39,8 @@ def self.get_metrics(source_code_files:, app_name:) # to ensure they fall into the same bucket. report_time: Time, metrics: T::Array[GaugeMetric] - ).void + ) + .void end def self.report!(datadog_client:, report_time:, metrics:) # @@ -49,7 +51,12 @@ def self.report!(datadog_client:, report_time:, metrics:) metrics.each_slice(1000).each do |metric_slice| datadog_client.batch_metrics do metric_slice.each do |metric| - datadog_client.emit_points(metric.name, [[report_time, metric.count]], type: 'gauge', tags: metric.tags.map(&:to_s)) + datadog_client.emit_points( + metric.name, + [[report_time, metric.count]], + type: "gauge", + tags: metric.tags.map(&:to_s) + ) end end end diff --git a/lib/pack_stats/private/metrics.rb b/lib/pack_stats/private/metrics.rb index f0ff3b2..8133f31 100644 --- a/lib/pack_stats/private/metrics.rb +++ b/lib/pack_stats/private/metrics.rb @@ -5,25 +5,25 @@ module PackStats module Private module Metrics extend T::Sig - UNKNOWN_OWNER = T.let('Unknown', String) + + UNKNOWN_OWNER = T.let("Unknown", String) sig { params(team_name: T.nilable(String)).returns(T::Array[Tag]) } def self.tags_for_team(team_name) - [Tag.for('team', team_name || UNKNOWN_OWNER)] + [Tag.for("team", team_name || UNKNOWN_OWNER)] end sig { params(package: ParsePackwerk::Package, app_name: String).returns(T::Array[Tag]) } def self.tags_for_package(package, app_name) - tags = [ - Tag.new(key: 'package', value: humanized_package_name(package.name)), - Tag.new(key: 'app', value: app_name), - *Metrics.tags_for_team(Private.package_owner(package)), + Tag.new(key: "package", value: humanized_package_name(package.name)), + Tag.new(key: "app", value: app_name), + *Metrics.tags_for_team(Private.package_owner(package)) ] - layer = package.config['layer'] + layer = package.config["layer"] if layer - tags << Tag.new(key: 'layer', value: layer) + tags << Tag.new(key: "layer", value: layer) end tags @@ -31,13 +31,13 @@ def self.tags_for_package(package, app_name) sig { params(team_name: T.nilable(String)).returns(T::Array[Tag]) } def self.tags_for_other_team(team_name) - [Tag.for('other_team', team_name || Metrics::UNKNOWN_OWNER)] + [Tag.for("other_team", team_name || Metrics::UNKNOWN_OWNER)] end sig { params(name: String).returns(String) } def self.humanized_package_name(name) if name == ParsePackwerk::ROOT_PACKAGE_NAME - 'root' + "root" else name end @@ -50,7 +50,7 @@ def self.file_count(violations) sig { params(package: ParsePackwerk::Package).returns(T::Boolean) } def self.has_readme?(package) - package.directory.join('README.md').exist? + package.directory.join("README.md").exist? end end end diff --git a/lib/pack_stats/private/metrics/dependencies.rb b/lib/pack_stats/private/metrics/dependencies.rb index d65f038..204125b 100644 --- a/lib/pack_stats/private/metrics/dependencies.rb +++ b/lib/pack_stats/private/metrics/dependencies.rb @@ -7,8 +7,12 @@ module Metrics class Dependencies extend T::Sig - sig { params(prefix: String, packages: T::Array[ParsePackwerk::Package], app_name: String).returns(T::Array[GaugeMetric]) } - def self.get_metrics(prefix, packages, app_name) + sig do + params(_prefix: String, packages: T::Array[ParsePackwerk::Package], app_name: String).returns( + T::Array[GaugeMetric] + ) + end + def self.get_metrics(_prefix, packages, app_name) all_metrics = T.let([], T::Array[GaugeMetric]) inbound_explicit_dependency_by_package = {} packages.each do |package| @@ -18,7 +22,7 @@ def self.get_metrics(prefix, packages, app_name) end end - packages.each do |package| # rubocop:disable Style/CombinableLoops + packages.each do |package| package_tags = Metrics.tags_for_package(package, app_name) # @@ -31,12 +35,19 @@ def self.get_metrics(prefix, packages, app_name) end owner = Private.package_owner(to_package) - tags = package_tags + [Tag.for('other_package', Metrics.humanized_package_name(explicit_dependency))] + Metrics.tags_for_other_team(owner) - all_metrics << GaugeMetric.for('by_package.dependencies.by_other_package.count', 1, tags) + tags = package_tags + + [Tag.for("other_package", Metrics.humanized_package_name(explicit_dependency))] + + Metrics.tags_for_other_team(owner) + all_metrics << GaugeMetric.for("by_package.dependencies.by_other_package.count", 1, tags) end - all_metrics << GaugeMetric.for('by_package.dependencies.count', package.dependencies.count, package_tags) - all_metrics << GaugeMetric.for('by_package.depended_on.count', inbound_explicit_dependency_by_package[package.name]&.count || 0, package_tags) + all_metrics << GaugeMetric.for("by_package.dependencies.count", package.dependencies.count, package_tags) + all_metrics << + GaugeMetric.for( + "by_package.depended_on.count", + inbound_explicit_dependency_by_package[package.name]&.count || 0, + package_tags + ) end all_metrics diff --git a/lib/pack_stats/private/metrics/files.rb b/lib/pack_stats/private/metrics/files.rb index fea9b0a..e23f6e6 100644 --- a/lib/pack_stats/private/metrics/files.rb +++ b/lib/pack_stats/private/metrics/files.rb @@ -11,19 +11,20 @@ class Files params( source_code_files: T::Array[SourceCodeFile], app_name: String - ).returns(T::Array[GaugeMetric]) + ) + .returns(T::Array[GaugeMetric]) end def self.get_metrics(source_code_files, app_name) all_metrics = T.let([], T::Array[GaugeMetric]) - app_level_tag = Tag.for('app', app_name) + app_level_tag = Tag.for("app", app_name) source_code_files.group_by { |file| file.team_owner&.name }.each do |team_name, files_for_team| file_tags = Metrics.tags_for_team(team_name) + [app_level_tag] - all_metrics += get_file_metrics('by_team', file_tags, files_for_team) + all_metrics += get_file_metrics("by_team", file_tags, files_for_team) end file_tags = [app_level_tag] - all_metrics += get_file_metrics('totals', file_tags, source_code_files) + all_metrics += get_file_metrics("totals", file_tags, source_code_files) all_metrics end @@ -32,13 +33,14 @@ def self.get_metrics(source_code_files, app_name) metric_name_suffix: String, tags: T::Array[Tag], files: T::Array[SourceCodeFile] - ).returns(T::Array[GaugeMetric]) + ) + .returns(T::Array[GaugeMetric]) end def self.get_file_metrics(metric_name_suffix, tags, files) [ GaugeMetric.for("component_files.#{metric_name_suffix}", files.count(&:componentized_file?), tags), GaugeMetric.for("packaged_files.#{metric_name_suffix}", files.count(&:packaged_file?), tags), - GaugeMetric.for("all_files.#{metric_name_suffix}", files.count, tags), + GaugeMetric.for("all_files.#{metric_name_suffix}", files.count, tags) ] end end diff --git a/lib/pack_stats/private/metrics/packages.rb b/lib/pack_stats/private/metrics/packages.rb index 71cf029..904fc31 100644 --- a/lib/pack_stats/private/metrics/packages.rb +++ b/lib/pack_stats/private/metrics/packages.rb @@ -11,33 +11,52 @@ class Packages params( packages: T::Array[ParsePackwerk::Package], app_name: String - ).returns(T::Array[GaugeMetric]) + ) + .returns(T::Array[GaugeMetric]) end def self.get_package_metrics(packages, app_name) all_metrics = [] - app_level_tag = Tag.for('app', app_name) + app_level_tag = Tag.for("app", app_name) package_tags = T.let([app_level_tag], T::Array[Tag]) - all_metrics << GaugeMetric.for('all_packages.count', packages.count, package_tags) - all_metrics << GaugeMetric.for('all_packages.dependencies.count', packages.sum { |package| package.dependencies.count }, package_tags) + all_metrics << GaugeMetric.for("all_packages.count", packages.count, package_tags) + all_metrics << + GaugeMetric.for( + "all_packages.dependencies.count", + packages.sum { |package| package.dependencies.count }, + package_tags + ) PackwerkCheckerUsage::CHECKERS.each do |checker| - violation_count = packages.sum { |package| Metrics.file_count(package.violations.select{|v| v.type == checker.violation_type}) } + violation_count = packages.sum do |package| + Metrics.file_count(package.violations.select { |v| v.type == checker.violation_type }) + end + tags = package_tags + [checker.violation_type_tag] all_metrics << GaugeMetric.for("all_packages.violations.count", violation_count, tags) end - all_metrics += Metrics::PublicUsage.get_public_usage_metrics('all_packages', packages, package_tags) - all_metrics << GaugeMetric.for('all_packages.has_readme.count', packages.count { |package| Metrics.has_readme?(package) }, package_tags) - - all_metrics += Metrics::PackwerkCheckerUsage.get_checker_metrics('all_packages', packages, package_tags) - all_metrics << GaugeMetric.for('all_packages.package_based_file_ownership.count', packages.count { |package| !package.metadata['owner'].nil? }, package_tags) + all_metrics += Metrics::PublicUsage.get_public_usage_metrics("all_packages", packages, package_tags) + all_metrics << + GaugeMetric.for( + "all_packages.has_readme.count", + packages.count { |package| Metrics.has_readme?(package) }, + package_tags + ) + + all_metrics += Metrics::PackwerkCheckerUsage.get_checker_metrics("all_packages", packages, package_tags) + all_metrics << + GaugeMetric.for( + "all_packages.package_based_file_ownership.count", + packages.count { |package| !package.metadata["owner"].nil? }, + package_tags + ) inbound_violations_by_package = packages.flat_map(&:violations).group_by(&:to_package_name) packages.each do |package| package_tags = Metrics.tags_for_package(package, app_name) - all_metrics += Metrics::PublicUsage.get_public_usage_metrics('by_package', [package], package_tags) + all_metrics += Metrics::PublicUsage.get_public_usage_metrics("by_package", [package], package_tags) outbound_violations = package.violations inbound_violations = inbound_violations_by_package[package.name] || [] @@ -47,32 +66,45 @@ def self.get_package_metrics(packages, app_name) case direction when PackwerkCheckerUsage::Direction::Outbound - all_violations_of_type = outbound_violations.select { |v| v.type == checker.violation_type } + all_violations_of_type = outbound_violations.select { |v| v.type == checker.violation_type } packages.each do |other_package| - violations = package.violations.select{|v| v.to_package_name == other_package.name && v.type == checker.violation_type } + violations = package.violations.select do |v| + v.to_package_name == other_package.name && v.type == checker.violation_type + end - tags = package_tags + [ - Tag.for('other_package', Metrics.humanized_package_name(other_package.name)), - *Metrics.tags_for_other_team(Private.package_owner(other_package)), - checker.violation_type_tag - ] + tags = package_tags + + [ + Tag.for("other_package", Metrics.humanized_package_name(other_package.name)), + *Metrics.tags_for_other_team(Private.package_owner(other_package)), + checker.violation_type_tag + ] count = Metrics.file_count(violations) if count > 0 - all_metrics << GaugeMetric.for("by_package.violations.by_other_package.count", Metrics.file_count(violations), tags) + all_metrics << + GaugeMetric.for( + "by_package.violations.by_other_package.count", + Metrics.file_count(violations), + tags + ) end end + when PackwerkCheckerUsage::Direction::Inbound - all_violations_of_type = inbound_violations.select { |v| v.type == checker.violation_type } + all_violations_of_type = inbound_violations.select { |v| v.type == checker.violation_type } packages.each do |other_package| - violations = other_package.violations.select{|v| v.to_package_name == package.name && v.type == checker.violation_type } - tags = package_tags + [ - Tag.for('other_package', Metrics.humanized_package_name(other_package.name)), - *Metrics.tags_for_other_team(Private.package_owner(other_package)), - checker.violation_type_tag - ] + violations = other_package.violations.select do |v| + v.to_package_name == package.name && v.type == checker.violation_type + end + + tags = package_tags + + [ + Tag.for("other_package", Metrics.humanized_package_name(other_package.name)), + *Metrics.tags_for_other_team(Private.package_owner(other_package)), + checker.violation_type_tag + ] count = Metrics.file_count(violations) if count > 0 @@ -84,11 +116,12 @@ def self.get_package_metrics(packages, app_name) end tags = package_tags + [checker.violation_type_tag] - all_metrics << GaugeMetric.for("by_package.violations.count", Metrics.file_count(all_violations_of_type), tags) + all_metrics << + GaugeMetric.for("by_package.violations.count", Metrics.file_count(all_violations_of_type), tags) end end - all_metrics += Metrics::Dependencies.get_metrics('by_package', packages, app_name) + all_metrics += Metrics::Dependencies.get_metrics("by_package", packages, app_name) all_metrics end diff --git a/lib/pack_stats/private/metrics/packages_by_team.rb b/lib/pack_stats/private/metrics/packages_by_team.rb index 5a66bd4..8098fbd 100644 --- a/lib/pack_stats/private/metrics/packages_by_team.rb +++ b/lib/pack_stats/private/metrics/packages_by_team.rb @@ -11,59 +11,83 @@ class PackagesByTeam params( all_packages: T::Array[ParsePackwerk::Package], app_name: String - ).returns(T::Array[GaugeMetric]) + ) + .returns(T::Array[GaugeMetric]) end def self.get_package_metrics_by_team(all_packages, app_name) all_metrics = T.let([], T::Array[GaugeMetric]) - app_level_tag = Tag.for('app', app_name) + app_level_tag = Tag.for("app", app_name) - all_packages.group_by { |package| Private.package_owner(package) }.each do |team_name, packages_for_team| team_tags = Metrics.tags_for_team(team_name) + [app_level_tag] - all_metrics << GaugeMetric.for('by_team.all_packages.count', packages_for_team.count, team_tags) - all_metrics += Metrics::PackwerkCheckerUsage.get_checker_metrics('by_team', packages_for_team, team_tags) - all_metrics += Metrics::PublicUsage.get_public_usage_metrics('by_team', packages_for_team, team_tags) - all_metrics << GaugeMetric.for('by_team.has_readme.count', packages_for_team.count { |package| Metrics.has_readme?(package) }, team_tags) + all_metrics << GaugeMetric.for("by_team.all_packages.count", packages_for_team.count, team_tags) + all_metrics += Metrics::PackwerkCheckerUsage.get_checker_metrics("by_team", packages_for_team, team_tags) + all_metrics += Metrics::PublicUsage.get_public_usage_metrics("by_team", packages_for_team, team_tags) + all_metrics << + GaugeMetric.for( + "by_team.has_readme.count", + packages_for_team.count { |package| Metrics.has_readme?(package) }, + team_tags + ) outbound_violations = packages_for_team.flat_map(&:violations) # We look at `all_packages` because we care about ALL inbound violations across all teams inbound_violations_by_package = all_packages.flat_map(&:violations).group_by(&:to_package_name) # Here we only look at packages_for_team because we only care about inbound violations onto packages for this team - inbound_violations = packages_for_team.flat_map { |package| inbound_violations_by_package[package.name] || [] } + inbound_violations = packages_for_team.flat_map do |package| + inbound_violations_by_package[package.name] || [] + end PackwerkCheckerUsage::CHECKERS.each do |checker| direction = checker.direction case direction when PackwerkCheckerUsage::Direction::Outbound - all_violations_of_type = outbound_violations.select { |v| v.type == checker.violation_type } + outbound_violations.select { |v| v.type == checker.violation_type } + + violation_count = packages_for_team.sum do |package| + Metrics.file_count(package.violations.select { |v| v.type == checker.violation_type }) + end - violation_count = packages_for_team.sum { |package| Metrics.file_count(package.violations.select{|v| v.type == checker.violation_type}) } tags = team_tags + [checker.violation_type_tag] all_metrics << GaugeMetric.for("by_team.violations.count", violation_count, tags) - all_packages.group_by { |package| Private.package_owner(package) }.each do |other_team_name, other_teams_packages| - violations = outbound_violations.select{|v| other_teams_packages.map(&:name).include?(v.to_package_name) && v.type == checker.violation_type} - tags = team_tags + Metrics.tags_for_other_team(other_team_name) + [checker.violation_type_tag] - count = Metrics.file_count(violations) - if count > 0 - all_metrics << GaugeMetric.for("by_team.violations.by_other_team.count", count, tags) + all_packages + .group_by { |package| Private.package_owner(package) } + .each do |other_team_name, other_teams_packages| + violations = outbound_violations.select do |v| + other_teams_packages.map(&:name).include?(v.to_package_name) && v.type == checker.violation_type + end + + tags = team_tags + Metrics.tags_for_other_team(other_team_name) + [checker.violation_type_tag] + count = Metrics.file_count(violations) + if count > 0 + all_metrics << GaugeMetric.for("by_team.violations.by_other_team.count", count, tags) + end end - end + when PackwerkCheckerUsage::Direction::Inbound - all_violations_of_type = inbound_violations.select { |v| v.type == checker.violation_type } + inbound_violations.select { |v| v.type == checker.violation_type } + + violation_count = packages_for_team.sum do |package| + Metrics.file_count(package.violations.select { |v| v.type == checker.violation_type }) + end - violation_count = packages_for_team.sum { |package| Metrics.file_count(package.violations.select{|v| v.type == checker.violation_type}) } tags = team_tags + [checker.violation_type_tag] all_metrics << GaugeMetric.for("by_team.violations.count", violation_count, tags) - all_packages.group_by { |package| Private.package_owner(package) }.each do |other_team_name, other_teams_packages| - violations = other_teams_packages.flat_map(&:violations).select{|v| packages_for_team.map(&:name).include?(v.to_package_name) && v.type == checker.violation_type} - tags = team_tags + Metrics.tags_for_other_team(other_team_name) + [checker.violation_type_tag] - count = Metrics.file_count(violations) - if count > 0 - all_metrics << GaugeMetric.for("by_team.violations.by_other_team.count", count, tags) + all_packages + .group_by { |package| Private.package_owner(package) } + .each do |other_team_name, other_teams_packages| + violations = other_teams_packages.flat_map(&:violations).select do |v| + packages_for_team.map(&:name).include?(v.to_package_name) && v.type == checker.violation_type + end + + tags = team_tags + Metrics.tags_for_other_team(other_team_name) + [checker.violation_type_tag] + count = Metrics.file_count(violations) + if count > 0 + all_metrics << GaugeMetric.for("by_team.violations.by_other_team.count", count, tags) + end end - end else T.absurd(direction) end diff --git a/lib/pack_stats/private/metrics/packwerk_checker_usage.rb b/lib/pack_stats/private/metrics/packwerk_checker_usage.rb index 1c7c04b..c53394b 100644 --- a/lib/pack_stats/private/metrics/packwerk_checker_usage.rb +++ b/lib/pack_stats/private/metrics/packwerk_checker_usage.rb @@ -1,7 +1,7 @@ # typed: strict # frozen_string_literal: true -require 'rubocop-packs' +require "rubocop-packs" module PackStats module Private @@ -29,23 +29,39 @@ class PackwerkChecker < T::Struct sig { returns(Tag) } def violation_type_tag Tag.new( - key: 'violation_type', + key: "violation_type", value: violation_type ) end end - CHECKERS = T.let([ - PackwerkChecker.new(key: 'enforce_dependencies', violation_type: 'dependency', direction: Direction::Outbound), - PackwerkChecker.new(key: 'enforce_privacy', violation_type: 'privacy', direction: Direction::Inbound), - PackwerkChecker.new(key: 'enforce_folder_privacy', violation_type: 'folder_privacy', direction: Direction::Inbound), - PackwerkChecker.new(key: 'enforce_layers', violation_type: 'layer', direction: Direction::Outbound), - PackwerkChecker.new(key: 'enforce_visibility', violation_type: 'visibility', direction: Direction::Outbound), - ], T::Array[PackwerkChecker]) + CHECKERS = T.let( + [ + PackwerkChecker.new( + key: "enforce_dependencies", + violation_type: "dependency", + direction: Direction::Outbound + ), + PackwerkChecker.new(key: "enforce_privacy", violation_type: "privacy", direction: Direction::Inbound), + PackwerkChecker.new( + key: "enforce_folder_privacy", + violation_type: "folder_privacy", + direction: Direction::Inbound + ), + PackwerkChecker.new(key: "enforce_layers", violation_type: "layer", direction: Direction::Outbound), + PackwerkChecker.new(key: "enforce_visibility", violation_type: "visibility", direction: Direction::Outbound) + ].freeze, + T::Array[PackwerkChecker] + ) - sig { params(prefix: String, packages: T::Array[ParsePackwerk::Package], package_tags: T::Array[Tag]).returns(T::Array[GaugeMetric]) } + sig do + params(prefix: String, packages: T::Array[ParsePackwerk::Package], package_tags: T::Array[Tag]).returns( + T::Array[GaugeMetric] + ) + end def self.get_checker_metrics(prefix, packages, package_tags) metrics = T.let([], T::Array[GaugeMetric]) + possible_values = ["false", "true", "strict"] CHECKERS.each do |checker| checker_values = packages.map do |package| @@ -54,7 +70,7 @@ def self.get_checker_metrics(prefix, packages, package_tags) checker_values_tally = checker_values.map(&:to_s).tally - ['false', 'true', 'strict'].each do |possible_value| + possible_values.each do |possible_value| count = checker_values_tally.fetch(possible_value, 0) metric_name = "#{prefix}.packwerk_checkers.#{possible_value}.count" tags = package_tags + [checker.violation_type_tag] diff --git a/lib/pack_stats/private/metrics/public_usage.rb b/lib/pack_stats/private/metrics/public_usage.rb index 8fc554a..9dbbac9 100644 --- a/lib/pack_stats/private/metrics/public_usage.rb +++ b/lib/pack_stats/private/metrics/public_usage.rb @@ -7,17 +7,21 @@ module Metrics class PublicUsage extend T::Sig - sig { params(prefix: String, packages: T::Array[ParsePackwerk::Package], package_tags: T::Array[Tag]).returns(T::Array[GaugeMetric]) } + sig do + params(prefix: String, packages: T::Array[ParsePackwerk::Package], package_tags: T::Array[Tag]).returns( + T::Array[GaugeMetric] + ) + end def self.get_public_usage_metrics(prefix, packages, package_tags) packages_except_for_root = packages.reject { |package| package.name == ParsePackwerk::ROOT_PACKAGE_NAME } all_files = packages_except_for_root.flat_map do |package| - package.directory.glob('**/**.rb') + package.directory.glob("**/**.rb") end all_public_files = T.let([], T::Array[Pathname]) is_using_public_directory = 0 packages_except_for_root.each do |package| - public_files = package.directory.glob('app/public/**/**.rb') + public_files = package.directory.glob("app/public/**/**.rb") all_public_files += public_files is_using_public_directory += 1 if public_files.any? end @@ -27,7 +31,7 @@ def self.get_public_usage_metrics(prefix, packages, package_tags) [ GaugeMetric.for("#{prefix}.all_files.count", all_files.count, package_tags), GaugeMetric.for("#{prefix}.public_files.count", all_public_files.count, package_tags), - GaugeMetric.for("#{prefix}.using_public_directory.count", is_using_public_directory, package_tags), + GaugeMetric.for("#{prefix}.using_public_directory.count", is_using_public_directory, package_tags) ] end end diff --git a/lib/pack_stats/private/source_code_file.rb b/lib/pack_stats/private/source_code_file.rb index 7e891dd..500d85e 100644 --- a/lib/pack_stats/private/source_code_file.rb +++ b/lib/pack_stats/private/source_code_file.rb @@ -1,4 +1,5 @@ # typed: strict +# frozen_string_literal: true module PackStats module Private diff --git a/lib/pack_stats/tag.rb b/lib/pack_stats/tag.rb index 11b4cd4..5b53327 100644 --- a/lib/pack_stats/tag.rb +++ b/lib/pack_stats/tag.rb @@ -1,8 +1,10 @@ # typed: strict +# frozen_string_literal: true module PackStats class Tag < T::Struct extend T::Sig + const :key, String const :value, String @@ -14,8 +16,8 @@ def to_s sig { params(key: String, value: String).returns(Tag) } def self.for(key, value) new( - key: key, - value: value + key:, + value: ) end diff --git a/lib/pack_stats/tags.rb b/lib/pack_stats/tags.rb index 761a1b3..0ab6d02 100644 --- a/lib/pack_stats/tags.rb +++ b/lib/pack_stats/tags.rb @@ -1,4 +1,5 @@ # typed: strict +# frozen_string_literal: true module PackStats module Tags @@ -7,12 +8,12 @@ module Tags sig { params(colon_delimited_tag_strings: T::Array[String]).returns(T::Array[Tag]) } def self.for(colon_delimited_tag_strings) colon_delimited_tag_strings.map do |colon_delimited_tag_string| - key, value = colon_delimited_tag_string.split(':') + key, value = colon_delimited_tag_string.split(":") raise StandardError, "Improperly formatted tag `#{colon_delimited_tag_string}`" if key.nil? || value.nil? Tag.new( - key: key, - value: value + key:, + value: ) end end diff --git a/pack_stats.gemspec b/pack_stats.gemspec index 7e4b8e3..5b5f5a5 100644 --- a/pack_stats.gemspec +++ b/pack_stats.gemspec @@ -1,43 +1,49 @@ +# frozen_string_literal: true Gem::Specification.new do |spec| - spec.name = 'pack_stats' - spec.version = '0.2.1' - spec.authors = ['Gusto Engineers'] - spec.email = ['dev@gusto.com'] + spec.name = "pack_stats" + spec.version = "0.2.1" + spec.authors = ["Gusto Engineers"] + spec.email = ["dev@gusto.com"] - spec.summary = 'A gem to collect statistics about modularization progress in a Rails application using packwerk.' - spec.description = 'A gem to collect statistics about modularization progress in a Rails application using packwerk.' - spec.homepage = 'https://github.com/rubyatscale/pack_stats' - spec.license = 'MIT' + spec.summary = "A gem to collect statistics about modularization progress in a Rails application using packwerk." + spec.description = "A gem to collect statistics about modularization progress in a Rails application using packwerk." + spec.homepage = "https://github.com/rubyatscale/pack_stats" + spec.license = "MIT" if spec.respond_to?(:metadata) - spec.metadata['homepage_uri'] = spec.homepage - spec.metadata['source_code_uri'] = 'https://github.com/rubyatscale/pack_stats' - spec.metadata['changelog_uri'] = 'https://github.com/rubyatscale/pack_stats/releases' - spec.metadata['allowed_push_host'] = 'https://rubygems.org' + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = "https://github.com/rubyatscale/pack_stats" + spec.metadata["changelog_uri"] = "https://github.com/rubyatscale/pack_stats/releases" + spec.metadata["allowed_push_host"] = "https://rubygems.org" + spec.metadata["rubygems_mfa_required"] = "true" else - raise 'RubyGems 2.0 or newer is required to protect against ' \ - 'public gem pushes.' + raise( + "RubyGems 2.0 or newer is required to protect against " \ + "public gem pushes." + ) end - spec.required_ruby_version = Gem::Requirement.new('>= 3.3') + spec.required_ruby_version = Gem::Requirement.new(">= 3.3") # Specify which files should be added to the gem when it is released. - spec.files = Dir['README.md', 'lib/**/*'] + spec.files = Dir["README.md", "lib/**/*"] - spec.require_paths = ['lib'] + spec.require_paths = ["lib"] - spec.add_dependency 'code_teams' - spec.add_dependency 'code_ownership' - spec.add_dependency 'dogapi' - spec.add_dependency 'packs' - spec.add_dependency 'parse_packwerk' - spec.add_dependency 'sorbet-runtime' - spec.add_dependency 'rubocop-packs' + spec.add_dependency("code_ownership") + spec.add_dependency("code_teams") + spec.add_dependency("dogapi") + spec.add_dependency("packs") + spec.add_dependency("parse_packwerk") + spec.add_dependency("rubocop-packs") + spec.add_dependency("sorbet-runtime") - spec.add_development_dependency 'base64' - spec.add_development_dependency 'pry' - spec.add_development_dependency 'rake' - spec.add_development_dependency 'rspec', '~> 3.0' - spec.add_development_dependency 'sorbet' - spec.add_development_dependency 'tapioca' + spec.add_development_dependency("base64") + spec.add_development_dependency("pry") + spec.add_development_dependency("rake") + spec.add_development_dependency("rspec", "~> 3.0") + spec.add_development_dependency("rubocop-gusto") + spec.add_development_dependency("rubocop-rubyfmt") + spec.add_development_dependency("sorbet") + spec.add_development_dependency("tapioca") end diff --git a/spec/lib/gauge_metric_spec.rb b/spec/lib/gauge_metric_spec.rb index 53c8c28..9358f2d 100644 --- a/spec/lib/gauge_metric_spec.rb +++ b/spec/lib/gauge_metric_spec.rb @@ -1,13 +1,20 @@ +# typed: false +# frozen_string_literal: true + module PackStats RSpec.describe GaugeMetric do - it 'errors when metric length is greater than 200' do - expect { GaugeMetric.for('a' * 250, 0, []) }.to raise_error do |e| - expect(e.message).to eq 'Metrics names must not exceed 200 characters: modularization.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + it "errors when metric length is greater than 200" do + expect { GaugeMetric.for("a" * 250, 0, []) }.to raise_error do |e| + expect(e.message).to( + eq( + "Metrics names must not exceed 200 characters: modularization.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + ) + ) end end - it 'does not error when metric is less than 100' do - expect { GaugeMetric.for('a' * 150, 0, []) }.to_not raise_error + it "does not error when metric is less than 100" do + expect { GaugeMetric.for("a" * 150, 0, []) }.not_to raise_error end end end diff --git a/spec/pack_stats_spec.rb b/spec/pack_stats_spec.rb index 12cba4e..79a24cd 100644 --- a/spec/pack_stats_spec.rb +++ b/spec/pack_stats_spec.rb @@ -1,1098 +1,3541 @@ +# typed: false # frozen_string_literal: true -module PackStats # rubocop:disable RSpec/DescribedClassModuleWrapping +module PackStats RSpec.describe PackStats do before do ParsePackwerk.bust_cache! - write_file('config/code_ownership.yml', YAML.dump({ 'owned_globs' => ['{app,components,lib,packs}/**/*.{rb,rake}'] })) + write_file( + "config/code_ownership.yml", + YAML.dump({"owned_globs" => ["{app,components,lib,packs}/**/*.{rb,rake}"]}) + ) end - describe 'PackStats.report_to_datadog!' do + describe "PackStats.report_to_datadog!" do let(:report_to_datadog) do PackStats.report_to_datadog!( - app_name: 'MyApp', - source_code_pathnames: Pathname.glob('**/**.rb'), - datadog_client: datadog_client, - report_time: report_time, + app_name: "MyApp", + source_code_pathnames: Pathname.glob("**/**.rb"), + datadog_client:, + report_time: ) end let(:datadog_client) { sorbet_double(Dogapi::Client) } - let(:report_time) { Time.now } # rubocop:disable Rails/TimeZone + let(:report_time) { Time.now } let(:expected_metric) do - GaugeMetric.for('some_metric', 11, Tags.for(['mykey:myvalue', 'myotherkey:myothervalue'])) + GaugeMetric.for("some_metric", 11, Tags.for(["mykey:myvalue", "myotherkey:myothervalue"])) end before do allow(PackStats).to receive(:get_metrics).and_return([expected_metric]) end - it 'emits to datadog' do - expect(datadog_client).to receive(:batch_metrics).and_yield # rubocop:disable RSpec/MessageSpies - expect(datadog_client).to receive(:emit_points).with( # rubocop:disable RSpec/MessageSpies - 'modularization.some_metric', - [[report_time, 11]], - type: 'gauge', - tags: ['mykey:myvalue', 'myotherkey:myothervalue', 'max_enforcements:false'] + it "emits to datadog" do + expect(datadog_client).to receive(:batch_metrics).and_yield + expect(datadog_client).to( + receive(:emit_points).with( + "modularization.some_metric", + [[report_time, 11]], + type: "gauge", + tags: ["mykey:myvalue", "myotherkey:myothervalue", "max_enforcements:false"] + ) ) report_to_datadog end end - describe 'PackStats.get_metrics' do - let(:subject) do + describe "PackStats.get_metrics" do + subject do PackStats.get_metrics( - app_name: 'MyApp', - source_code_pathnames: Pathname.glob('**/**.rb'), - componentized_source_code_locations: [Pathname.new('components')], + app_name: "MyApp", + source_code_pathnames: Pathname.glob("**/**.rb"), + componentized_source_code_locations: [Pathname.new("components")] ) end + let(:metrics) { subject } before do Packs.bust_cache! CodeTeams.bust_caches! CodeOwnership.bust_caches! - write_package_yml('.') - write_file('packs.yml', <<~YML) - pack_paths: - - packs/* - YML + write_package_yml(".") + write_file( + "packs.yml", + <<~YML + pack_paths: + - packs/* + YML + ) end - context 'in empty app' do + context "in empty app" do before do - write_file('empty_file.rb') + write_file("empty_file.rb") end - it 'emits the right metrics' do - expect(metrics).to include_metric GaugeMetric.for('component_files.by_team', 0, Tags.for(['team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.by_team', 0, Tags.for(['team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.by_team', 1, Tags.for(['team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('component_files.totals', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.totals', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.totals', 1, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.count', 1, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.dependencies.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.violations.count', 0, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.violations.count', 0, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 1, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.false.count', 0, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 1, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.false.count', 0, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.package_based_file_ownership.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.using_public_directory.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.all_files.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.public_files.count', 0, Tags.for(['app:MyApp'])) + it "emits the right metrics" do + expect(metrics).to( + include_metric GaugeMetric.for("component_files.by_team", 0, Tags.for(["team:Unknown", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("packaged_files.by_team", 0, Tags.for(["team:Unknown", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_files.by_team", 1, Tags.for(["team:Unknown", "app:MyApp"])) + ) + expect(metrics).to include_metric GaugeMetric.for("component_files.totals", 0, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("packaged_files.totals", 0, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("all_files.totals", 1, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("all_packages.count", 1, Tags.for(["app:MyApp"])) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.dependencies.count", 0, Tags.for(["app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.violations.count", 0, Tags.for(["app:MyApp", "violation_type:dependency"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.violations.count", 0, Tags.for(["app:MyApp", "violation_type:privacy"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 1, + Tags.for(["app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.false.count", + 0, + Tags.for(["app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 1, + Tags.for(["app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.false.count", + 0, + Tags.for(["app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.package_based_file_ownership.count", 0, Tags.for(["app:MyApp"])) + ) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.using_public_directory.count", 0, Tags.for(["app:MyApp"])) + ) + expect(metrics).to include_metric GaugeMetric.for("all_packages.all_files.count", 0, Tags.for(["app:MyApp"])) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.public_files.count", 0, Tags.for(["app:MyApp"])) + ) end - it 'emits no metrics about rubocop exclusions' do + it "emits no metrics about rubocop exclusions" do end end - context 'in app with a simple package owned by one team' do - include_context 'only one team' + context "in app with a simple package owned by one team" do + include_context "only one team" before do - write_file('empty_file.rb') - write_file('packs/only_package/app/some_package_file.rb') - write_file('packs/only_package/package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: false - CONTENTS - - write_file('packs/only_package/spec/some_package_file_spec.rb') + write_file("empty_file.rb") + write_file("packs/only_package/app/some_package_file.rb") + write_file( + "packs/only_package/package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: false + CONTENTS + ) + + write_file("packs/only_package/spec/some_package_file_spec.rb") end - it 'emits the right metrics' do - expect(metrics).to include_metric GaugeMetric.for('component_files.by_team', 0, Tags.for(['team:Some team', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.by_team', 2, Tags.for(['team:Some team', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.by_team', 3, Tags.for(['team:Some team', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('component_files.totals', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.totals', 2, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.totals', 3, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.count', 2, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.dependencies.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.violations.count', 0, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.violations.count', 0, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 1, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 1, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.package_based_file_ownership.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.using_public_directory.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.dependencies.count', 0, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.depended_on.count', 0, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.using_public_directory.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.all_files.count', 2, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.public_files.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.using_public_directory.count', 0, Tags.for(['app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.all_files.count', 2, Tags.for(['app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.public_files.count', 0, Tags.for(['app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.using_public_directory.count', 0, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.all_files.count', 2, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.public_files.count', 0, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown'])) + it "emits the right metrics" do + expect(metrics).to( + include_metric GaugeMetric.for("component_files.by_team", 0, Tags.for(["team:Some team", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("packaged_files.by_team", 2, Tags.for(["team:Some team", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_files.by_team", 3, Tags.for(["team:Some team", "app:MyApp"])) + ) + expect(metrics).to include_metric GaugeMetric.for("component_files.totals", 0, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("packaged_files.totals", 2, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("all_files.totals", 3, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("all_packages.count", 2, Tags.for(["app:MyApp"])) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.dependencies.count", 0, Tags.for(["app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.violations.count", 0, Tags.for(["app:MyApp", "violation_type:dependency"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.violations.count", 0, Tags.for(["app:MyApp", "violation_type:privacy"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 1, + Tags.for(["app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 1, + Tags.for(["app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.package_based_file_ownership.count", 0, Tags.for(["app:MyApp"])) + ) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.using_public_directory.count", 0, Tags.for(["app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.dependencies.count", + 0, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.depended_on.count", + 0, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.using_public_directory.count", 0, Tags.for(["app:MyApp"])) + ) + expect(metrics).to include_metric GaugeMetric.for("all_packages.all_files.count", 2, Tags.for(["app:MyApp"])) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.public_files.count", 0, Tags.for(["app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("by_team.using_public_directory.count", 0, Tags.for(["app:MyApp", "team:Unknown"])) + ) + ) + expect(metrics).to( + include_metric GaugeMetric.for("by_team.all_files.count", 2, Tags.for(["app:MyApp", "team:Unknown"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("by_team.public_files.count", 0, Tags.for(["app:MyApp", "team:Unknown"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.using_public_directory.count", + 0, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.all_files.count", + 2, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.public_files.count", + 0, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown"]) + ) + ) + ) end end - context 'in app that does not use package protection with a simple package owned by one team' do - include_context 'only one team' + context "in app that does not use package protection with a simple package owned by one team" do + include_context "only one team" before do - write_file('empty_file.rb') - write_file('packs/only_package/app/some_package_file.rb') - write_file('packs/only_package/package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: false - CONTENTS - - write_file('packs/only_package/spec/some_package_file_spec.rb') + write_file("empty_file.rb") + write_file("packs/only_package/app/some_package_file.rb") + write_file( + "packs/only_package/package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: false + CONTENTS + ) + + write_file("packs/only_package/spec/some_package_file_spec.rb") end - it 'emits the right metrics' do - expect(metrics).to include_metric GaugeMetric.for('component_files.by_team', 0, Tags.for(['team:Some team', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.by_team', 2, Tags.for(['team:Some team', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.by_team', 3, Tags.for(['team:Some team', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('component_files.totals', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.totals', 2, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.totals', 3, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.count', 2, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.dependencies.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.violations.count', 0, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.violations.count', 0, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 1, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 1, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.package_based_file_ownership.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.using_public_directory.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.dependencies.count', 0, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.depended_on.count', 0, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.using_public_directory.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.all_files.count', 2, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.public_files.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.using_public_directory.count', 0, Tags.for(['app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.all_files.count', 2, Tags.for(['app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.public_files.count', 0, Tags.for(['app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.using_public_directory.count', 0, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.all_files.count', 2, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.public_files.count', 0, Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown'])) + it "emits the right metrics" do + expect(metrics).to( + include_metric GaugeMetric.for("component_files.by_team", 0, Tags.for(["team:Some team", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("packaged_files.by_team", 2, Tags.for(["team:Some team", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_files.by_team", 3, Tags.for(["team:Some team", "app:MyApp"])) + ) + expect(metrics).to include_metric GaugeMetric.for("component_files.totals", 0, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("packaged_files.totals", 2, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("all_files.totals", 3, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("all_packages.count", 2, Tags.for(["app:MyApp"])) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.dependencies.count", 0, Tags.for(["app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.violations.count", 0, Tags.for(["app:MyApp", "violation_type:dependency"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.violations.count", 0, Tags.for(["app:MyApp", "violation_type:privacy"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 1, + Tags.for(["app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 1, + Tags.for(["app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.package_based_file_ownership.count", 0, Tags.for(["app:MyApp"])) + ) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.using_public_directory.count", 0, Tags.for(["app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.dependencies.count", + 0, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.depended_on.count", + 0, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.using_public_directory.count", 0, Tags.for(["app:MyApp"])) + ) + expect(metrics).to include_metric GaugeMetric.for("all_packages.all_files.count", 2, Tags.for(["app:MyApp"])) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.public_files.count", 0, Tags.for(["app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("by_team.using_public_directory.count", 0, Tags.for(["app:MyApp", "team:Unknown"])) + ) + ) + expect(metrics).to( + include_metric GaugeMetric.for("by_team.all_files.count", 2, Tags.for(["app:MyApp", "team:Unknown"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("by_team.public_files.count", 0, Tags.for(["app:MyApp", "team:Unknown"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.using_public_directory.count", + 0, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.all_files.count", + 2, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.public_files.count", + 0, + Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown"]) + ) + ) + ) end end - context 'in app with two packages owned by different teams' do - include_context 'team names are based off of file names' + context "in app with two packages owned by different teams" do + include_context "team names are based off of file names" before do - write_file('empty_file.rb') - write_file('packs/package_2/app/some_package_file.rb') - write_file('packs/package_2/package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: false - CONTENTS - - write_file('packs/package_2/spec/some_package_file_spec.rb') - write_file('packs/package_1/app/some_package_file.rb') - write_file('packs/package_1/package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: false - CONTENTS - - write_file('packs/package_1/spec/some_package_file_spec.rb') + write_file("empty_file.rb") + write_file("packs/package_2/app/some_package_file.rb") + write_file( + "packs/package_2/package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: false + CONTENTS + ) + + write_file("packs/package_2/spec/some_package_file_spec.rb") + write_file("packs/package_1/app/some_package_file.rb") + write_file( + "packs/package_1/package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: false + CONTENTS + ) + + write_file("packs/package_1/spec/some_package_file_spec.rb") end - it 'emits the right metrics' do - expect(metrics).to include_metric GaugeMetric.for('component_files.by_team', 0, Tags.for(['team:Team 2', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.by_team', 2, Tags.for(['team:Team 2', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.by_team', 2, Tags.for(['team:Team 2', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('component_files.by_team', 0, Tags.for(['team:Team 1', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.by_team', 2, Tags.for(['team:Team 1', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.by_team', 2, Tags.for(['team:Team 1', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('component_files.by_team', 0, Tags.for(['team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.by_team', 0, Tags.for(['team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.by_team', 1, Tags.for(['team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('component_files.totals', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.totals', 4, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.totals', 5, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.count', 3, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.dependencies.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.violations.count', 0, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.violations.count', 0, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 1, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 1, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.package_based_file_ownership.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.using_public_directory.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.dependencies.count', 0, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.dependencies.count', 0, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.depended_on.count', 0, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.depended_on.count', 0, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown'])) + it "emits the right metrics" do + expect(metrics).to( + include_metric GaugeMetric.for("component_files.by_team", 0, Tags.for(["team:Team 2", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("packaged_files.by_team", 2, Tags.for(["team:Team 2", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_files.by_team", 2, Tags.for(["team:Team 2", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("component_files.by_team", 0, Tags.for(["team:Team 1", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("packaged_files.by_team", 2, Tags.for(["team:Team 1", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_files.by_team", 2, Tags.for(["team:Team 1", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("component_files.by_team", 0, Tags.for(["team:Unknown", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("packaged_files.by_team", 0, Tags.for(["team:Unknown", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_files.by_team", 1, Tags.for(["team:Unknown", "app:MyApp"])) + ) + expect(metrics).to include_metric GaugeMetric.for("component_files.totals", 0, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("packaged_files.totals", 4, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("all_files.totals", 5, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("all_packages.count", 3, Tags.for(["app:MyApp"])) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.dependencies.count", 0, Tags.for(["app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.violations.count", 0, Tags.for(["app:MyApp", "violation_type:dependency"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.violations.count", 0, Tags.for(["app:MyApp", "violation_type:privacy"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 1, + Tags.for(["app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 1, + Tags.for(["app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.package_based_file_ownership.count", 0, Tags.for(["app:MyApp"])) + ) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.using_public_directory.count", 0, Tags.for(["app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Unknown", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Unknown", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Unknown", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Unknown", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Unknown", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Unknown", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Unknown", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Unknown", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.dependencies.count", + 0, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.dependencies.count", + 0, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.depended_on.count", + 0, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.depended_on.count", + 0, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Unknown"]) + ) + ) + ) end - it 'emits metrics about use of public directory' do - expect(metrics).to include_metric GaugeMetric.for('all_packages.using_public_directory.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.all_files.count', 4, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.public_files.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.using_public_directory.count', 0, Tags.for(['team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.all_files.count', 4, Tags.for(['team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.public_files.count', 0, Tags.for(['team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.using_public_directory.count', 0, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.all_files.count', 2, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.public_files.count', 0, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.using_public_directory.count', 0, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.all_files.count', 2, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.public_files.count', 0, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown'])) + it "emits metrics about use of public directory" do + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.using_public_directory.count", 0, Tags.for(["app:MyApp"])) + ) + expect(metrics).to include_metric GaugeMetric.for("all_packages.all_files.count", 4, Tags.for(["app:MyApp"])) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.public_files.count", 0, Tags.for(["app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("by_team.using_public_directory.count", 0, Tags.for(["team:Unknown", "app:MyApp"])) + ) + ) + expect(metrics).to( + include_metric GaugeMetric.for("by_team.all_files.count", 4, Tags.for(["team:Unknown", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("by_team.public_files.count", 0, Tags.for(["team:Unknown", "app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.using_public_directory.count", + 0, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.all_files.count", + 2, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.public_files.count", + 0, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.using_public_directory.count", + 0, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.all_files.count", + 2, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.public_files.count", + 0, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Unknown"]) + ) + ) + ) end end - context 'in app with one root and 2 nonroot packages with dependency violations' do - include_context 'team names are based off of file names' + context "in app with one root and 2 nonroot packages with dependency violations" do + include_context "team names are based off of file names" before do - write_file('package_todo.yml', <<~CONTENTS) - # This file contains a list of dependencies that are not part of the long term plan for .. - # We should generally work to reduce this list, but not at the expense of actually getting work done. - # - # You can regenerate this file using the following command: - # - # bundle exec packwerk update-deprecations . - --- - packs/package_2: - "UndeclaredConstant1": - violations: - - dependency - files: - - some_file.rb - "UndeclaredConstant2": - violations: - - dependency - files: - - some_file.rb - CONTENTS - - write_file('config/teams/art/artists.yml', <<~CONTENTS) - name: Artists - CONTENTS - - write_file('config/teams/food/chefs.yml', <<~CONTENTS) - name: Chefs - CONTENTS - - write_file('package.yml', <<~CONTENTS) - enforce_dependencies: true - enforce_privacy: false - dependencies: - - packs/package_1 - CONTENTS - - write_file('empty_file_to_keep_directory.rb') - write_file('packs/package_2/package_todo.yml', <<~CONTENTS) - # This file contains a list of dependencies that are not part of the long term plan for .. - # We should generally work to reduce this list, but not at the expense of actually getting work done. - # - # You can regenerate this file using the following command: - # - # bundle exec packwerk update-deprecations . - --- - packs/package_1: - "UndeclaredConstant3": - violations: - - dependency - files: - - some_file.rb - "UndeclaredConstant4": - violations: - - dependency - files: - - some_file.rb - ".": - "UndeclaredConstant4": - violations: - - dependency - files: - - some_file.rb - CONTENTS - - write_file('packs/package_2/app/some_package_file.rb') - write_file('packs/package_2/package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: false - metadata: - owner: Chefs - CONTENTS - - write_file('packs/package_2/spec/some_package_file_spec.rb') - write_file('packs/package_1/app/some_package_file.rb') - write_file('packs/package_1/package.yml', <<~CONTENTS) - enforce_dependencies: true - enforce_privacy: true - dependencies: - - packs/package_2 - metadata: - owner: Artists - CONTENTS - - write_file('packs/package_1/spec/some_package_file_spec.rb') + write_file( + "package_todo.yml", + <<~CONTENTS + # This file contains a list of dependencies that are not part of the long term plan for .. + # We should generally work to reduce this list, but not at the expense of actually getting work done. + # + # You can regenerate this file using the following command: + # + # bundle exec packwerk update-deprecations . + --- + packs/package_2: + "UndeclaredConstant1": + violations: + - dependency + files: + - some_file.rb + "UndeclaredConstant2": + violations: + - dependency + files: + - some_file.rb + CONTENTS + ) + + write_file( + "config/teams/art/artists.yml", + <<~CONTENTS + name: Artists + CONTENTS + ) + + write_file( + "config/teams/food/chefs.yml", + <<~CONTENTS + name: Chefs + CONTENTS + ) + + write_file( + "package.yml", + <<~CONTENTS + enforce_dependencies: true + enforce_privacy: false + dependencies: + - packs/package_1 + CONTENTS + ) + + write_file("empty_file_to_keep_directory.rb") + write_file( + "packs/package_2/package_todo.yml", + <<~CONTENTS + # This file contains a list of dependencies that are not part of the long term plan for .. + # We should generally work to reduce this list, but not at the expense of actually getting work done. + # + # You can regenerate this file using the following command: + # + # bundle exec packwerk update-deprecations . + --- + packs/package_1: + "UndeclaredConstant3": + violations: + - dependency + files: + - some_file.rb + "UndeclaredConstant4": + violations: + - dependency + files: + - some_file.rb + ".": + "UndeclaredConstant4": + violations: + - dependency + files: + - some_file.rb + CONTENTS + ) + + write_file("packs/package_2/app/some_package_file.rb") + write_file( + "packs/package_2/package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: false + metadata: + owner: Chefs + CONTENTS + ) + + write_file("packs/package_2/spec/some_package_file_spec.rb") + write_file("packs/package_1/app/some_package_file.rb") + write_file( + "packs/package_1/package.yml", + <<~CONTENTS + enforce_dependencies: true + enforce_privacy: true + dependencies: + - packs/package_2 + metadata: + owner: Artists + CONTENTS + ) + + write_file("packs/package_1/spec/some_package_file_spec.rb") end - it 'emits the right metrics' do - expect(metrics).to include_metric GaugeMetric.for('component_files.by_team', 0, Tags.for(['team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.by_team', 0, Tags.for(['team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.by_team', 1, Tags.for(['team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('component_files.by_team', 0, Tags.for(['team:Team 2', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.by_team', 2, Tags.for(['team:Team 2', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.by_team', 2, Tags.for(['team:Team 2', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('component_files.by_team', 0, Tags.for(['team:Team 1', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.by_team', 2, Tags.for(['team:Team 1', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.by_team', 2, Tags.for(['team:Team 1', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('component_files.totals', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.totals', 4, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.totals', 5, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.count', 3, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.dependencies.count', 2, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.violations.count', 5, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.violations.count', 0, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 2, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 1, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.package_based_file_ownership.count', 2, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.using_public_directory.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Chefs', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 3, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Chefs', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Chefs', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.by_other_package.count', 2, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Chefs', 'other_package:packs/package_1', 'other_team:Artists', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.by_other_package.count', 1, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Chefs', 'other_package:root', 'other_team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Artists', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Artists', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Artists', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:root', 'app:MyApp', 'team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 2, Tags.for(['package:root', 'app:MyApp', 'team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:root', 'app:MyApp', 'team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.by_other_package.count', 2, Tags.for(['package:root', 'app:MyApp', 'team:Unknown', 'other_package:packs/package_2', 'other_team:Chefs', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.dependencies.count', 0, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Chefs'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.depended_on.count', 1, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Chefs'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.dependencies.by_other_package.count', 1, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Artists', 'other_package:packs/package_2', 'other_team:Chefs'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.dependencies.count', 1, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Artists'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.depended_on.count', 1, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Artists'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.dependencies.by_other_package.count', 1, Tags.for(['package:root', 'app:MyApp', 'team:Unknown', 'other_package:packs/package_1', 'other_team:Artists'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.dependencies.count', 1, Tags.for(['package:root', 'app:MyApp', 'team:Unknown'])) + it "emits the right metrics" do + expect(metrics).to( + include_metric GaugeMetric.for("component_files.by_team", 0, Tags.for(["team:Unknown", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("packaged_files.by_team", 0, Tags.for(["team:Unknown", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_files.by_team", 1, Tags.for(["team:Unknown", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("component_files.by_team", 0, Tags.for(["team:Team 2", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("packaged_files.by_team", 2, Tags.for(["team:Team 2", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_files.by_team", 2, Tags.for(["team:Team 2", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("component_files.by_team", 0, Tags.for(["team:Team 1", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("packaged_files.by_team", 2, Tags.for(["team:Team 1", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_files.by_team", 2, Tags.for(["team:Team 1", "app:MyApp"])) + ) + expect(metrics).to include_metric GaugeMetric.for("component_files.totals", 0, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("packaged_files.totals", 4, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("all_files.totals", 5, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("all_packages.count", 3, Tags.for(["app:MyApp"])) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.dependencies.count", 2, Tags.for(["app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.violations.count", 5, Tags.for(["app:MyApp", "violation_type:dependency"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.violations.count", 0, Tags.for(["app:MyApp", "violation_type:privacy"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 2, + Tags.for(["app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 1, + Tags.for(["app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.package_based_file_ownership.count", 2, Tags.for(["app:MyApp"])) + ) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.using_public_directory.count", 0, Tags.for(["app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Chefs", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 3, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Chefs", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Chefs", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.by_other_package.count", + 2, + Tags.for( + [ + "package:packs/package_2", + "app:MyApp", + "team:Chefs", + "other_package:packs/package_1", + "other_team:Artists", + "violation_type:dependency" + ] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.by_other_package.count", + 1, + Tags.for( + [ + "package:packs/package_2", + "app:MyApp", + "team:Chefs", + "other_package:root", + "other_team:Unknown", + "violation_type:dependency" + ] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Artists", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Artists", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Artists", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:root", "app:MyApp", "team:Unknown", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 2, + Tags.for(["package:root", "app:MyApp", "team:Unknown", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:root", "app:MyApp", "team:Unknown", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.by_other_package.count", + 2, + Tags.for( + [ + "package:root", + "app:MyApp", + "team:Unknown", + "other_package:packs/package_2", + "other_team:Chefs", + "violation_type:dependency" + ] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.dependencies.count", + 0, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Chefs"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.depended_on.count", + 1, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Chefs"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.dependencies.by_other_package.count", + 1, + Tags.for( + [ + "package:packs/package_1", + "app:MyApp", + "team:Artists", + "other_package:packs/package_2", + "other_team:Chefs" + ] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.dependencies.count", + 1, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Artists"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.depended_on.count", + 1, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Artists"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.dependencies.by_other_package.count", + 1, + Tags.for( + ["package:root", "app:MyApp", "team:Unknown", "other_package:packs/package_1", "other_team:Artists"] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.dependencies.count", + 1, + Tags.for(["package:root", "app:MyApp", "team:Unknown"]) + ) + ) + ) end - it 'emits team based package metrics' do - expect(metrics).to include_metric GaugeMetric.for('by_team.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'team:Artists', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.packwerk_checkers.true.count', 1, Tags.for(['app:MyApp', 'team:Artists', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.packwerk_checkers.false.count', 0, Tags.for(['app:MyApp', 'team:Artists', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'team:Artists', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.packwerk_checkers.true.count', 1, Tags.for(['app:MyApp', 'team:Artists', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.packwerk_checkers.false.count', 0, Tags.for(['app:MyApp', 'team:Artists', 'violation_type:privacy'])) - - expect(metrics).to include_metric GaugeMetric.for('by_team.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'team:Chefs', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.packwerk_checkers.true.count', 0, Tags.for(['app:MyApp', 'team:Chefs', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.packwerk_checkers.false.count', 1, Tags.for(['app:MyApp', 'team:Chefs', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'team:Chefs', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.packwerk_checkers.true.count', 0, Tags.for(['app:MyApp', 'team:Chefs', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.packwerk_checkers.false.count', 1, Tags.for(['app:MyApp', 'team:Chefs', 'violation_type:privacy'])) - - expect(metrics).to include_metric GaugeMetric.for('by_team.all_packages.count', 1, Tags.for(['team:Chefs', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.count', 0, Tags.for(['team:Chefs', 'app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.count', 3, Tags.for(['team:Chefs', 'app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.count', 0, Tags.for(['team:Chefs', 'app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 2, Tags.for(['team:Chefs', 'app:MyApp', 'other_team:Artists', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 1, Tags.for(['team:Chefs', 'app:MyApp', 'other_team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.all_packages.count', 1, Tags.for(['team:Artists', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.count', 0, Tags.for(['team:Artists', 'app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.count', 0, Tags.for(['team:Artists', 'app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.count', 0, Tags.for(['team:Artists', 'app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.all_packages.count', 1, Tags.for(['team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.count', 0, Tags.for(['team:Unknown', 'app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.count', 2, Tags.for(['team:Unknown', 'app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.count', 0, Tags.for(['team:Unknown', 'app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 2, Tags.for(['team:Unknown', 'app:MyApp', 'other_team:Chefs', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.using_public_directory.count', 0, Tags.for(['team:Artists', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.using_public_directory.count', 0, Tags.for(['team:Chefs', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.using_public_directory.count', 0, Tags.for(['team:Unknown', 'app:MyApp'])) - - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 2, Tags.for(['team:Chefs', 'other_team:Artists', 'violation_type:dependency', 'app:MyApp'])) - expect(metrics).to_not include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 0, Tags.for(['team:Chefs', 'other_team:Artists', 'violation_type:privacy', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 1, Tags.for(['team:Chefs', 'other_team:Unknown', 'violation_type:dependency', 'app:MyApp'])) - expect(metrics).to_not include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 0, Tags.for(['team:Chefs', 'other_team:Unknown', 'violation_type:privacy', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 2, Tags.for(['team:Unknown', 'other_team:Chefs', 'violation_type:dependency', 'app:MyApp'])) - expect(metrics).to_not include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 0, Tags.for(['team:Unknown', 'other_team:Chefs', 'violation_type:privacy', 'app:MyApp'])) - expect(metrics).to_not include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 0, Tags.for(['team:Unknown', 'other_team:Artists', 'violation_type:dependency', 'app:MyApp'])) - expect(metrics).to_not include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 0, Tags.for(['team:Unknown', 'other_team:Artists', 'violation_type:privacy', 'app:MyApp'])) - expect(metrics).to_not include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 0, Tags.for(['team:Artists', 'other_team:Chefs', 'violation_type:dependency', 'app:MyApp'])) - expect(metrics).to_not include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 0, Tags.for(['team:Artists', 'other_team:Chefs', 'violation_type:privacy', 'app:MyApp'])) - expect(metrics).to_not include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 0, Tags.for(['team:Artists', 'other_team:Unknown', 'violation_type:dependency', 'app:MyApp'])) - expect(metrics).to_not include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 0, Tags.for(['team:Artists', 'other_team:Unknown', 'violation_type:privacy', 'app:MyApp'])) + it "emits team based package metrics" do + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "team:Artists", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.packwerk_checkers.true.count", + 1, + Tags.for(["app:MyApp", "team:Artists", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.packwerk_checkers.false.count", + 0, + Tags.for(["app:MyApp", "team:Artists", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "team:Artists", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.packwerk_checkers.true.count", + 1, + Tags.for(["app:MyApp", "team:Artists", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.packwerk_checkers.false.count", + 0, + Tags.for(["app:MyApp", "team:Artists", "violation_type:privacy"]) + ) + ) + ) + + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "team:Chefs", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.packwerk_checkers.true.count", + 0, + Tags.for(["app:MyApp", "team:Chefs", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.packwerk_checkers.false.count", + 1, + Tags.for(["app:MyApp", "team:Chefs", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "team:Chefs", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.packwerk_checkers.true.count", + 0, + Tags.for(["app:MyApp", "team:Chefs", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.packwerk_checkers.false.count", + 1, + Tags.for(["app:MyApp", "team:Chefs", "violation_type:privacy"]) + ) + ) + ) + + expect(metrics).to( + include_metric GaugeMetric.for("by_team.all_packages.count", 1, Tags.for(["team:Chefs", "app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.count", + 0, + Tags.for(["team:Chefs", "app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.count", + 3, + Tags.for(["team:Chefs", "app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.count", + 0, + Tags.for(["team:Chefs", "app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 2, + Tags.for(["team:Chefs", "app:MyApp", "other_team:Artists", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 1, + Tags.for(["team:Chefs", "app:MyApp", "other_team:Unknown", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric GaugeMetric.for("by_team.all_packages.count", 1, Tags.for(["team:Artists", "app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.count", + 0, + Tags.for(["team:Artists", "app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.count", + 0, + Tags.for(["team:Artists", "app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.count", + 0, + Tags.for(["team:Artists", "app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric GaugeMetric.for("by_team.all_packages.count", 1, Tags.for(["team:Unknown", "app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.count", + 0, + Tags.for(["team:Unknown", "app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.count", + 2, + Tags.for(["team:Unknown", "app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.count", + 0, + Tags.for(["team:Unknown", "app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 2, + Tags.for(["team:Unknown", "app:MyApp", "other_team:Chefs", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("by_team.using_public_directory.count", 0, Tags.for(["team:Artists", "app:MyApp"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("by_team.using_public_directory.count", 0, Tags.for(["team:Chefs", "app:MyApp"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("by_team.using_public_directory.count", 0, Tags.for(["team:Unknown", "app:MyApp"])) + ) + ) + + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 2, + Tags.for(["team:Chefs", "other_team:Artists", "violation_type:dependency", "app:MyApp"]) + ) + ) + ) + expect(metrics).not_to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 0, + Tags.for(["team:Chefs", "other_team:Artists", "violation_type:privacy", "app:MyApp"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 1, + Tags.for(["team:Chefs", "other_team:Unknown", "violation_type:dependency", "app:MyApp"]) + ) + ) + ) + expect(metrics).not_to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 0, + Tags.for(["team:Chefs", "other_team:Unknown", "violation_type:privacy", "app:MyApp"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 2, + Tags.for(["team:Unknown", "other_team:Chefs", "violation_type:dependency", "app:MyApp"]) + ) + ) + ) + expect(metrics).not_to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 0, + Tags.for(["team:Unknown", "other_team:Chefs", "violation_type:privacy", "app:MyApp"]) + ) + ) + ) + expect(metrics).not_to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 0, + Tags.for(["team:Unknown", "other_team:Artists", "violation_type:dependency", "app:MyApp"]) + ) + ) + ) + expect(metrics).not_to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 0, + Tags.for(["team:Unknown", "other_team:Artists", "violation_type:privacy", "app:MyApp"]) + ) + ) + ) + expect(metrics).not_to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 0, + Tags.for(["team:Artists", "other_team:Chefs", "violation_type:dependency", "app:MyApp"]) + ) + ) + ) + expect(metrics).not_to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 0, + Tags.for(["team:Artists", "other_team:Chefs", "violation_type:privacy", "app:MyApp"]) + ) + ) + ) + expect(metrics).not_to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 0, + Tags.for(["team:Artists", "other_team:Unknown", "violation_type:dependency", "app:MyApp"]) + ) + ) + ) + expect(metrics).not_to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 0, + Tags.for(["team:Artists", "other_team:Unknown", "violation_type:privacy", "app:MyApp"]) + ) + ) + ) end end - context 'in app with one root and 2 nonroot packages with privacy and dependency violations, and also components' do - include_context 'team names are based off of file names' + context "in app with one root and 2 nonroot packages with privacy and dependency violations, and also components" do + include_context "team names are based off of file names" before do - write_file('package_todo.yml', <<~CONTENTS) - # This file contains a list of dependencies that are not part of the long term plan for .. - # We should generally work to reduce this list, but not at the expense of actually getting work done. - # - # You can regenerate this file using the following command: - # - # bundle exec packwerk update-deprecations . - --- - packs/package_2: - "UndeclaredConstant1": - violations: - - dependency - files: - - some_file.rb - "UndeclaredConstant2": - violations: - - dependency - files: - - some_file.rb - "MyPrivateConstant2": - violations: - - privacy - files: - - some_file.rb - CONTENTS - - write_file('app/unpackaged_files/team_1_file.rb') - write_file('app/unpackaged_files/team_2_file.rb') - write_file('package.yml', <<~CONTENTS) - enforce_dependencies: true - enforce_privacy: false - dependencies: - - packs/package_1 - CONTENTS - - write_file('empty_file_to_keep_directory.rb') - write_file('packs/package_2/package_todo.yml', <<~CONTENTS) - # This file contains a list of dependencies that are not part of the long term plan for .. - # We should generally work to reduce this list, but not at the expense of actually getting work done. - # - # You can regenerate this file using the following command: - # - # bundle exec packwerk update-deprecations . - --- - packs/package_1: - "UndeclaredConstant3": - violations: - - dependency - files: - - some_file.rb - "UndeclaredConstant4": - violations: - - dependency - files: - - some_file.rb - "MyPrivateConstant1": - violations: - - dependency - - privacy - files: - - some_file.rb - ".": - "UndeclaredConstant4": - violations: - - dependency - files: - - some_file.rb - CONTENTS - - write_file('packs/package_2/app/some_package_file.rb') - write_file('packs/package_2/package.yml', <<~CONTENTS) - enforce_dependencies: true - enforce_privacy: true - CONTENTS - - write_file('packs/package_2/spec/some_package_file_spec.rb') - write_file('packs/package_1/package_todo.yml', <<~CONTENTS) - # This file contains a list of dependencies that are not part of the long term plan for .. - # We should generally work to reduce this list, but not at the expense of actually getting work done. - # - # You can regenerate this file using the following command: - # - # bundle exec packwerk update-deprecations . - --- - packs/package_2: - "MyPrivateConstant2": - violations: - - privacy - files: - - some_file.rb - CONTENTS - - write_file('packs/package_1/app/some_package_file.rb') - write_file('packs/package_1/package.yml', <<~CONTENTS) - enforce_dependencies: true - enforce_privacy: true - dependencies: - - packs/package_2 - CONTENTS - - write_file('packs/package_1/spec/some_package_file_spec.rb') - write_file('components/my_component_2/spec/my_file_spec.rb') - write_file('components/my_component_2/lib/my_component_2/my_file.rb') - write_file('components/my_component_2/lib/my_component_2.rb') - write_file('components/my_component_3/spec/my_file_spec.rb') - write_file('components/my_component_3/lib/my_component_3/my_file.rb') - write_file('components/my_component_3/lib/my_component_3.rb') + write_file( + "package_todo.yml", + <<~CONTENTS + # This file contains a list of dependencies that are not part of the long term plan for .. + # We should generally work to reduce this list, but not at the expense of actually getting work done. + # + # You can regenerate this file using the following command: + # + # bundle exec packwerk update-deprecations . + --- + packs/package_2: + "UndeclaredConstant1": + violations: + - dependency + files: + - some_file.rb + "UndeclaredConstant2": + violations: + - dependency + files: + - some_file.rb + "MyPrivateConstant2": + violations: + - privacy + files: + - some_file.rb + CONTENTS + ) + + write_file("app/unpackaged_files/team_1_file.rb") + write_file("app/unpackaged_files/team_2_file.rb") + write_file( + "package.yml", + <<~CONTENTS + enforce_dependencies: true + enforce_privacy: false + dependencies: + - packs/package_1 + CONTENTS + ) + + write_file("empty_file_to_keep_directory.rb") + write_file( + "packs/package_2/package_todo.yml", + <<~CONTENTS + # This file contains a list of dependencies that are not part of the long term plan for .. + # We should generally work to reduce this list, but not at the expense of actually getting work done. + # + # You can regenerate this file using the following command: + # + # bundle exec packwerk update-deprecations . + --- + packs/package_1: + "UndeclaredConstant3": + violations: + - dependency + files: + - some_file.rb + "UndeclaredConstant4": + violations: + - dependency + files: + - some_file.rb + "MyPrivateConstant1": + violations: + - dependency + - privacy + files: + - some_file.rb + ".": + "UndeclaredConstant4": + violations: + - dependency + files: + - some_file.rb + CONTENTS + ) + + write_file("packs/package_2/app/some_package_file.rb") + write_file( + "packs/package_2/package.yml", + <<~CONTENTS + enforce_dependencies: true + enforce_privacy: true + CONTENTS + ) + + write_file("packs/package_2/spec/some_package_file_spec.rb") + write_file( + "packs/package_1/package_todo.yml", + <<~CONTENTS + # This file contains a list of dependencies that are not part of the long term plan for .. + # We should generally work to reduce this list, but not at the expense of actually getting work done. + # + # You can regenerate this file using the following command: + # + # bundle exec packwerk update-deprecations . + --- + packs/package_2: + "MyPrivateConstant2": + violations: + - privacy + files: + - some_file.rb + CONTENTS + ) + + write_file("packs/package_1/app/some_package_file.rb") + write_file( + "packs/package_1/package.yml", + <<~CONTENTS + enforce_dependencies: true + enforce_privacy: true + dependencies: + - packs/package_2 + CONTENTS + ) + + write_file("packs/package_1/spec/some_package_file_spec.rb") + write_file("components/my_component_2/spec/my_file_spec.rb") + write_file("components/my_component_2/lib/my_component_2/my_file.rb") + write_file("components/my_component_2/lib/my_component_2.rb") + write_file("components/my_component_3/spec/my_file_spec.rb") + write_file("components/my_component_3/lib/my_component_3/my_file.rb") + write_file("components/my_component_3/lib/my_component_3.rb") end # The purpose of this spec is to have a clear list of all of the metrics that are supported by pack_stats # We can also look at the diff of this list to easily see what metrics are being added or removed - it 'emits only these metrics' do - expect(metrics.map(&:name).uniq.sort).to match_array %w( - modularization.all_files.by_team - modularization.all_files.totals - modularization.all_packages.all_files.count - modularization.all_packages.count - modularization.all_packages.dependencies.count - modularization.all_packages.has_readme.count - modularization.all_packages.package_based_file_ownership.count - modularization.all_packages.packwerk_checkers.false.count - modularization.all_packages.packwerk_checkers.strict.count - modularization.all_packages.packwerk_checkers.true.count - modularization.all_packages.public_files.count - modularization.all_packages.using_public_directory.count - modularization.all_packages.violations.count - modularization.by_package.all_files.count - modularization.by_package.depended_on.count - modularization.by_package.dependencies.count - modularization.by_package.dependencies.by_other_package.count - modularization.by_package.public_files.count - modularization.by_package.using_public_directory.count - modularization.by_package.violations.count - modularization.by_package.violations.by_other_package.count - modularization.by_team.all_files.count - modularization.by_team.all_packages.count - modularization.by_team.has_readme.count - modularization.by_team.packwerk_checkers.false.count - modularization.by_team.packwerk_checkers.strict.count - modularization.by_team.packwerk_checkers.true.count - modularization.by_team.public_files.count - modularization.by_team.using_public_directory.count - modularization.by_team.violations.count - modularization.by_team.violations.by_other_team.count - modularization.component_files.by_team - modularization.component_files.totals - modularization.packaged_files.by_team - modularization.packaged_files.totals + it "emits only these metrics" do + expect(metrics.map(&:name).uniq.sort).to( + match_array( + %w[ + modularization.all_files.by_team + modularization.all_files.totals + modularization.all_packages.all_files.count + modularization.all_packages.count + modularization.all_packages.dependencies.count + modularization.all_packages.has_readme.count + modularization.all_packages.package_based_file_ownership.count + modularization.all_packages.packwerk_checkers.false.count + modularization.all_packages.packwerk_checkers.strict.count + modularization.all_packages.packwerk_checkers.true.count + modularization.all_packages.public_files.count + modularization.all_packages.using_public_directory.count + modularization.all_packages.violations.count + modularization.by_package.all_files.count + modularization.by_package.depended_on.count + modularization.by_package.dependencies.count + modularization.by_package.dependencies.by_other_package.count + modularization.by_package.public_files.count + modularization.by_package.using_public_directory.count + modularization.by_package.violations.count + modularization.by_package.violations.by_other_package.count + modularization.by_team.all_files.count + modularization.by_team.all_packages.count + modularization.by_team.has_readme.count + modularization.by_team.packwerk_checkers.false.count + modularization.by_team.packwerk_checkers.strict.count + modularization.by_team.packwerk_checkers.true.count + modularization.by_team.public_files.count + modularization.by_team.using_public_directory.count + modularization.by_team.violations.count + modularization.by_team.violations.by_other_team.count + modularization.component_files.by_team + modularization.component_files.totals + modularization.packaged_files.by_team + modularization.packaged_files.totals + ] + ) ) end - it 'emits the right metrics' do - expect(metrics).to include_metric GaugeMetric.for('component_files.by_team', 3, Tags.for(['team:Team 2', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.by_team', 2, Tags.for(['team:Team 2', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.by_team', 6, Tags.for(['team:Team 2', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('component_files.by_team', 0, Tags.for(['team:Team 1', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.by_team', 2, Tags.for(['team:Team 1', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.by_team', 3, Tags.for(['team:Team 1', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('component_files.by_team', 0, Tags.for(['team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.by_team', 0, Tags.for(['team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.by_team', 1, Tags.for(['team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('component_files.by_team', 3, Tags.for(['team:Team 3', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.by_team', 0, Tags.for(['team:Team 3', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.by_team', 3, Tags.for(['team:Team 3', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('component_files.totals', 6, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.totals', 4, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.totals', 13, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.count', 3, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.dependencies.count', 2, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.violations.count', 6, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.violations.count', 3, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 3, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 2, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.package_based_file_ownership.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.using_public_directory.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 4, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 2, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_1', 'team:Unknown', 'app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 1, Tags.for(['package:packs/package_1', 'team:Unknown', 'app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 2, Tags.for(['package:root', 'team:Unknown', 'app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:root', 'team:Unknown', 'app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.dependencies.by_other_package.count', 1, Tags.for(['package:root', 'team:Unknown', 'app:MyApp', 'other_package:packs/package_1', 'other_team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.dependencies.count', 1, Tags.for(['package:root', 'team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.depended_on.count', 0, Tags.for(['package:root', 'team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.dependencies.by_other_package.count', 1, Tags.for(['package:packs/package_1', 'team:Unknown', 'app:MyApp', 'other_package:packs/package_2', 'other_team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.dependencies.count', 1, Tags.for(['package:packs/package_1', 'team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.depended_on.count', 1, Tags.for(['package:packs/package_1', 'team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.dependencies.count', 0, Tags.for(['package:packs/package_2', 'team:Unknown', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.depended_on.count', 1, Tags.for(['package:packs/package_2', 'team:Unknown', 'app:MyApp'])) - - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.by_other_package.count', 2, Tags.for(['package:root', 'team:Unknown', 'app:MyApp', 'other_package:packs/package_2', 'other_team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.by_other_package.count', 3, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown', 'other_package:packs/package_1', 'other_team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.by_other_package.count', 1, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown', 'other_package:root', 'other_team:Unknown', 'violation_type:dependency'])) - expect(metrics).to_not include_metric GaugeMetric.for('by_package.violations.by_other_package.count', 0, Tags.for(['package:packs/package_1', 'team:Unknown', 'app:MyApp', 'other_package:packs/package_2', 'other_team:Unknown', 'violation_type:dependency'])) - - expect(metrics).to_not include_metric GaugeMetric.for('by_package.violations.by_other_package.count', 0, Tags.for(['package:root', 'team:Unknown', 'app:MyApp', 'other_package:packs/package_2', 'other_team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.by_other_package.count', 1, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown', 'other_package:packs/package_1', 'other_team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.by_other_package.count', 1, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown', 'other_package:root', 'other_team:Unknown', 'violation_type:privacy'])) - expect(metrics).to_not include_metric GaugeMetric.for('by_package.violations.by_other_package.count', 0, Tags.for(['package:packs/package_1', 'team:Unknown', 'app:MyApp', 'other_package:root', 'other_team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.by_other_package.count', 1, Tags.for(['package:packs/package_1', 'team:Unknown', 'app:MyApp', 'other_package:packs/package_2', 'other_team:Unknown', 'violation_type:privacy'])) + it "emits the right metrics" do + expect(metrics).to( + include_metric GaugeMetric.for("component_files.by_team", 3, Tags.for(["team:Team 2", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("packaged_files.by_team", 2, Tags.for(["team:Team 2", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_files.by_team", 6, Tags.for(["team:Team 2", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("component_files.by_team", 0, Tags.for(["team:Team 1", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("packaged_files.by_team", 2, Tags.for(["team:Team 1", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_files.by_team", 3, Tags.for(["team:Team 1", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("component_files.by_team", 0, Tags.for(["team:Unknown", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("packaged_files.by_team", 0, Tags.for(["team:Unknown", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_files.by_team", 1, Tags.for(["team:Unknown", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("component_files.by_team", 3, Tags.for(["team:Team 3", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("packaged_files.by_team", 0, Tags.for(["team:Team 3", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_files.by_team", 3, Tags.for(["team:Team 3", "app:MyApp"])) + ) + expect(metrics).to include_metric GaugeMetric.for("component_files.totals", 6, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("packaged_files.totals", 4, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("all_files.totals", 13, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("all_packages.count", 3, Tags.for(["app:MyApp"])) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.dependencies.count", 2, Tags.for(["app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.violations.count", 6, Tags.for(["app:MyApp", "violation_type:dependency"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.violations.count", 3, Tags.for(["app:MyApp", "violation_type:privacy"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 3, + Tags.for(["app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 2, + Tags.for(["app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.package_based_file_ownership.count", 0, Tags.for(["app:MyApp"])) + ) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.using_public_directory.count", 0, Tags.for(["app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 4, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Unknown", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 2, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Unknown", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_1", "team:Unknown", "app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 1, + Tags.for(["package:packs/package_1", "team:Unknown", "app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 2, + Tags.for(["package:root", "team:Unknown", "app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:root", "team:Unknown", "app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.dependencies.by_other_package.count", + 1, + Tags.for( + ["package:root", "team:Unknown", "app:MyApp", "other_package:packs/package_1", "other_team:Unknown"] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.dependencies.count", + 1, + Tags.for(["package:root", "team:Unknown", "app:MyApp"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.depended_on.count", + 0, + Tags.for(["package:root", "team:Unknown", "app:MyApp"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.dependencies.by_other_package.count", + 1, + Tags.for( + [ + "package:packs/package_1", + "team:Unknown", + "app:MyApp", + "other_package:packs/package_2", + "other_team:Unknown" + ] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.dependencies.count", + 1, + Tags.for(["package:packs/package_1", "team:Unknown", "app:MyApp"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.depended_on.count", + 1, + Tags.for(["package:packs/package_1", "team:Unknown", "app:MyApp"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.dependencies.count", + 0, + Tags.for(["package:packs/package_2", "team:Unknown", "app:MyApp"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.depended_on.count", + 1, + Tags.for(["package:packs/package_2", "team:Unknown", "app:MyApp"]) + ) + ) + ) + + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.by_other_package.count", + 2, + Tags.for( + [ + "package:root", + "team:Unknown", + "app:MyApp", + "other_package:packs/package_2", + "other_team:Unknown", + "violation_type:dependency" + ] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.by_other_package.count", + 3, + Tags.for( + [ + "package:packs/package_2", + "app:MyApp", + "team:Unknown", + "other_package:packs/package_1", + "other_team:Unknown", + "violation_type:dependency" + ] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.by_other_package.count", + 1, + Tags.for( + [ + "package:packs/package_2", + "app:MyApp", + "team:Unknown", + "other_package:root", + "other_team:Unknown", + "violation_type:dependency" + ] + ) + ) + ) + ) + expect(metrics).not_to( + include_metric( + GaugeMetric.for( + "by_package.violations.by_other_package.count", + 0, + Tags.for( + [ + "package:packs/package_1", + "team:Unknown", + "app:MyApp", + "other_package:packs/package_2", + "other_team:Unknown", + "violation_type:dependency" + ] + ) + ) + ) + ) + + expect(metrics).not_to( + include_metric( + GaugeMetric.for( + "by_package.violations.by_other_package.count", + 0, + Tags.for( + [ + "package:root", + "team:Unknown", + "app:MyApp", + "other_package:packs/package_2", + "other_team:Unknown", + "violation_type:privacy" + ] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.by_other_package.count", + 1, + Tags.for( + [ + "package:packs/package_2", + "app:MyApp", + "team:Unknown", + "other_package:packs/package_1", + "other_team:Unknown", + "violation_type:privacy" + ] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.by_other_package.count", + 1, + Tags.for( + [ + "package:packs/package_2", + "app:MyApp", + "team:Unknown", + "other_package:root", + "other_team:Unknown", + "violation_type:privacy" + ] + ) + ) + ) + ) + expect(metrics).not_to( + include_metric( + GaugeMetric.for( + "by_package.violations.by_other_package.count", + 0, + Tags.for( + [ + "package:packs/package_1", + "team:Unknown", + "app:MyApp", + "other_package:root", + "other_team:Unknown", + "violation_type:privacy" + ] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.by_other_package.count", + 1, + Tags.for( + [ + "package:packs/package_1", + "team:Unknown", + "app:MyApp", + "other_package:packs/package_2", + "other_team:Unknown", + "violation_type:privacy" + ] + ) + ) + ) + ) end end - context 'in an app with a protected package' do - include_context 'only one team' + context "in an app with a protected package" do + include_context "only one team" before do - write_file('packs/package_2/app/public/untyped_file.rb', <<~CONTENTS) - # typed: false - CONTENTS - - write_file('packs/package_2/package.yml', <<~CONTENTS) - enforce_dependencies: true - enforce_privacy: true - CONTENTS - - write_file('packs/package_2/package_rubocop.yml', <<~CONTENTS) - Packs/TypedPublicApis: - Enabled: true - CONTENTS - - write_file('packs/package_3/package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: strict - metadata: - other_stuff: is_irrelevant - CONTENTS - - write_file('packs/package_1/package.yml', <<~CONTENTS) - enforce_dependencies: strict - enforce_privacy: strict - CONTENTS - - write_file('packs/package_1/package_rubocop.yml', <<~CONTENTS) - Packs/TypedPublicApis: - Enabled: true - FailureMode: strict - - Packs/RootNamespaceIsPackName: - Enabled: true - FailureMode: strict - CONTENTS + write_file( + "packs/package_2/app/public/untyped_file.rb", + <<~CONTENTS + # typed: false + CONTENTS + ) + + write_file( + "packs/package_2/package.yml", + <<~CONTENTS + enforce_dependencies: true + enforce_privacy: true + CONTENTS + ) + + write_file( + "packs/package_2/package_rubocop.yml", + <<~CONTENTS + Packs/TypedPublicApis: + Enabled: true + CONTENTS + ) + + write_file( + "packs/package_3/package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: strict + metadata: + other_stuff: is_irrelevant + CONTENTS + ) + + write_file( + "packs/package_1/package.yml", + <<~CONTENTS + enforce_dependencies: strict + enforce_privacy: strict + CONTENTS + ) + + write_file( + "packs/package_1/package_rubocop.yml", + <<~CONTENTS + Packs/TypedPublicApis: + Enabled: true + FailureMode: strict + + Packs/RootNamespaceIsPackName: + Enabled: true + FailureMode: strict + CONTENTS + ) end - it 'emits the right metrics' do - expect(metrics).to include_metric GaugeMetric.for('component_files.totals', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('packaged_files.totals', 1, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_files.totals', 1, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.count', 4, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.dependencies.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.violations.count', 0, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.strict.count', 1, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 2, Tags.for(['app:MyApp', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.strict.count', 2, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 2, Tags.for(['app:MyApp', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.package_based_file_ownership.count', 0, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.using_public_directory.count', 1, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_3', 'app:MyApp', 'team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_3', 'app:MyApp', 'team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_3', 'app:MyApp', 'team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_3', 'app:MyApp', 'team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Unknown', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Unknown', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.dependencies.count', 0, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.depended_on.count', 0, Tags.for(['package:packs/package_2', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.dependencies.count', 0, Tags.for(['package:packs/package_3', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.depended_on.count', 0, Tags.for(['package:packs/package_3', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.dependencies.count', 0, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Unknown'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.depended_on.count', 0, Tags.for(['package:packs/package_1', 'app:MyApp', 'team:Unknown'])) + it "emits the right metrics" do + expect(metrics).to include_metric GaugeMetric.for("component_files.totals", 0, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("packaged_files.totals", 1, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("all_files.totals", 1, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("all_packages.count", 4, Tags.for(["app:MyApp"])) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.dependencies.count", 0, Tags.for(["app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.violations.count", 0, Tags.for(["app:MyApp", "violation_type:dependency"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.strict.count", + 1, + Tags.for(["app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 2, + Tags.for(["app:MyApp", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.strict.count", + 2, + Tags.for(["app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 2, + Tags.for(["app:MyApp", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.package_based_file_ownership.count", 0, Tags.for(["app:MyApp"])) + ) + ) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.using_public_directory.count", 1, Tags.for(["app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Unknown", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Unknown", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Unknown", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Unknown", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_3", "app:MyApp", "team:Unknown", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_3", "app:MyApp", "team:Unknown", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_3", "app:MyApp", "team:Unknown", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_3", "app:MyApp", "team:Unknown", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Unknown", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Unknown", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Unknown", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Unknown", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.dependencies.count", + 0, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.depended_on.count", + 0, + Tags.for(["package:packs/package_2", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.dependencies.count", + 0, + Tags.for(["package:packs/package_3", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.depended_on.count", + 0, + Tags.for(["package:packs/package_3", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.dependencies.count", + 0, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Unknown"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.depended_on.count", + 0, + Tags.for(["package:packs/package_1", "app:MyApp", "team:Unknown"]) + ) + ) + ) end end - context 'in an app with mixed usage of public directories' do + context "in an app with mixed usage of public directories" do before do - write_file('config/teams/art/artists.yml', <<~CONTENTS) - name: Artists - CONTENTS - - write_file('config/teams/food/chefs.yml', <<~CONTENTS) - name: Chefs - CONTENTS - - write_file('empty_file.rb') - write_file('package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: false - CONTENTS - - write_file('packs/artists_package_1/app/public/some_subdir/some_public_api_1.rb') - write_file('packs/artists_package_1/app/public/some_subdir/some_public_api_2.rb') - write_file('packs/artists_package_1/app/some_package_file.rb') - write_file('packs/artists_package_1/package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: false - metadata: - owner: Artists - CONTENTS - - write_file('packs/chefs_package_2/app/some_package_file.rb') - write_file('packs/chefs_package_2/package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: false - metadata: - owner: Chefs - CONTENTS - - write_file('packs/artists_package_2/app/public/README.md', <<~CONTENTS) - # This file should not be included in the stats - CONTENTS - - write_file('packs/artists_package_2/app/some_package_file.rb') - write_file('packs/artists_package_2/package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: false - metadata: - owner: Artists - CONTENTS - - write_file('packs/chefs_package_1/app/public/some_public_api_1.rb') - write_file('packs/chefs_package_1/app/public/README.md', <<~CONTENTS) - # This file should not be included in the stats - CONTENTS - - write_file('packs/chefs_package_1/app/public/some_public_api_2.rb') - write_file('packs/chefs_package_1/app/some_package_file.rb') - write_file('packs/chefs_package_1/package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: false - metadata: - owner: Chefs - CONTENTS + write_file( + "config/teams/art/artists.yml", + <<~CONTENTS + name: Artists + CONTENTS + ) + + write_file( + "config/teams/food/chefs.yml", + <<~CONTENTS + name: Chefs + CONTENTS + ) + + write_file("empty_file.rb") + write_file( + "package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: false + CONTENTS + ) + + write_file("packs/artists_package_1/app/public/some_subdir/some_public_api_1.rb") + write_file("packs/artists_package_1/app/public/some_subdir/some_public_api_2.rb") + write_file("packs/artists_package_1/app/some_package_file.rb") + write_file( + "packs/artists_package_1/package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: false + metadata: + owner: Artists + CONTENTS + ) + + write_file("packs/chefs_package_2/app/some_package_file.rb") + write_file( + "packs/chefs_package_2/package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: false + metadata: + owner: Chefs + CONTENTS + ) + + write_file( + "packs/artists_package_2/app/public/README.md", + <<~CONTENTS + # This file should not be included in the stats + CONTENTS + ) + + write_file("packs/artists_package_2/app/some_package_file.rb") + write_file( + "packs/artists_package_2/package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: false + metadata: + owner: Artists + CONTENTS + ) + + write_file("packs/chefs_package_1/app/public/some_public_api_1.rb") + write_file( + "packs/chefs_package_1/app/public/README.md", + <<~CONTENTS + # This file should not be included in the stats + CONTENTS + ) + + write_file("packs/chefs_package_1/app/public/some_public_api_2.rb") + write_file("packs/chefs_package_1/app/some_package_file.rb") + write_file( + "packs/chefs_package_1/package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: false + metadata: + owner: Chefs + CONTENTS + ) end - it 'emits the right metrics' do - expect(metrics).to include_metric GaugeMetric.for('all_packages.count', 5, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.using_public_directory.count', 2, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.using_public_directory.count', 1, Tags.for(['team:Chefs', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.using_public_directory.count', 1, Tags.for(['team:Artists', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.using_public_directory.count', 0, Tags.for(['team:Unknown', 'app:MyApp'])) - - expect(metrics).to include_metric GaugeMetric.for('by_team.all_files.count', 4, Tags.for(['team:Chefs', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.all_files.count', 4, Tags.for(['team:Artists', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.all_files.count', 0, Tags.for(['team:Unknown', 'app:MyApp'])) - - expect(metrics).to include_metric GaugeMetric.for('by_team.public_files.count', 2, Tags.for(['team:Chefs', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.public_files.count', 2, Tags.for(['team:Artists', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.public_files.count', 0, Tags.for(['team:Unknown', 'app:MyApp'])) - - expect(metrics).to include_metric GaugeMetric.for('by_package.public_files.count', 2, Tags.for(['package:packs/artists_package_1', 'team:Artists', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.public_files.count', 0, Tags.for(['package:packs/artists_package_2', 'team:Artists', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.public_files.count', 2, Tags.for(['package:packs/chefs_package_1', 'team:Chefs', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.public_files.count', 0, Tags.for(['package:packs/chefs_package_2', 'team:Chefs', 'app:MyApp'])) + it "emits the right metrics" do + expect(metrics).to include_metric GaugeMetric.for("all_packages.count", 5, Tags.for(["app:MyApp"])) + expect(metrics).to( + include_metric GaugeMetric.for("all_packages.using_public_directory.count", 2, Tags.for(["app:MyApp"])) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("by_team.using_public_directory.count", 1, Tags.for(["team:Chefs", "app:MyApp"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("by_team.using_public_directory.count", 1, Tags.for(["team:Artists", "app:MyApp"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("by_team.using_public_directory.count", 0, Tags.for(["team:Unknown", "app:MyApp"])) + ) + ) + + expect(metrics).to( + include_metric GaugeMetric.for("by_team.all_files.count", 4, Tags.for(["team:Chefs", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("by_team.all_files.count", 4, Tags.for(["team:Artists", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("by_team.all_files.count", 0, Tags.for(["team:Unknown", "app:MyApp"])) + ) + + expect(metrics).to( + include_metric GaugeMetric.for("by_team.public_files.count", 2, Tags.for(["team:Chefs", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("by_team.public_files.count", 2, Tags.for(["team:Artists", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("by_team.public_files.count", 0, Tags.for(["team:Unknown", "app:MyApp"])) + ) + + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.public_files.count", + 2, + Tags.for(["package:packs/artists_package_1", "team:Artists", "app:MyApp"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.public_files.count", + 0, + Tags.for(["package:packs/artists_package_2", "team:Artists", "app:MyApp"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.public_files.count", + 2, + Tags.for(["package:packs/chefs_package_1", "team:Chefs", "app:MyApp"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.public_files.count", + 0, + Tags.for(["package:packs/chefs_package_2", "team:Chefs", "app:MyApp"]) + ) + ) + ) end end - context 'in an app with mixed usage of readmes' do + context "in an app with mixed usage of readmes" do before do - write_file('config/teams/art/artists.yml', <<~CONTENTS) - name: Artists - CONTENTS - - write_file('config/teams/food/chefs.yml', <<~CONTENTS) - name: Chefs - CONTENTS - - write_file('empty_file.rb') - write_file('package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: false - CONTENTS - - write_file('packs/artists_package_1/package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: false - metadata: - owner: Artists - CONTENTS - - write_file('packs/artists_package_1/README.md', <<~CONTENTS) - This is a readme. - CONTENTS - - write_file('packs/chefs_package_2/package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: false - metadata: - owner: Chefs - CONTENTS - - write_file('packs/artists_package_2/package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: false - metadata: - owner: Artists - CONTENTS - - write_file('packs/artists_package_2/README.md', <<~CONTENTS) - This is a readme. - CONTENTS - - write_file('packs/chefs_package_1/package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: false - metadata: - owner: Chefs - CONTENTS - - write_file('packs/chefs_package_1/README.md', <<~CONTENTS) - This is a readme. - CONTENTS + write_file( + "config/teams/art/artists.yml", + <<~CONTENTS + name: Artists + CONTENTS + ) + + write_file( + "config/teams/food/chefs.yml", + <<~CONTENTS + name: Chefs + CONTENTS + ) + + write_file("empty_file.rb") + write_file( + "package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: false + CONTENTS + ) + + write_file( + "packs/artists_package_1/package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: false + metadata: + owner: Artists + CONTENTS + ) + + write_file( + "packs/artists_package_1/README.md", + <<~CONTENTS + This is a readme. + CONTENTS + ) + + write_file( + "packs/chefs_package_2/package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: false + metadata: + owner: Chefs + CONTENTS + ) + + write_file( + "packs/artists_package_2/package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: false + metadata: + owner: Artists + CONTENTS + ) + + write_file( + "packs/artists_package_2/README.md", + <<~CONTENTS + This is a readme. + CONTENTS + ) + + write_file( + "packs/chefs_package_1/package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: false + metadata: + owner: Chefs + CONTENTS + ) + + write_file( + "packs/chefs_package_1/README.md", + <<~CONTENTS + This is a readme. + CONTENTS + ) end - it 'emits the right metrics' do - expect(metrics).to include_metric GaugeMetric.for('all_packages.count', 5, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.has_readme.count', 3, Tags.for(['app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.has_readme.count', 1, Tags.for(['team:Chefs', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.has_readme.count', 2, Tags.for(['team:Artists', 'app:MyApp'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.has_readme.count', 0, Tags.for(['team:Unknown', 'app:MyApp'])) + it "emits the right metrics" do + expect(metrics).to include_metric GaugeMetric.for("all_packages.count", 5, Tags.for(["app:MyApp"])) + expect(metrics).to include_metric GaugeMetric.for("all_packages.has_readme.count", 3, Tags.for(["app:MyApp"])) + expect(metrics).to( + include_metric GaugeMetric.for("by_team.has_readme.count", 1, Tags.for(["team:Chefs", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("by_team.has_readme.count", 2, Tags.for(["team:Artists", "app:MyApp"])) + ) + expect(metrics).to( + include_metric GaugeMetric.for("by_team.has_readme.count", 0, Tags.for(["team:Unknown", "app:MyApp"])) + ) end end - context 'in an app with exclusions for rubocop based protections' do + context "in an app with exclusions for rubocop based protections" do before do - write_package_yml('.') - write_package_yml('packs/foo') - write_package_yml('packs/foo/bar') - write_package_yml('packs/foo/baz') - write_package_yml('packs/apples') - write_file('.rubocop_todo.yml', <<~YML) - Packs/RootNamespaceIsPackName: - Exclude: - - app/services/my_file1.rb - - app/services/my_file2.rb - Packs/TypedPublicApis: - Exclude: - - app/services/my_file1.rb - - app/services/my_file2.rb - YML + write_package_yml(".") + write_package_yml("packs/foo") + write_package_yml("packs/foo/bar") + write_package_yml("packs/foo/baz") + write_package_yml("packs/apples") + write_file( + ".rubocop_todo.yml", + <<~YML + Packs/RootNamespaceIsPackName: + Exclude: + - app/services/my_file1.rb + - app/services/my_file2.rb + Packs/TypedPublicApis: + Exclude: + - app/services/my_file1.rb + - app/services/my_file2.rb + YML + ) - write_file('packs/foo/package_rubocop_todo.yml', <<~YML) - Packs/RootNamespaceIsPackName: - Exclude: - - packs/foo/app/services/my_file1.rb - - packs/foo/app/services/my_file2.rb - Packs/TypedPublicApis: - Exclude: - - packs/foo/app/services/my_file1.rb - - packs/foo/app/services/my_file2.rb - YML + write_file( + "packs/foo/package_rubocop_todo.yml", + <<~YML + Packs/RootNamespaceIsPackName: + Exclude: + - packs/foo/app/services/my_file1.rb + - packs/foo/app/services/my_file2.rb + Packs/TypedPublicApis: + Exclude: + - packs/foo/app/services/my_file1.rb + - packs/foo/app/services/my_file2.rb + YML + ) - write_file('packs/foo/bar/package_rubocop_todo.yml', <<~YML) - Packs/RootNamespaceIsPackName: - Exclude: - - packs/foo/bar/app/services/my_file1.rb - - packs/foo/bar/app/services/my_file2.rb - Packs/TypedPublicApis: - Exclude: - - packs/foo/bar/app/services/my_file1.rb - - packs/foo/bar/app/services/my_file2.rb - YML + write_file( + "packs/foo/bar/package_rubocop_todo.yml", + <<~YML + Packs/RootNamespaceIsPackName: + Exclude: + - packs/foo/bar/app/services/my_file1.rb + - packs/foo/bar/app/services/my_file2.rb + Packs/TypedPublicApis: + Exclude: + - packs/foo/bar/app/services/my_file1.rb + - packs/foo/bar/app/services/my_file2.rb + YML + ) end - it 'emits metrics about rubocop exclusions' do + it "emits metrics about rubocop exclusions" do end end - context 'when getting metrics after turning all protections to max' do - let(:subject) do + context "when getting metrics after turning all protections to max" do + subject do PackStats.get_metrics( - app_name: 'MyApp', - source_code_pathnames: Pathname.glob('**/**.rb'), - componentized_source_code_locations: [Pathname.new('components')], + app_name: "MyApp", + source_code_pathnames: Pathname.glob("**/**.rb"), + componentized_source_code_locations: [Pathname.new("components")], max_enforcements_tag_value: true ) end - include_context 'only one team' + include_context "only one team" before do - write_file('empty_file.rb') - write_file('packs/only_package/app/some_package_file.rb') - write_file('packs/only_package/package.yml', <<~CONTENTS) - enforce_dependencies: true - enforce_privacy: true - CONTENTS - - write_file('packs/only_package/spec/some_package_file_spec.rb') + write_file("empty_file.rb") + write_file("packs/only_package/app/some_package_file.rb") + write_file( + "packs/only_package/package.yml", + <<~CONTENTS + enforce_dependencies: true + enforce_privacy: true + CONTENTS + ) + + write_file("packs/only_package/spec/some_package_file_spec.rb") end - it 'emits the right metrics' do - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.component_files.by_team', count: 0, tags: Tags.for(['team:Some team', 'app:MyApp', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.packaged_files.by_team', count: 2, tags: Tags.for(['team:Some team', 'app:MyApp', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.all_files.by_team', count: 3, tags: Tags.for(['team:Some team', 'app:MyApp', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.component_files.totals', count: 0, tags: Tags.for(['app:MyApp', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.packaged_files.totals', count: 2, tags: Tags.for(['app:MyApp', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.all_files.totals', count: 3, tags: Tags.for(['app:MyApp', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.all_packages.count', count: 2, tags: Tags.for(['app:MyApp', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.all_packages.dependencies.count', count: 0, tags: Tags.for(['app:MyApp', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.all_packages.violations.count', count: 0, tags: Tags.for(['app:MyApp', 'max_enforcements:true', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.all_packages.violations.count', count: 0, tags: Tags.for(['app:MyApp', 'max_enforcements:true', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.all_packages.packwerk_checkers.strict.count', count: 0, tags: Tags.for(['app:MyApp', 'max_enforcements:true', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.all_packages.packwerk_checkers.true.count', count: 2, tags: Tags.for(['app:MyApp', 'max_enforcements:true', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.all_packages.packwerk_checkers.strict.count', count: 0, tags: Tags.for(['app:MyApp', 'max_enforcements:true', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.all_packages.packwerk_checkers.true.count', count: 2, tags: Tags.for(['app:MyApp', 'max_enforcements:true', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.all_packages.package_based_file_ownership.count', count: 0, tags: Tags.for(['app:MyApp', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.all_packages.using_public_directory.count', count: 0, tags: Tags.for(['app:MyApp', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.by_package.violations.count', count: 0, tags: Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown', 'max_enforcements:true', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.by_package.violations.count', count: 0, tags: Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown', 'max_enforcements:true', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.by_package.violations.count', count: 0, tags: Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown', 'max_enforcements:true', 'violation_type:dependency'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.by_package.violations.count', count: 0, tags: Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown', 'max_enforcements:true', 'violation_type:privacy'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.by_package.dependencies.count', count: 0, tags: Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.by_package.depended_on.count', count: 0, tags: Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.all_packages.using_public_directory.count', count: 0, tags: Tags.for(['app:MyApp', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.all_packages.all_files.count', count: 2, tags: Tags.for(['app:MyApp', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.all_packages.public_files.count', count: 0, tags: Tags.for(['app:MyApp', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.by_team.using_public_directory.count', count: 0, tags: Tags.for(['app:MyApp', 'team:Unknown', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.by_team.all_files.count', count: 2, tags: Tags.for(['app:MyApp', 'team:Unknown', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.by_team.public_files.count', count: 0, tags: Tags.for(['app:MyApp', 'team:Unknown', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.by_package.using_public_directory.count', count: 0, tags: Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.by_package.all_files.count', count: 2, tags: Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown', 'max_enforcements:true'])) - expect(metrics).to include_metric GaugeMetric.new(name: 'modularization.by_package.public_files.count', count: 0, tags: Tags.for(['package:packs/only_package', 'app:MyApp', 'team:Unknown', 'max_enforcements:true'])) end + it "emits the right metrics" do + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.component_files.by_team", + count: 0, + tags: Tags.for(["team:Some team", "app:MyApp", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.packaged_files.by_team", + count: 2, + tags: Tags.for(["team:Some team", "app:MyApp", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.all_files.by_team", + count: 3, + tags: Tags.for(["team:Some team", "app:MyApp", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.component_files.totals", + count: 0, + tags: Tags.for(["app:MyApp", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.packaged_files.totals", + count: 2, + tags: Tags.for(["app:MyApp", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.all_files.totals", + count: 3, + tags: Tags.for(["app:MyApp", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.all_packages.count", + count: 2, + tags: Tags.for(["app:MyApp", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.all_packages.dependencies.count", + count: 0, + tags: Tags.for(["app:MyApp", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.all_packages.violations.count", + count: 0, + tags: Tags.for(["app:MyApp", "max_enforcements:true", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.all_packages.violations.count", + count: 0, + tags: Tags.for(["app:MyApp", "max_enforcements:true", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.all_packages.packwerk_checkers.strict.count", + count: 0, + tags: Tags.for(["app:MyApp", "max_enforcements:true", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.all_packages.packwerk_checkers.true.count", + count: 2, + tags: Tags.for(["app:MyApp", "max_enforcements:true", "violation_type:dependency"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.all_packages.packwerk_checkers.strict.count", + count: 0, + tags: Tags.for(["app:MyApp", "max_enforcements:true", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.all_packages.packwerk_checkers.true.count", + count: 2, + tags: Tags.for(["app:MyApp", "max_enforcements:true", "violation_type:privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.all_packages.package_based_file_ownership.count", + count: 0, + tags: Tags.for(["app:MyApp", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.all_packages.using_public_directory.count", + count: 0, + tags: Tags.for(["app:MyApp", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.by_package.violations.count", + count: 0, + tags: Tags.for( + [ + "package:packs/only_package", + "app:MyApp", + "team:Unknown", + "max_enforcements:true", + "violation_type:dependency" + ] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.by_package.violations.count", + count: 0, + tags: Tags.for( + [ + "package:packs/only_package", + "app:MyApp", + "team:Unknown", + "max_enforcements:true", + "violation_type:privacy" + ] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.by_package.violations.count", + count: 0, + tags: Tags.for( + [ + "package:packs/only_package", + "app:MyApp", + "team:Unknown", + "max_enforcements:true", + "violation_type:dependency" + ] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.by_package.violations.count", + count: 0, + tags: Tags.for( + [ + "package:packs/only_package", + "app:MyApp", + "team:Unknown", + "max_enforcements:true", + "violation_type:privacy" + ] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.by_package.dependencies.count", + count: 0, + tags: Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.by_package.depended_on.count", + count: 0, + tags: Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.all_packages.using_public_directory.count", + count: 0, + tags: Tags.for(["app:MyApp", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.all_packages.all_files.count", + count: 2, + tags: Tags.for(["app:MyApp", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.all_packages.public_files.count", + count: 0, + tags: Tags.for(["app:MyApp", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.by_team.using_public_directory.count", + count: 0, + tags: Tags.for(["app:MyApp", "team:Unknown", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.by_team.all_files.count", + count: 2, + tags: Tags.for(["app:MyApp", "team:Unknown", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.by_team.public_files.count", + count: 0, + tags: Tags.for(["app:MyApp", "team:Unknown", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.by_package.using_public_directory.count", + count: 0, + tags: Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.by_package.all_files.count", + count: 2, + tags: Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown", "max_enforcements:true"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.new( + name: "modularization.by_package.public_files.count", + count: 0, + tags: Tags.for(["package:packs/only_package", "app:MyApp", "team:Unknown", "max_enforcements:true"]) + ) + ) + ) + end end - context 'in app with layer enforcements' do + context "in app with layer enforcements" do before do - write_file('config/teams/Foo Team.yml', <<~CONTENTS) - name: Foo Team - CONTENTS - - write_file('config/teams/Bar Team.yml', <<~CONTENTS) - name: Bar Team - CONTENTS - - write_file('packs/my_pack/package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: false - enforce_layers: true - enforce_visibility: true - layer: utilities - metadata: - owner: Bar Team - CONTENTS - - write_file('packs/other_pack/package.yml', <<~CONTENTS) - enforce_dependencies: false - layer: product - metadata: - owner: Foo Team - CONTENTS - - write_file('packs/my_pack/package_todo.yml', <<~CONTENTS) - --- - packs/other_pack: - "SomeConstant": - violations: - - layer - - visibility - files: - - some_file.rb - CONTENTS + write_file( + "config/teams/Foo Team.yml", + <<~CONTENTS + name: Foo Team + CONTENTS + ) + + write_file( + "config/teams/Bar Team.yml", + <<~CONTENTS + name: Bar Team + CONTENTS + ) + + write_file( + "packs/my_pack/package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: false + enforce_layers: true + enforce_visibility: true + layer: utilities + metadata: + owner: Bar Team + CONTENTS + ) + write_file( + "packs/other_pack/package.yml", + <<~CONTENTS + enforce_dependencies: false + layer: product + metadata: + owner: Foo Team + CONTENTS + ) + + write_file( + "packs/my_pack/package_todo.yml", + <<~CONTENTS + --- + packs/other_pack: + "SomeConstant": + violations: + - layer + - visibility + files: + - some_file.rb + CONTENTS + ) end - it 'emits the right metrics' do - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'violation_type:layer'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 1, Tags.for(['app:MyApp', 'violation_type:layer'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'violation_type:visibility'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 1, Tags.for(['app:MyApp', 'violation_type:visibility'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 1, Tags.for(['app:MyApp', 'violation_type:visibility'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.violations.count', 1, Tags.for(['app:MyApp', 'violation_type:layer'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.violations.count', 1, Tags.for(['app:MyApp', 'violation_type:visibility'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.count', 1, Tags.for(['app:MyApp', 'team:Bar Team', 'violation_type:layer'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.count', 1, Tags.for(['app:MyApp', 'team:Bar Team', 'violation_type:visibility'])) - - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 1, Tags.for(['app:MyApp', 'package:packs/my_pack', 'team:Bar Team', 'violation_type:layer', 'layer:utilities'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 1, Tags.for(['app:MyApp', 'package:packs/my_pack', 'team:Bar Team', 'violation_type:visibility', 'layer:utilities'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['app:MyApp', 'package:packs/other_pack', 'team:Foo Team', 'violation_type:layer', 'layer:product'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.count', 0, Tags.for(['app:MyApp', 'package:packs/other_pack', 'team:Foo Team', 'violation_type:visibility', 'layer:product'])) - - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.by_other_package.count', 1, Tags.for(['app:MyApp', 'package:packs/my_pack', 'other_package:packs/other_pack', 'team:Bar Team', 'other_team:Foo Team', 'violation_type:layer', 'layer:utilities'])) - expect(metrics).to include_metric GaugeMetric.for('by_package.violations.by_other_package.count', 1, Tags.for(['app:MyApp', 'package:packs/my_pack', 'other_package:packs/other_pack', 'team:Bar Team', 'other_team:Foo Team', 'violation_type:visibility', 'layer:utilities'])) - expect(metrics).to_not include_metric GaugeMetric.for('by_package.violations.by_other_package.count', 0, Tags.for(['app:MyApp', 'package:packs/other_pack', 'other_package:packs/my_pack', 'team:Foo Team', 'other_team:Bar Team', 'violation_type:layer', 'layer:product'])) - expect(metrics).to_not include_metric GaugeMetric.for('by_package.violations.by_other_package.count', 0, Tags.for(['app:MyApp', 'package:packs/other_pack', 'other_package:packs/my_pack', 'team:Foo Team', 'other_team:Bar Team', 'violation_type:visibility', 'layer:product'])) - - expect(metrics).to_not include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 0, Tags.for(['app:MyApp', 'team:Foo Team', 'other_team:Bar Team', 'violation_type:layer'])) - expect(metrics).to_not include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 0, Tags.for(['app:MyApp', 'team:Foo Team', 'other_team:Bar Team', 'violation_type:visibility'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 1, Tags.for(['app:MyApp', 'team:Bar Team', 'other_team:Foo Team', 'violation_type:layer'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.by_other_team.count', 1, Tags.for(['app:MyApp', 'team:Bar Team', 'other_team:Foo Team', 'violation_type:visibility'])) + it "emits the right metrics" do + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "violation_type:layer"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 1, + Tags.for(["app:MyApp", "violation_type:layer"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "violation_type:visibility"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 1, + Tags.for(["app:MyApp", "violation_type:visibility"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 1, + Tags.for(["app:MyApp", "violation_type:visibility"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.violations.count", 1, Tags.for(["app:MyApp", "violation_type:layer"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for("all_packages.violations.count", 1, Tags.for(["app:MyApp", "violation_type:visibility"])) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.count", + 1, + Tags.for(["app:MyApp", "team:Bar Team", "violation_type:layer"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.count", + 1, + Tags.for(["app:MyApp", "team:Bar Team", "violation_type:visibility"]) + ) + ) + ) + + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 1, + Tags.for( + ["app:MyApp", "package:packs/my_pack", "team:Bar Team", "violation_type:layer", "layer:utilities"] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 1, + Tags.for( + [ + "app:MyApp", + "package:packs/my_pack", + "team:Bar Team", + "violation_type:visibility", + "layer:utilities" + ] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for( + ["app:MyApp", "package:packs/other_pack", "team:Foo Team", "violation_type:layer", "layer:product"] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.count", + 0, + Tags.for( + [ + "app:MyApp", + "package:packs/other_pack", + "team:Foo Team", + "violation_type:visibility", + "layer:product" + ] + ) + ) + ) + ) + + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.by_other_package.count", + 1, + Tags.for( + [ + "app:MyApp", + "package:packs/my_pack", + "other_package:packs/other_pack", + "team:Bar Team", + "other_team:Foo Team", + "violation_type:layer", + "layer:utilities" + ] + ) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_package.violations.by_other_package.count", + 1, + Tags.for( + [ + "app:MyApp", + "package:packs/my_pack", + "other_package:packs/other_pack", + "team:Bar Team", + "other_team:Foo Team", + "violation_type:visibility", + "layer:utilities" + ] + ) + ) + ) + ) + expect(metrics).not_to( + include_metric( + GaugeMetric.for( + "by_package.violations.by_other_package.count", + 0, + Tags.for( + [ + "app:MyApp", + "package:packs/other_pack", + "other_package:packs/my_pack", + "team:Foo Team", + "other_team:Bar Team", + "violation_type:layer", + "layer:product" + ] + ) + ) + ) + ) + expect(metrics).not_to( + include_metric( + GaugeMetric.for( + "by_package.violations.by_other_package.count", + 0, + Tags.for( + [ + "app:MyApp", + "package:packs/other_pack", + "other_package:packs/my_pack", + "team:Foo Team", + "other_team:Bar Team", + "violation_type:visibility", + "layer:product" + ] + ) + ) + ) + ) + + expect(metrics).not_to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 0, + Tags.for(["app:MyApp", "team:Foo Team", "other_team:Bar Team", "violation_type:layer"]) + ) + ) + ) + expect(metrics).not_to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 0, + Tags.for(["app:MyApp", "team:Foo Team", "other_team:Bar Team", "violation_type:visibility"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 1, + Tags.for(["app:MyApp", "team:Bar Team", "other_team:Foo Team", "violation_type:layer"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.by_other_team.count", + 1, + Tags.for(["app:MyApp", "team:Bar Team", "other_team:Foo Team", "violation_type:visibility"]) + ) + ) + ) end end - context 'in app with folder_privacy enforcements' do + context "in app with folder_privacy enforcements" do before do - write_file('config/teams/Foo Team.yml', <<~CONTENTS) - name: Foo Team - CONTENTS - - write_file('config/teams/Bar Team.yml', <<~CONTENTS) - name: Bar Team - CONTENTS - - write_file('packs/my_pack/package.yml', <<~CONTENTS) - enforce_dependencies: false - enforce_privacy: false - enforce_folder_privacy: true - enforce_visibility: true - layer: utilities - metadata: - owner: Bar Team - CONTENTS - - write_file('packs/other_pack/package.yml', <<~CONTENTS) - enforce_dependencies: false - metadata: - owner: Foo Team - CONTENTS - - write_file('packs/my_pack/package_todo.yml', <<~CONTENTS) - --- - packs/other_pack: - "SomeConstant": - violations: - - folder_privacy - - visibility - files: - - some_file.rb - CONTENTS + write_file( + "config/teams/Foo Team.yml", + <<~CONTENTS + name: Foo Team + CONTENTS + ) + + write_file( + "config/teams/Bar Team.yml", + <<~CONTENTS + name: Bar Team + CONTENTS + ) + + write_file( + "packs/my_pack/package.yml", + <<~CONTENTS + enforce_dependencies: false + enforce_privacy: false + enforce_folder_privacy: true + enforce_visibility: true + layer: utilities + metadata: + owner: Bar Team + CONTENTS + ) + write_file( + "packs/other_pack/package.yml", + <<~CONTENTS + enforce_dependencies: false + metadata: + owner: Foo Team + CONTENTS + ) + + write_file( + "packs/my_pack/package_todo.yml", + <<~CONTENTS + --- + packs/other_pack: + "SomeConstant": + violations: + - folder_privacy + - visibility + files: + - some_file.rb + CONTENTS + ) end - it 'emits the right metrics' do - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.strict.count', 0, Tags.for(['app:MyApp', 'violation_type:folder_privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.packwerk_checkers.true.count', 1, Tags.for(['app:MyApp', 'violation_type:folder_privacy'])) - expect(metrics).to include_metric GaugeMetric.for('all_packages.violations.count', 1, Tags.for(['app:MyApp', 'violation_type:folder_privacy'])) - expect(metrics).to include_metric GaugeMetric.for('by_team.violations.count', 1, Tags.for(['app:MyApp', 'team:Bar Team', 'violation_type:folder_privacy'])) + it "emits the right metrics" do + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.strict.count", + 0, + Tags.for(["app:MyApp", "violation_type:folder_privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.packwerk_checkers.true.count", + 1, + Tags.for(["app:MyApp", "violation_type:folder_privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "all_packages.violations.count", + 1, + Tags.for(["app:MyApp", "violation_type:folder_privacy"]) + ) + ) + ) + expect(metrics).to( + include_metric( + GaugeMetric.for( + "by_team.violations.count", + 1, + Tags.for(["app:MyApp", "team:Bar Team", "violation_type:folder_privacy"]) + ) + ) + ) end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6553701..eaebc6b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,31 +1,32 @@ +# typed: false # frozen_string_literal: true -require 'bundler/setup' -require 'pack_stats' -require 'pry' -require 'packs/rspec/support' +require "bundler/setup" +require "pack_stats" +require "pry" +require "packs/rspec/support" RSpec.configure do |config| # Enable flags like --only-failures and --next-failure - config.example_status_persistence_file_path = '.rspec_status' + config.example_status_persistence_file_path = ".rspec_status" # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patching! - config.expect_with :rspec do |c| + config.expect_with(:rspec) do |c| c.syntax = :expect end end def sorbet_double(stubbed_class, attr_map = {}) instance_double(stubbed_class, attr_map).tap do |dbl| - allow(dbl).to receive(:is_a?) { |tested_class| stubbed_class.ancestors.include?(tested_class) } + allow(dbl).to(receive(:is_a?) { |tested_class| stubbed_class.ancestors.include?(tested_class) }) end end -RSpec.shared_context 'team names are based off of file names' do +RSpec.shared_context("team names are based off of file names") do before do - allow(CodeOwnership).to receive(:for_file) do |filename| + allow(CodeOwnership).to(receive(:for_file)) do |filename| match = filename.match(/_(\d+)/) if match team_number = match[1] @@ -35,9 +36,9 @@ def sorbet_double(stubbed_class, attr_map = {}) end end -RSpec.shared_context 'only one team' do +RSpec.shared_context("only one team") do before do - allow(CodeOwnership).to receive(:for_file).and_return(sorbet_double(CodeTeams::Team, name: 'Some team')) + allow(CodeOwnership).to(receive(:for_file).and_return(sorbet_double(CodeTeams::Team, name: "Some team"))) end end @@ -46,7 +47,11 @@ def sorbet_double(stubbed_class, attr_map = {}) @actual_metrics = actual_metrics @expected_metric = expected_metric @metrics_with_same_name = actual_metrics.select { |actual_metric| actual_metric.name == expected_metric.name } - @matching_metric = @metrics_with_same_name.find { |matching_metric| matching_metric.count == expected_metric.count && expected_metric.tags.sort_by(&:key) == matching_metric.tags.sort_by(&:key) } + @matching_metric = @metrics_with_same_name.find do |matching_metric| + matching_metric.count == expected_metric.count && + expected_metric.tags.sort_by(&:key) == matching_metric.tags.sort_by(&:key) + end + @metrics_with_same_name.any? && !@matching_metric.nil? end @@ -73,7 +78,7 @@ def sorbet_double(stubbed_class, attr_map = {}) end end - "#{Rainbow(actual_metric.name).green} #{colorized_with_count}, with tags #{tags.join(', ')}" + "#{Rainbow(actual_metric.name).green} #{colorized_with_count}, with tags #{tags.join(", ")}" end "Could not find metric:\n\n#{expected_metric}\n\nCould only find metrics: \n\n#{colorized_metrics.join("\n")}" @@ -84,8 +89,11 @@ def sorbet_double(stubbed_class, attr_map = {}) def write_package_yml( name ) - write_pack(name, { - 'enforce_dependencies' => true, - 'enforce_privacy' => true, - }) + write_pack( + name, + { + "enforce_dependencies" => true, + "enforce_privacy" => true + } + ) end From bcc0113ef20883e3db599594ef7d45c02c0a1f16 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Thu, 23 Jul 2026 14:35:27 -0700 Subject: [PATCH 2/5] Remove rspec version pin from gemspec --- Gemfile.lock | 2 +- pack_stats.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 173cedf..abc6ee9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -278,7 +278,7 @@ DEPENDENCIES pack_stats! pry rake - rspec (~> 3.0) + rspec rubocop-gusto rubocop-rubyfmt sorbet diff --git a/pack_stats.gemspec b/pack_stats.gemspec index 5b5f5a5..3bec3a1 100644 --- a/pack_stats.gemspec +++ b/pack_stats.gemspec @@ -41,7 +41,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency("base64") spec.add_development_dependency("pry") spec.add_development_dependency("rake") - spec.add_development_dependency("rspec", "~> 3.0") + spec.add_development_dependency("rspec") spec.add_development_dependency("rubocop-gusto") spec.add_development_dependency("rubocop-rubyfmt") spec.add_development_dependency("sorbet") From 34469e8394f34a114cc02d05dbc1c2e45c4028f4 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Thu, 23 Jul 2026 14:36:34 -0700 Subject: [PATCH 3/5] Bundle update --all Fixes a new Sorbet/RedundantTLetForLiteral offense from the rubocop-sorbet bump. --- Gemfile.lock | 50 ++++++++++++++----------------- lib/pack_stats.rb | 2 +- lib/pack_stats/private/metrics.rb | 2 +- 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index abc6ee9..3f38873 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -48,10 +48,6 @@ GEM code_teams (~> 1.0) packs-specification sorbet-runtime (>= 0.6.12763) - code_ownership (2.1.3-x86_64-darwin) - code_teams (~> 1.0) - packs-specification - sorbet-runtime (>= 0.6.12763) code_ownership (2.1.3-x86_64-linux) code_teams (~> 1.0) packs-specification @@ -59,7 +55,7 @@ GEM code_teams (1.3.0) sorbet-runtime coderay (1.1.3) - concurrent-ruby (1.3.7) + concurrent-ruby (1.3.8) connection_pool (3.0.2) constant_resolver (0.3.0) crass (1.0.7) @@ -71,8 +67,8 @@ GEM i18n (1.15.2) concurrent-ruby (~> 1.0) io-console (0.8.2) - json (2.20.0) - language_server-protocol (3.17.0.5) + json (2.21.1) + language_server-protocol (3.17.0.6) lint_roller (1.1.0) logger (1.7.0) loofah (2.25.2) @@ -82,7 +78,7 @@ GEM minitest (6.0.6) drb (~> 2.0) prism (~> 1.5) - multi_json (1.15.0) + multi_json (1.21.1) netrc (0.11.0) nokogiri (1.19.4-arm64-darwin) racc (~> 1.4) @@ -117,7 +113,7 @@ GEM parse_packwerk (0.27.0) bigdecimal sorbet-runtime - parser (3.3.11.1) + parser (3.3.12.0) ast (~> 2.4.1) racc pastel (0.8.0) @@ -137,7 +133,7 @@ GEM 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) rainbow (3.1.1) rake (13.4.2) - rbi (0.3.14) + rbi (0.4.0) prism (~> 1.0) rbs (>= 4.0.1) rbs (4.0.3) @@ -147,7 +143,7 @@ GEM regexp_parser (2.12.0) reline (0.6.3) io-console (~> 0.5) - require-hooks (0.4.0) + require-hooks (0.4.1) rexml (3.4.4) rspec (3.13.2) rspec-core (~> 3.13.0) @@ -162,7 +158,7 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.7) - rubocop (1.88.0) + rubocop (1.88.2) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -173,7 +169,7 @@ GEM rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.49.1) + rubocop-ast (1.50.0) parser (>= 3.3.7.2) prism (~> 1.7) rubocop-gusto (11.3.0) @@ -209,29 +205,29 @@ GEM rubocop-rubyfmt (0.1.1) lint_roller (~> 1.1) rubocop (>= 1.72.2) - rubocop-sorbet (0.12.0) + rubocop-sorbet (0.13.2) lint_roller rubocop (>= 1.75.2) ruby-progressbar (1.13.0) - rubydex (0.2.6-arm64-darwin) - rubydex (0.2.6-x86_64-darwin) - rubydex (0.2.6-x86_64-linux) + rubydex (0.3.0-arm64-darwin) + rubydex (0.3.0-x86_64-darwin) + rubydex (0.3.0-x86_64-linux) securerandom (0.4.1) smart_properties (1.17.0) smart_todo (1.11.0) prism (~> 1.0) - sorbet (0.6.13321) - sorbet-static (= 0.6.13321) - sorbet-runtime (0.6.13321) - sorbet-static (0.6.13321-universal-darwin) - sorbet-static (0.6.13321-x86_64-linux) - sorbet-static-and-runtime (0.6.13321) - sorbet (= 0.6.13321) - sorbet-runtime (= 0.6.13321) - spoom (1.8.2) + sorbet (0.6.13354) + sorbet-static (= 0.6.13354) + sorbet-runtime (0.6.13354) + sorbet-static (0.6.13354-universal-darwin) + sorbet-static (0.6.13354-x86_64-linux) + sorbet-static-and-runtime (0.6.13354) + sorbet (= 0.6.13354) + sorbet-runtime (= 0.6.13354) + spoom (1.8.4) erubi (>= 1.10.0) prism (>= 0.28.0) - rbi (>= 0.3.14) + rbi (>= 0.3.15) rbs (>= 4.0.0.dev.5) rexml (>= 3.2.6) sorbet-static-and-runtime (>= 0.5.10187) diff --git a/lib/pack_stats.rb b/lib/pack_stats.rb index 4d6e72e..d1fd38f 100644 --- a/lib/pack_stats.rb +++ b/lib/pack_stats.rb @@ -20,7 +20,7 @@ module PackStats extend T::Sig - ROOT_PACKAGE_NAME = T.let("root", String) + ROOT_PACKAGE_NAME = "root" DEFAULT_COMPONENTIZED_SOURCE_CODE_LOCATIONS = T.let( [ diff --git a/lib/pack_stats/private/metrics.rb b/lib/pack_stats/private/metrics.rb index 8133f31..2df7c00 100644 --- a/lib/pack_stats/private/metrics.rb +++ b/lib/pack_stats/private/metrics.rb @@ -6,7 +6,7 @@ module Private module Metrics extend T::Sig - UNKNOWN_OWNER = T.let("Unknown", String) + UNKNOWN_OWNER = "Unknown" sig { params(team_name: T.nilable(String)).returns(T::Array[Tag]) } def self.tags_for_team(team_name) From 427028ffdfd7e978cb77ba465650c6704bc4fccb Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Thu, 23 Jul 2026 14:52:22 -0700 Subject: [PATCH 4/5] Regenerate tapioca RBI shims Syncs sorbet/rbi with the current Gemfile.lock (new rubocop-gusto/ rubocop-rubyfmt dev deps and the bundle update) and excludes the tapioca-managed sorbet/tapioca/require.rb from rubocop/rubyfmt. --- .rubocop.yml | 1 + .rubyfmtignore | 1 + bin/tapioca | 15 +- sorbet/config | 4 +- sorbet/rbi/annotations/.gitattributes | 1 + sorbet/rbi/annotations/actionview.rbi | 75 + sorbet/rbi/annotations/activesupport.rbi | 561 + sorbet/rbi/annotations/minitest.rbi | 116 + sorbet/rbi/annotations/rainbow.rbi | 269 + sorbet/rbi/gems/.gitattributes | 1 + sorbet/rbi/gems/actionview@8.1.3.rbi | 14050 ++++ sorbet/rbi/gems/activesupport@8.1.3.rbi | 19015 +++++ .../rbi/gems/{ast@2.4.2.rbi => ast@2.4.3.rbi} | 124 +- sorbet/rbi/gems/builder@3.3.0.rbi | 9 + sorbet/rbi/gems/code_ownership@1.29.2.rbi | 525 - sorbet/rbi/gems/code_ownership@2.1.3.rbi | 462 + sorbet/rbi/gems/code_teams@1.0.0.rbi | 120 - sorbet/rbi/gems/code_teams@1.3.0.rbi | 235 + sorbet/rbi/gems/coderay@1.1.3.rbi | 3342 + sorbet/rbi/gems/concurrent-ruby@1.3.8.rbi | 10591 +++ sorbet/rbi/gems/connection_pool@3.0.2.rbi | 9 + sorbet/rbi/gems/constant_resolver@0.3.0.rbi | 9 + sorbet/rbi/gems/crass@1.0.7.rbi | 9 + sorbet/rbi/gems/diff-lcs@1.6.2.rbi | 1067 + sorbet/rbi/gems/dogapi@1.45.0.rbi | 1532 +- sorbet/rbi/gems/erubi@1.13.1.rbi | 153 + sorbet/rbi/gems/i18n@1.15.2.rbi | 2285 + sorbet/rbi/gems/io-console@0.8.2.rbi | 9 + .../language_server-protocol@3.17.0.6.rbi | 9 + sorbet/rbi/gems/lint_roller@1.1.0.rbi | 189 + sorbet/rbi/gems/loofah@2.25.2.rbi | 9 + sorbet/rbi/gems/manual.rbi | 4 - sorbet/rbi/gems/method_source@1.1.0.rbi | 293 + sorbet/rbi/gems/minitest@6.0.6.rbi | 1482 + sorbet/rbi/gems/multi_json@1.21.1.rbi | 1271 + sorbet/rbi/gems/netrc@0.11.0.rbi | 147 + sorbet/rbi/gems/nokogiri@1.19.4.rbi | 9 + .../rbi/gems/packs-specification@0.0.11.rbi | 160 + sorbet/rbi/gems/packs@0.0.5.rbi | 111 - sorbet/rbi/gems/packs@0.3.0.rbi | 886 + sorbet/rbi/gems/packwerk@3.3.0.rbi | 9 + sorbet/rbi/gems/parallel@1.28.0.rbi | 270 + ...k@0.19.1.rbi => parse_packwerk@0.27.0.rbi} | 162 +- sorbet/rbi/gems/parser@3.3.12.0.rbi | 5229 ++ sorbet/rbi/gems/pastel@0.8.0.rbi | 760 + sorbet/rbi/gems/prism@1.9.0.rbi | 42226 +++++++++++ sorbet/rbi/gems/pry@0.16.0.rbi | 9091 +++ sorbet/rbi/gems/rails-dom-testing@2.3.0.rbi | 9 + .../rbi/gems/rails-html-sanitizer@1.7.1.rbi | 9 + sorbet/rbi/gems/rainbow@3.1.1.rbi | 362 + sorbet/rbi/gems/rake@13.4.2.rbi | 3127 + sorbet/rbi/gems/rbi@0.4.0.rbi | 5706 ++ sorbet/rbi/gems/rbs@4.0.3.rbi | 6908 ++ sorbet/rbi/gems/regexp_parser@2.12.0.rbi | 3398 + sorbet/rbi/gems/require-hooks@0.4.1.rbi | 152 + sorbet/rbi/gems/rspec-core@3.13.6.rbi | 9720 +++ sorbet/rbi/gems/rspec-expectations@3.13.5.rbi | 6066 ++ sorbet/rbi/gems/rspec-mocks@3.13.8.rbi | 4787 ++ sorbet/rbi/gems/rspec-support@3.13.7.rbi | 1274 + sorbet/rbi/gems/rspec@3.10.0.rbi | 13 - sorbet/rbi/gems/rspec@3.13.2.rbi | 15 + sorbet/rbi/gems/rubocop-ast@1.50.0.rbi | 7258 ++ sorbet/rbi/gems/rubocop-gusto@11.3.0.rbi | 1664 + sorbet/rbi/gems/rubocop-packs@0.0.45.rbi | 433 + .../rbi/gems/rubocop-performance@1.26.1.rbi | 9 + sorbet/rbi/gems/rubocop-rake@0.7.1.rbi | 9 + sorbet/rbi/gems/rubocop-rspec@3.10.2.rbi | 7873 ++ sorbet/rbi/gems/rubocop-rubyfmt@0.1.1.rbi | 85 + sorbet/rbi/gems/rubocop-sorbet@0.13.2.rbi | 2838 + sorbet/rbi/gems/rubocop@1.88.2.rbi | 63233 ++++++++++++++++ sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi | 988 + sorbet/rbi/gems/rubydex@0.3.0.rbi | 875 + sorbet/rbi/gems/smart_properties@1.17.0.rbi | 9 + sorbet/rbi/gems/smart_todo@1.11.0.rbi | 645 + sorbet/rbi/gems/spoom@1.8.4.rbi | 6738 ++ sorbet/rbi/gems/tapioca@0.19.2.rbi | 3600 + sorbet/rbi/gems/thor@1.5.0.rbi | 3870 + sorbet/rbi/gems/tty-color@0.6.0.rbi | 228 + sorbet/rbi/gems/tty-cursor@0.7.1.rbi | 407 + sorbet/rbi/gems/tty-prompt@0.23.1.rbi | 3355 + sorbet/rbi/gems/tty-reader@0.9.0.rbi | 972 + sorbet/rbi/gems/tty-screen@0.8.2.rbi | 493 + sorbet/rbi/gems/tzinfo@2.0.6.rbi | 5474 ++ .../rbi/gems/unicode-display_width@3.2.0.rbi | 130 + sorbet/rbi/gems/unicode-emoji@4.2.0.rbi | 332 + sorbet/rbi/gems/wisper@2.0.1.rbi | 435 + sorbet/rbi/gems/zeitwerk@2.8.2.rbi | 9 + sorbet/rbi/todo.rbi | 5 - sorbet/tapioca/config.yml | 53 + sorbet/tapioca/require.rb | 33 + 90 files changed, 269561 insertions(+), 945 deletions(-) create mode 100644 sorbet/rbi/annotations/.gitattributes create mode 100644 sorbet/rbi/annotations/actionview.rbi create mode 100644 sorbet/rbi/annotations/activesupport.rbi create mode 100644 sorbet/rbi/annotations/minitest.rbi create mode 100644 sorbet/rbi/annotations/rainbow.rbi create mode 100644 sorbet/rbi/gems/.gitattributes create mode 100644 sorbet/rbi/gems/actionview@8.1.3.rbi create mode 100644 sorbet/rbi/gems/activesupport@8.1.3.rbi rename sorbet/rbi/gems/{ast@2.4.2.rbi => ast@2.4.3.rbi} (86%) create mode 100644 sorbet/rbi/gems/builder@3.3.0.rbi delete mode 100644 sorbet/rbi/gems/code_ownership@1.29.2.rbi create mode 100644 sorbet/rbi/gems/code_ownership@2.1.3.rbi delete mode 100644 sorbet/rbi/gems/code_teams@1.0.0.rbi create mode 100644 sorbet/rbi/gems/code_teams@1.3.0.rbi create mode 100644 sorbet/rbi/gems/coderay@1.1.3.rbi create mode 100644 sorbet/rbi/gems/concurrent-ruby@1.3.8.rbi create mode 100644 sorbet/rbi/gems/connection_pool@3.0.2.rbi create mode 100644 sorbet/rbi/gems/constant_resolver@0.3.0.rbi create mode 100644 sorbet/rbi/gems/crass@1.0.7.rbi create mode 100644 sorbet/rbi/gems/diff-lcs@1.6.2.rbi create mode 100644 sorbet/rbi/gems/erubi@1.13.1.rbi create mode 100644 sorbet/rbi/gems/i18n@1.15.2.rbi create mode 100644 sorbet/rbi/gems/io-console@0.8.2.rbi create mode 100644 sorbet/rbi/gems/language_server-protocol@3.17.0.6.rbi create mode 100644 sorbet/rbi/gems/lint_roller@1.1.0.rbi create mode 100644 sorbet/rbi/gems/loofah@2.25.2.rbi delete mode 100644 sorbet/rbi/gems/manual.rbi create mode 100644 sorbet/rbi/gems/method_source@1.1.0.rbi create mode 100644 sorbet/rbi/gems/minitest@6.0.6.rbi create mode 100644 sorbet/rbi/gems/multi_json@1.21.1.rbi create mode 100644 sorbet/rbi/gems/netrc@0.11.0.rbi create mode 100644 sorbet/rbi/gems/nokogiri@1.19.4.rbi create mode 100644 sorbet/rbi/gems/packs-specification@0.0.11.rbi delete mode 100644 sorbet/rbi/gems/packs@0.0.5.rbi create mode 100644 sorbet/rbi/gems/packs@0.3.0.rbi create mode 100644 sorbet/rbi/gems/packwerk@3.3.0.rbi create mode 100644 sorbet/rbi/gems/parallel@1.28.0.rbi rename sorbet/rbi/gems/{parse_packwerk@0.19.1.rbi => parse_packwerk@0.27.0.rbi} (52%) create mode 100644 sorbet/rbi/gems/parser@3.3.12.0.rbi create mode 100644 sorbet/rbi/gems/pastel@0.8.0.rbi create mode 100644 sorbet/rbi/gems/prism@1.9.0.rbi create mode 100644 sorbet/rbi/gems/pry@0.16.0.rbi create mode 100644 sorbet/rbi/gems/rails-dom-testing@2.3.0.rbi create mode 100644 sorbet/rbi/gems/rails-html-sanitizer@1.7.1.rbi create mode 100644 sorbet/rbi/gems/rainbow@3.1.1.rbi create mode 100644 sorbet/rbi/gems/rake@13.4.2.rbi create mode 100644 sorbet/rbi/gems/rbi@0.4.0.rbi create mode 100644 sorbet/rbi/gems/rbs@4.0.3.rbi create mode 100644 sorbet/rbi/gems/regexp_parser@2.12.0.rbi create mode 100644 sorbet/rbi/gems/require-hooks@0.4.1.rbi create mode 100644 sorbet/rbi/gems/rspec-core@3.13.6.rbi create mode 100644 sorbet/rbi/gems/rspec-expectations@3.13.5.rbi create mode 100644 sorbet/rbi/gems/rspec-mocks@3.13.8.rbi create mode 100644 sorbet/rbi/gems/rspec-support@3.13.7.rbi delete mode 100644 sorbet/rbi/gems/rspec@3.10.0.rbi create mode 100644 sorbet/rbi/gems/rspec@3.13.2.rbi create mode 100644 sorbet/rbi/gems/rubocop-ast@1.50.0.rbi create mode 100644 sorbet/rbi/gems/rubocop-gusto@11.3.0.rbi create mode 100644 sorbet/rbi/gems/rubocop-packs@0.0.45.rbi create mode 100644 sorbet/rbi/gems/rubocop-performance@1.26.1.rbi create mode 100644 sorbet/rbi/gems/rubocop-rake@0.7.1.rbi create mode 100644 sorbet/rbi/gems/rubocop-rspec@3.10.2.rbi create mode 100644 sorbet/rbi/gems/rubocop-rubyfmt@0.1.1.rbi create mode 100644 sorbet/rbi/gems/rubocop-sorbet@0.13.2.rbi create mode 100644 sorbet/rbi/gems/rubocop@1.88.2.rbi create mode 100644 sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi create mode 100644 sorbet/rbi/gems/rubydex@0.3.0.rbi create mode 100644 sorbet/rbi/gems/smart_properties@1.17.0.rbi create mode 100644 sorbet/rbi/gems/smart_todo@1.11.0.rbi create mode 100644 sorbet/rbi/gems/spoom@1.8.4.rbi create mode 100644 sorbet/rbi/gems/tapioca@0.19.2.rbi create mode 100644 sorbet/rbi/gems/thor@1.5.0.rbi create mode 100644 sorbet/rbi/gems/tty-color@0.6.0.rbi create mode 100644 sorbet/rbi/gems/tty-cursor@0.7.1.rbi create mode 100644 sorbet/rbi/gems/tty-prompt@0.23.1.rbi create mode 100644 sorbet/rbi/gems/tty-reader@0.9.0.rbi create mode 100644 sorbet/rbi/gems/tty-screen@0.8.2.rbi create mode 100644 sorbet/rbi/gems/tzinfo@2.0.6.rbi create mode 100644 sorbet/rbi/gems/unicode-display_width@3.2.0.rbi create mode 100644 sorbet/rbi/gems/unicode-emoji@4.2.0.rbi create mode 100644 sorbet/rbi/gems/wisper@2.0.1.rbi create mode 100644 sorbet/rbi/gems/zeitwerk@2.8.2.rbi delete mode 100644 sorbet/rbi/todo.rbi create mode 100644 sorbet/tapioca/config.yml create mode 100644 sorbet/tapioca/require.rb diff --git a/.rubocop.yml b/.rubocop.yml index 23460de..2430b65 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -28,6 +28,7 @@ AllCops: SuggestExtensions: false Exclude: - bin/**/* + - sorbet/tapioca/**/* - vendor/bundle/**/** TargetRubyVersion: 3.3 diff --git a/.rubyfmtignore b/.rubyfmtignore index d9de98d..689c3bc 100644 --- a/.rubyfmtignore +++ b/.rubyfmtignore @@ -1 +1,2 @@ bin/** +sorbet/tapioca/** diff --git a/bin/tapioca b/bin/tapioca index 32290de..82de9af 100755 --- a/bin/tapioca +++ b/bin/tapioca @@ -8,20 +8,7 @@ # this file is here to facilitate running it. # -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -bundle_binstub = File.expand_path("../bundle", __FILE__) - -if File.file?(bundle_binstub) - if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ - load(bundle_binstub) - else - abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. -Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") - end -end +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) require "rubygems" require "bundler/setup" diff --git a/sorbet/config b/sorbet/config index 2e8be00..2aa2796 100644 --- a/sorbet/config +++ b/sorbet/config @@ -1,4 +1,4 @@ ---dir -. +--dir=. --ignore=/vendor/bundle --enable-experimental-requires-ancestor +--enable-experimental-rspec 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/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/activesupport.rbi b/sorbet/rbi/annotations/activesupport.rbi new file mode 100644 index 0000000..0ab777b --- /dev/null +++ b/sorbet/rbi/annotations/activesupport.rbi @@ -0,0 +1,561 @@ +# 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 + +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/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/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/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/actionview@8.1.3.rbi b/sorbet/rbi/gems/actionview@8.1.3.rbi new file mode 100644 index 0000000..f35a171 --- /dev/null +++ b/sorbet/rbi/gems/actionview@8.1.3.rbi @@ -0,0 +1,14050 @@ +# 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`. + + +# :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:97 + 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:94 + def render_tracker; end + + # pkg:gem/actionview#lib/action_view.rb:94 + def render_tracker=(_arg0); 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?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:22 + def formats(*_arg0, **_arg1, &_arg2); 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?(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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, *_arg2); 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, *_arg2); 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(*_arg0, **_arg1, &block); end + + # Calling content_for stores a block of markup in an identifier for later use. + # In order to access this stored content in other templates, helper modules + # 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:787 + 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:784 + def collection_checkboxes(object, method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Returns radio button tags for the collection of existing return values + # of +method+ for +object+'s class. The value returned from calling + # +method+ on the instance +object+ will be selected. If calling +method+ + # returns +nil+, no selection is made. + # + # The :value_method and :text_method parameters are + # methods to be called on each member of +collection+. The return values + # are used as the +value+ attribute and contents of each radio button tag, + # respectively. They can also be any object that responds to +call+, such + # as a +proc+, that will be called for each member of the +collection+ to + # retrieve the value/text. + # + # Example object structure for use with this method: + # + # class Post < ActiveRecord::Base + # belongs_to :author + # end + # + # class Author < ActiveRecord::Base + # has_many :posts + # + # def name_with_initial + # "#{first_name.first}. #{last_name}" + # end + # end + # + # Sample usage (selecting the associated Author for an instance of Post, @post): + # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) + # + # If @post.author_id is already 1, this would return: + # + # + # + # + # + # + # + # It is also possible to customize the way the elements will be shown by + # giving a block to the method: + # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) do |b| + # b.label { b.radio_button } + # end + # + # The argument passed to the block is a special kind of builder for this + # collection, which has the ability to generate the label and radio button + # for the current item in the collection, with proper text and value. + # Using it, you can change the label and radio button display order or + # even use the label as wrapper, as in the example above. + # + # The builder methods label and radio_button also accept + # extra HTML options: + # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) do |b| + # b.label(class: "radio_button") { b.radio_button(class: "radio_button") } + # end + # + # There are also three special methods available: object, text and + # value, which are the current item being rendered, its text and value methods, + # respectively. You can use them like this: + # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) do |b| + # b.label(:"data-value" => b.value) { b.radio_button + b.text } + # end + # + # ==== Gotcha + # + # 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:700 + 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:461 + 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') + # + # 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:400 + 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:580 + def time_zone_options_for_select(selected = T.unsafe(nil), priority_zones = T.unsafe(nil), model = T.unsafe(nil)); end + + # Returns select and option tags for the given object and method, using + # #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:613 + def weekday_options_for_select(selected = T.unsafe(nil), index_as_value: T.unsafe(nil), day_format: T.unsafe(nil), beginning_of_week: T.unsafe(nil)); end + + # Returns select and option tags for the given object and method, using + # #weekday_options_for_select to generate the list of option tags. + # + # 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:812 + def extract_selected_and_disabled(selected); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:823 + def extract_values_from_collection(collection, value_method, selected); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:790 + def option_html_attributes(element); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:798 + def option_text_and_value(option); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:808 + def option_value_selected?(value, selected); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:837 + def prompt_text(prompt); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:833 + def value_for_collection(item, value); end +end + +# = Action View Form Tag \Helpers +# +# Provides a number of methods for creating form tags that don't rely on an Active Record object assigned to the template like +# FormHelper does. Instead, you provide the names and values manually. +# +# NOTE: The HTML options disabled, readonly, and multiple can all be treated as booleans. So specifying +# disabled: true will give disabled="disabled". +# +# 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:107 + def hidden_field; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:113 + 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:75 + def render_collection; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:86 + def render_collection_for(builder_class, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:71 + 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(*_arg0); 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(*_arg0); 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(*_arg0); 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(*_arg0); 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, *_arg5); 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?(*_arg0, **_arg1, &_arg2); 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?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def encode!(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def encoding(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def force_encoding(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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 [](*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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?(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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?(&_arg0); 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/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:12 +class ActionView::StreamingTemplateRenderer < ::ActionView::TemplateRenderer + # For streaming, instead of rendering a given a template, we return a Body + # object that responds to each. This object is initialized with a block + # that knows how to render the template. + # + # 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(*_arg0); 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:506 + 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:555 + def handle_render_error(view, e); end + + # pkg:gem/actionview#lib/action_view/template.rb:580 + def identifier_method_name; end + + # pkg:gem/actionview#lib/action_view/template.rb:584 + def instrument(action, &block); end + + # pkg:gem/actionview#lib/action_view/template.rb:592 + def instrument_payload; end + + # pkg:gem/actionview#lib/action_view/template.rb:588 + def instrument_render_template(&block); end + + # pkg:gem/actionview#lib/action_view/template.rb:567 + def locals_code; end + + # pkg:gem/actionview#lib/action_view/template.rb:547 + 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:7 +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:564 +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/types.rb:48 +ActionView::Template::Types = ActionView::Template::SimpleType + +# 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 + +# 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(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:8 + def handler(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:8 + def locale(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:8 + def variant(*_arg0, **_arg1, &_arg2); 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?(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def view_paths(*_arg0, **_arg1, &_arg2); 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/activesupport@8.1.3.rbi b/sorbet/rbi/gems/activesupport@8.1.3.rbi new file mode 100644 index 0000000..ff5e9de --- /dev/null +++ b/sorbet/rbi/gems/activesupport@8.1.3.rbi @@ -0,0 +1,19015 @@ +# 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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, *_arg1, **_arg2, &_arg3); 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. + # 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. + # 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 <<(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def add(*_arg0, **_arg1, &_arg2); end + + # Add logger(s) to the broadcast. + # + # broadcast_logger = ActiveSupport::BroadcastLogger.new + # broadcast_logger.broadcast_to(Logger.new(STDOUT), Logger.new(STDERR)) + # + # 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(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def debug(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::DEBUG+ for the whole broadcast. + # + # 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def formatter=(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def info(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::INFO+ for the whole broadcast. + # + # 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=(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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=(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:127 + def warn(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::WARN+ for the whole broadcast. + # + # 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, *_arg1, **_arg2, &_arg3); 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), **_arg5); 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:12 +class ActiveSupport::Cache::FileStore < ::ActiveSupport::Cache::Store + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:20 + def initialize(cache_path, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:13 + def cache_path; end + + # Preemptively iterates through all stored keys and removes the ones which have expired. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:40 + def cleanup(options = T.unsafe(nil)); end + + # Deletes all items from the cache. In this case it deletes all the entries in the specified + # file store directory except for .keep or .gitkeep. Be careful which directory is specified in your + # config file when using +FileStore+ because everything in that directory will be deleted. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:33 + 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:80 + def decrement(name, amount = T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:89 + 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:60 + def increment(name, amount = T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:101 + def inspect; end + + private + + # Delete empty directories in the cache. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:195 + def delete_empty_directories(dir); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:131 + def delete_entry(key, **options); end + + # Make sure a file path's directories exist. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:204 + def ensure_cache_path(path); end + + # Translate a file path into a key. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:189 + def file_path_key(path); end + + # Lock a file for a block so only one process can modify it at a time. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:148 + 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:222 + def modify_value(name, amount, options); end + + # Translate a key into a file path. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:162 + def normalize_key(key, options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:106 + def read_entry(key, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:113 + def read_serialized_entry(key, **_arg1); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:208 + def search_dir(dir, &callback); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:120 + def write_entry(key, entry, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:124 + def write_serialized_entry(key, payload, **options); end + + class << self + # Advertise cache versioning support. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:26 + def supports_cache_versioning?; end + end +end + +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:15 +ActiveSupport::Cache::FileStore::DIR_FORMATTER = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:16 +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:17 +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:18 +ActiveSupport::Cache::FileStore::GITKEEP_FILES = T.let(T.unsafe(nil), Array) + +# = Memory \Cache \Store +# +# A cache store implementation which stores everything into memory in the +# same process. If you're running multiple Ruby on \Rails server processes +# (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, **_arg1); 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, **_arg1); 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, **_arg2); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:53 + def write_serialized_entry(key, payload, **_arg2); 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, **_arg1); 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, **_arg1); 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, **_arg2); 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 + +# 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.allowed_access # => nil + # + # User.configure do |config| + # config.allowed_access = true + # end + # + # User.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(&_arg0); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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, *_arg1, **_arg2, &_arg3); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:147 + def name(*_arg0, **_arg1, &_arg2); 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?(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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(&_arg0); 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?(&_arg0); 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?(&_arg0); 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(&_arg0); 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?(&_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/duration.rb:516 + def method_missing(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:17 + def to_i(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:17 + def to_s(*_arg0, **_arg1, &_arg2); 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 + +# 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:9 +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(*_arg0, **_arg1, &_arg2); end + + # Register a new error subscriber. The subscriber must respond to + # + # report(Exception, handled: Boolean, severity: (:error OR :warning OR :info), context: Hash, source: String) + # + # The +report+ method should never raise an error. + # + # 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: Float (The timestamp of the event, in nanoseconds) +# source_location: Hash (The source location of the event, containing the filepath, lineno, and label) +# +# Subscribers are responsible for encoding events to their desired format before emitting them to their +# target destination, such as a streaming platform, a log device, or an alerting service. +# +# class JSONEventSubscriber +# def emit(event) +# json_data = JSON.generate(event) +# LogExporter.export(json_data) +# end +# end +# +# class LogSubscriber +# def emit(event) +# payload = event[:payload].map { |key, value| "#{key}=#{value}" }.join(" ") +# source_location = event[:source_location] +# log = "[#{event[:name]}] #{payload} at #{source_location[:filepath]}:#{source_location[:lineno]}" +# Rails.logger.info(log) +# end +# end +# +# Note that event objects are passed through to subscribers as-is, and may need to be serialized before being encoded: +# +# class UserCreatedEvent +# def initialize(id:, name:) +# @id = id +# @name = name +# end +# +# def serialize +# { +# id: @id, +# name: @name +# } +# end +# end +# +# class LogSubscriber +# def emit(event) +# payload = event[:payload] +# json_data = JSON.generate(payload.serialize) +# LogExporter.export(json_data) +# end +# end +# +# ==== Filtered Subscriptions +# +# Subscribers can be configured with an optional filter proc to only receive a subset of events: +# +# # Only receive events with names starting with "user." +# Rails.event.subscribe(user_subscriber) { |event| event[:name].start_with?("user.") } +# +# # Only receive events with specific payload types +# Rails.event.subscribe(audit_subscriber) { |event| event[:payload].is_a?(AuditEvent) } +# +# === Debug Events +# +# You can use the +debug+ method to report an event that will only be reported if the +# event reporter is in debug mode: +# +# Rails.event.debug("my_debug_event", { foo: "bar" }) +# +# === Tags +# +# To add additional context to an event, separate from the event payload, you can add +# tags via the +tagged+ method: +# +# Rails.event.tagged("graphql") do +# Rails.event.notify("user_created", { id: 123 }) +# end +# +# # Emits event: +# # { +# # name: "user_created", +# # payload: { id: 123 }, +# # tags: { graphql: true }, +# # context: {}, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# === Context Store +# +# You may want to attach metadata to every event emitted by the reporter. While tags +# provide domain-specific context for a series of events, context is scoped to the job / request +# and should be used for metadata associated with the execution context. +# Context can be set via the +set_context+ method: +# +# Rails.event.set_context(request_id: "abcd123", user_agent: "TestAgent") +# Rails.event.notify("user_created", { id: 123 }) +# +# # Emits event: +# # { +# # name: "user_created", +# # payload: { id: 123 }, +# # tags: {}, +# # context: { request_id: "abcd123", user_agent: "TestAgent" }, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# Context is reset automatically before and after each request. +# +# A custom context store can be configured via +config.active_support.event_reporter_context_store+. +# +# # config/application.rb +# config.active_support.event_reporter_context_store = CustomContextStore +# +# class CustomContextStore +# class << self +# def context +# # Return the context. +# end +# +# def set_context(context_hash) +# # Append context_hash to the existing context store. +# end +# +# def clear +# # Delete the stored context. +# end +# end +# end +# +# The Event Reporter standardizes on symbol keys for all payload data, tags, and context store entries. +# String keys are automatically converted to symbols for consistency. +# +# Rails.event.notify("user.created", { "id" => 123 }) +# # Emits event: +# # { +# # name: "user.created", +# # payload: { id: 123 }, +# # } +# +# === Security +# +# When reporting events, Hash-based payloads are automatically filtered to remove sensitive data based on {Rails.application.filter_parameters}[https://guides.rubyonrails.org/configuring.html#config-filter-parameters]. +# +# If an {event object}[rdoc-ref:EventReporter@Event+Objects] is given instead, subscribers will need to filter sensitive data themselves, e.g. with ActiveSupport::ParameterFilter. +# +# 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: Float (The timestamp of the event, in nanoseconds) + # source_location: Hash (The source location of the event, containing the filepath, lineno, and label) + # + # An optional filter proc can be provided to only receive a subset of events: + # + # Rails.event.subscribe(subscriber) { |event| event[:name].start_with?("user.") } + # Rails.event.subscribe(subscriber) { |event| event[:payload].is_a?(UserEvent) } + # + # 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(*_arg0); end + + # pkg:gem/activesupport#lib/active_support/gzip.rb:23 + def close; end +end + +# 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 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:123 + def parameterize(string, separator: T.unsafe(nil), preserve_case: T.unsafe(nil), locale: T.unsafe(nil)); end + + # Returns the plural form of the word in the string. + # + # 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(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def empty?(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def to_a(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def to_ary(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:38 + def to_s(*_arg0, **_arg1, &_arg2); 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:33 + def load(json, options = T.unsafe(nil)); end + + # Returns the class of the error that will be raised when there is an + # error in decoding JSON. Using this method means you won't directly + # depend on the ActiveSupport's JSON implementation, in case it changes + # 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:45 + def parse_error; end + + private + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:50 + 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:241 + def encode_without_escape(value); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:237 + 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:214 + 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:214 + 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:221 + 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:221 + 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:229 + def json_encoder; end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:231 + 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:225 + 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:225 + 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:210 + 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:210 + 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:173 + def initialize(options = T.unsafe(nil)); end + + # Encode the given object into a JSON string + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:185 + 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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/rotator.rb:4 +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_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(*_arg0); 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 <=>(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 + def =~(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 + def acts_like_string?(*_arg0, **_arg1, &_arg2); 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?(*_arg0, **_arg1, &_arg2); end + + # Forward all undefined methods to the wrapped string. + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:72 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # Reverses all characters in the string. + # + # 'Café'.mb_chars.reverse.to_s # => 'éfaC' + # + # 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.matches?('render_template.action_view') # => false +# subscriber.matches?('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, *_arg1, **_arg2, &_arg3); 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(*_arg0, **_arg1, &_arg2); 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!(*_arg0); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:31 + def start(*_arg0, **_arg1, &_arg2); end +end + +# = Number Helper +# +# Provides methods for formatting numbers into currencies, percentages, +# phone numbers, and more. +# +# Example usage in a class: +# class Topic +# include ActiveSupport::NumberHelper +# +# def price +# number_to_currency(@price) +# end +# end +# +# Example usage in a module: +# require "active_support/number_helper" +# +# module NumberFormatting +# def format_price(price) +# ActiveSupport::NumberHelper.number_to_currency(price) +# end +# end +# +# 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:124 + def initialize(number, options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:130 + 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:149 + def default_format_options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:174 + def default_value(key); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:145 + def format_options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:155 + def i18n_format_options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:141 + def options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:170 + def translate_in_locale(key, **i18n_options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:166 + def translate_number_value_with_default(key, **i18n_options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:178 + def valid_bigdecimal; end + + class << self + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:120 + 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:12 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:40 + def delimiter_pattern; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:17 + 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_delimited_converter.rb:10 +ActiveSupport::NumberHelper::NumberToDelimitedConverter::DEFAULT_DELIMITER_REGEX = T.let(T.unsafe(nil), Regexp) + +# 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:47 + def country_code(code); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:43 + def delimiter; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:51 + def phone_ext(ext); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:55 + def regexp_pattern(default_pattern); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:39 + def start_with_delimiter?(number); 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?(*_arg0, **_arg1, &_arg2); 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) + +# = 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(*_arg0); 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 + + # pkg:gem/activesupport#lib/active_support/security_utils.rb:11 + 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:33 + def secure_compare(a, b); end + + class << self + # pkg:gem/activesupport#lib/active_support/security_utils.rb:25 + def fixed_length_secure_compare(a, b); end + + # pkg:gem/activesupport#lib/active_support/security_utils.rb:36 + def secure_compare(a, b); end + end +end + +# = \String Inquirer +# +# Wrapping a string in this class gives you a prettier way to test +# for equality. The value returned by Rails.env is wrapped +# in a StringInquirer object, so instead of calling this: +# +# 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, *_arg1, **_arg2, &_arg3); 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(*_arg0, **_arg1, &_arg2); 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!(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:139 + def push_tags(*_arg0, **_arg1, &_arg2); 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 + + # 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(*_arg0, **_arg1, &_arg2); 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, **_arg1, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:20 + def try!(*args, **_arg1, &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) + +# = \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(*_arg0, **_arg1, &_arg2); 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 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 + + # 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:208 + 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:109 + 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:127 + def at_beginning_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:149 + def at_beginning_of_hour; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:161 + def at_beginning_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:143 + def at_end_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:155 + def at_end_of_hour; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:167 + def at_end_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:135 + def at_midday; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:137 + def at_middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:126 + def at_midnight; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:136 + def at_noon; end + + # Returns a new DateTime representing the start of the day (0:00). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:122 + def beginning_of_day; end + + # Returns a new DateTime representing the start of the hour (hh:00:00). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:146 + def beginning_of_hour; end + + # Returns a new DateTime representing the start of the minute (hh:mm:00). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:158 + 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:140 + 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:152 + 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:164 + 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:192 + def getgm; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:178 + def getlocal(utc_offset = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:193 + def getutc; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:194 + def gmtime; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:119 + 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:170 + def localtime(utc_offset = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:133 + def midday; end + + # Returns a new DateTime representing the middle of the day (12:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:130 + def middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:125 + def midnight; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:134 + 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:116 + 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:184 + def utc; end + + # Returns +true+ if offset == 0. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:197 + def utc?; end + + # Returns the offset value in seconds. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:202 + 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 + + # 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 + + # 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 + + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:118 + def present?; 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 + + 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 +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) +class Integer < ::Numeric; 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 + + # 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 + +class NameError < ::StandardError + include ::ErrorHighlight::CoreExt + include ::DidYouMean::Correctable +end + +# 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(*_arg0, &_arg1); 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!(*_arg0, &_arg1); 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/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/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/string/output_safety.rb:13 + def html_safe?; 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/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/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/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 + + # 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 # => ["@y", "@x"] + # + # 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 ::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 +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/string/multibyte.rb:5 +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:101 + 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:142 + def truncate_words(words_count, options = T.unsafe(nil)); end + + # The reverse of +camelize+. Makes an underscored, lowercase form from the expression in the string. + # + # +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/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:298 + def +(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:308 + def -(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:338 + 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:194 + def advance(options); end + + # Returns a new Time representing the time a number of seconds ago, this is basically a wrapper around the Numeric extension + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:220 + 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:236 + def at_beginning_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:263 + def at_beginning_of_hour; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:279 + def at_beginning_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:257 + def at_end_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:273 + def at_end_of_hour; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:288 + def at_end_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:244 + def at_midday; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:246 + def at_middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:235 + def at_midnight; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:245 + def at_noon; end + + # Returns a new Time representing the start of the day (0:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:231 + def beginning_of_day; end + + # Returns a new Time representing the start of the hour (x:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:260 + def beginning_of_hour; end + + # Returns a new Time representing the start of the minute (x:xx:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:276 + 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:123 + 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:322 + def compare_with_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:337 + def compare_without_coercion(_arg0); end + + # Returns a new Time representing the end of the day, 23:59:59.999999 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:249 + def end_of_day; end + + # Returns a new Time representing the end of the hour, x:59:59.999999 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:266 + def end_of_hour; end + + # Returns a new Time representing the end of the minute, x:xx:59.999999 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:282 + def end_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:348 + def eql?(other); end + + # Layers additional behavior on Time#eql? so that ActiveSupport::TimeWithZone instances + # can be eql? to an equivalent Time + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:342 + def eql_with_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:347 + def eql_without_coercion(_arg0); end + + # Returns a formatted string of the offset from UTC, or an alternative + # string if the time zone is already UTC. + # + # 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:228 + def in(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:242 + def midday; end + + # Returns a new Time representing the middle of the day (12:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:239 + def middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:234 + def midnight; end + + # Time#- can also be used to determine the number of seconds between two Time instances. + # We're layering on additional behavior so that ActiveSupport::TimeWithZone instances + # are coerced into values that Time#- will recognize + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:313 + def minus_with_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:300 + def minus_with_duration(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:317 + def minus_without_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:307 + def minus_without_duration(_arg0); end + + # Returns a new time the specified number of days in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:356 + def next_day(days = T.unsafe(nil)); end + + # Returns a new time the specified number of months in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:366 + def next_month(months = T.unsafe(nil)); end + + # Returns a new time the specified number of years in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:376 + def next_year(years = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:243 + def noon; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:290 + def plus_with_duration(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:297 + 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:351 + 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:361 + 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:371 + 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:107 + 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:91 + 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:100 + 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:225 + 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:18 + def ===(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:60 + def at(time_or_number, *args, **_arg2); end + + # Layers additional behavior on Time.at so that ActiveSupport::TimeWithZone and DateTime + # instances can be used when called with a single argument + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:45 + def at_with_coercion(time_or_number, *args, **_arg2); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:59 + def at_without_coercion(time, subsec = T.unsafe(nil), unit = T.unsafe(nil), in: T.unsafe(nil)); end + + # Returns Time.zone.now when Time.zone or config.time_zone are set, otherwise just returns Time.now. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:39 + 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:24 + 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:34 + 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:69 + 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:14 +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.2.rbi b/sorbet/rbi/gems/ast@2.4.3.rbi similarity index 86% rename from sorbet/rbi/gems/ast@2.4.2.rbi rename to sorbet/rbi/gems/ast@2.4.3.rbi index 3fc4495..e946b00 100644 --- a/sorbet/rbi/gems/ast@2.4.2.rbi +++ b/sorbet/rbi/gems/ast@2.4.3.rbi @@ -4,6 +4,7 @@ # This is an autogenerated file for types exported from the `ast` gem. # Please instead update this file by running `bin/tapioca gem ast`. + # {AST} is a library for manipulating abstract syntax trees. # # It embraces immutability; each AST node is inherently frozen at @@ -16,7 +17,7 @@ # See also {AST::Node}, {AST::Processor::Mixin} and {AST::Sexp} for # additional recommendations and design patterns. # -# source://ast//lib/ast.rb#13 +# pkg:gem/ast#lib/ast.rb:13 module AST; end # Node is an immutable class, instances of which represent abstract @@ -55,7 +56,7 @@ module AST; end # temporary node type requires making globally visible changes to # the codebase. # -# source://ast//lib/ast/node.rb#40 +# pkg:gem/ast#lib/ast/node.rb:40 class AST::Node # Constructs a new instance of Node. # @@ -67,23 +68,13 @@ class AST::Node # # The `properties` hash is passed to {#assign_properties}. # - # @return [Node] a new instance of Node - # - # source://ast//lib/ast/node.rb#72 + # pkg:gem/ast#lib/ast/node.rb:72 def initialize(type, children = T.unsafe(nil), properties = T.unsafe(nil)); end - # Concatenates `array` with `children` and returns the resulting node. - # - # @return [AST::Node] - # - # source://ast//lib/ast/node.rb#168 + # pkg:gem/ast#lib/ast/node.rb:172 def +(array); end - # Appends `element` to `children` and returns the resulting node. - # - # @return [AST::Node] - # - # source://ast//lib/ast/node.rb#177 + # pkg:gem/ast#lib/ast/node.rb:181 def <<(element); end # Compares `self` to `other`, possibly converting with `to_ast`. Only @@ -91,14 +82,14 @@ class AST::Node # # @return [Boolean] # - # source://ast//lib/ast/node.rb#153 + # pkg:gem/ast#lib/ast/node.rb:153 def ==(other); end # Appends `element` to `children` and returns the resulting node. # # @return [AST::Node] # - # source://ast//lib/ast/node.rb#177 + # pkg:gem/ast#lib/ast/node.rb:177 def append(element); end # Returns the children of this node. @@ -113,23 +104,17 @@ class AST::Node # # @return [Array] # - # source://ast//lib/ast/node.rb#56 + # pkg:gem/ast#lib/ast/node.rb:56 def children; 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 - # - # source://ast//lib/ast/node.rb#115 + # pkg:gem/ast#lib/ast/node.rb:118 def clone; end # Concatenates `array` with `children` and returns the resulting node. # # @return [AST::Node] # - # source://ast//lib/ast/node.rb#168 + # pkg:gem/ast#lib/ast/node.rb:168 def concat(array); end # Enables matching for Node, where type is the first element @@ -137,7 +122,7 @@ class AST::Node # # @return [Array] # - # source://ast//lib/ast/node.rb#253 + # pkg:gem/ast#lib/ast/node.rb:253 def deconstruct; end # Nodes are already frozen, so there is no harm in returning the @@ -146,67 +131,48 @@ class AST::Node # # @return self # - # source://ast//lib/ast/node.rb#115 + # pkg:gem/ast#lib/ast/node.rb:115 def dup; end # Test if other object is equal to - # - # @param other [Object] + # @param [Object] other # @return [Boolean] # - # source://ast//lib/ast/node.rb#85 + # pkg:gem/ast#lib/ast/node.rb:85 def eql?(other); end # Returns the precomputed hash value for this node + # @return [Integer] # - # @return [Fixnum] - # - # source://ast//lib/ast/node.rb#61 + # 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 indent [Integer] Base indentation level. + # @param [Integer] indent Base indentation level. # @return [String] # - # source://ast//lib/ast/node.rb#211 + # pkg:gem/ast#lib/ast/node.rb:211 def inspect(indent = T.unsafe(nil)); 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] - # - # source://ast//lib/ast/node.rb#56 + # pkg:gem/ast#lib/ast/node.rb:57 def to_a; end # @return [AST::Node] self # - # source://ast//lib/ast/node.rb#229 + # pkg:gem/ast#lib/ast/node.rb:229 def to_ast; end - # Converts `self` to a pretty-printed s-expression. - # - # @param indent [Integer] Base indentation level. - # @return [String] - # - # source://ast//lib/ast/node.rb#187 + # 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 indent [Integer] Base indentation level. + # @param [Integer] indent Base indentation level. # @return [String] # - # source://ast//lib/ast/node.rb#187 + # 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, @@ -214,14 +180,13 @@ class AST::Node # # @return [Array] # - # source://ast//lib/ast/node.rb#237 + # pkg:gem/ast#lib/ast/node.rb:237 def to_sexp_array; end # Returns the type of this node. - # # @return [Symbol] # - # source://ast//lib/ast/node.rb#43 + # pkg:gem/ast#lib/ast/node.rb:43 def type; end # Returns a new instance of Node where non-nil arguments replace the @@ -233,12 +198,12 @@ class AST::Node # # If the resulting node would be identical to `self`, does nothing. # - # @param type [Symbol, nil] - # @param children [Array, nil] - # @param properties [Hash, nil] + # @param [Symbol, nil] type + # @param [Array, nil] children + # @param [Hash, nil] properties # @return [AST::Node] # - # source://ast//lib/ast/node.rb#133 + # pkg:gem/ast#lib/ast/node.rb:133 def updated(type = T.unsafe(nil), children = T.unsafe(nil), properties = T.unsafe(nil)); end protected @@ -251,7 +216,7 @@ class AST::Node # # @return [nil] # - # source://ast//lib/ast/node.rb#98 + # pkg:gem/ast#lib/ast/node.rb:98 def assign_properties(properties); end # Returns `@type` with all underscores replaced by dashes. This allows @@ -260,11 +225,12 @@ class AST::Node # # @return [String] # - # source://ast//lib/ast/node.rb#264 + # 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 @@ -275,7 +241,7 @@ end # # @deprecated Use {AST::Processor::Mixin} instead. # -# source://ast//lib/ast/processor.rb#8 +# pkg:gem/ast#lib/ast/processor.rb:8 class AST::Processor include ::AST::Processor::Mixin end @@ -518,14 +484,14 @@ end # use some partial evaluation before! The possibilites are # endless. Have fun. # -# source://ast//lib/ast/processor/mixin.rb#240 +# pkg:gem/ast#lib/ast/processor/mixin.rb:240 module AST::Processor::Mixin # Default handler. Does nothing. # - # @param node [AST::Node] + # @param [AST::Node] node # @return [AST::Node, nil] # - # source://ast//lib/ast/processor/mixin.rb#284 + # 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 @@ -536,19 +502,19 @@ module AST::Processor::Mixin # If the handler returns `nil`, `node` is returned; otherwise, # the return value of the handler is passed along. # - # @param node [AST::Node, nil] + # @param [AST::Node, nil] node # @return [AST::Node, nil] # - # source://ast//lib/ast/processor/mixin.rb#251 + # 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 nodes [Array] + # @param [Array] nodes # @return [Array] # - # source://ast//lib/ast/processor/mixin.rb#274 + # pkg:gem/ast#lib/ast/processor/mixin.rb:274 def process_all(nodes); end end @@ -556,8 +522,8 @@ end # to define deeply nested ASTs from Ruby code, for example, in # tests. It should be used like this: # -# describe YourLanguage::AST do -# include Sexp +# describe YourLanguage do +# include ::AST::Sexp # # it "should correctly parse expressions" do # YourLanguage.parse("1 + 2 * 3").should == @@ -571,7 +537,7 @@ end # # This way the amount of boilerplate code is greatly reduced. # -# source://ast//lib/ast/sexp.rb#20 +# 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 @@ -579,6 +545,6 @@ module AST::Sexp # This would not pose a problem with comparisons, as {Node#==} # ignores metadata. # - # source://ast//lib/ast/sexp.rb#26 + # pkg:gem/ast#lib/ast/sexp.rb:26 def s(type, *children); end end 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_ownership@1.29.2.rbi b/sorbet/rbi/gems/code_ownership@1.29.2.rbi deleted file mode 100644 index c2bbe34..0000000 --- a/sorbet/rbi/gems/code_ownership@1.29.2.rbi +++ /dev/null @@ -1,525 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `code_ownership` gem. -# Please instead update this file by running `bin/tapioca gem code_ownership`. - -# source://code_ownership//lib/code_ownership/cli.rb#7 -module CodeOwnership - extend ::CodeOwnership - - requires_ancestor { Kernel } - - # Given a backtrace from either `Exception#backtrace` or `caller`, find the - # first line that corresponds to a file with assigned ownership - # - # source://code_ownership//lib/code_ownership.rb#95 - sig do - params( - backtrace: T.nilable(T::Array[::String]), - excluded_teams: T::Array[::CodeTeams::Team] - ).returns(T.nilable(::CodeTeams::Team)) - end - def for_backtrace(backtrace, excluded_teams: T.unsafe(nil)); end - - # source://code_ownership//lib/code_ownership.rb#127 - sig { params(klass: T.nilable(T.any(::Class, ::Module))).returns(T.nilable(::CodeTeams::Team)) } - def for_class(klass); end - - # source://code_ownership//lib/code_ownership.rb#21 - sig { params(file: ::String).returns(T.nilable(::CodeTeams::Team)) } - def for_file(file); end - - # source://code_ownership//lib/code_ownership.rb#144 - sig { params(package: ::Packs::Pack).returns(T.nilable(::CodeTeams::Team)) } - def for_package(package); end - - # source://code_ownership//lib/code_ownership.rb#39 - sig { params(team: T.any(::CodeTeams::Team, ::String)).returns(::String) } - def for_team(team); end - - # source://code_ownership//lib/code_ownership.rb#83 - sig { params(files: T::Array[::String], autocorrect: T::Boolean, stage_changes: T::Boolean).void } - def validate!(files: T.unsafe(nil), autocorrect: T.unsafe(nil), stage_changes: T.unsafe(nil)); end - - class << self - # Generally, you should not ever need to do this, because once your ruby process loads, cached content should not change. - # Namely, the set of files, packages, and directories which are tracked for ownership should not change. - # The primary reason this is helpful is for clients of CodeOwnership who want to test their code, and each test context - # has different ownership and tracked files. - # - # source://code_ownership//lib/code_ownership.rb#153 - sig { void } - def bust_caches!; end - - # source://code_ownership//lib/code_ownership.rb#72 - sig { params(filename: ::String).void } - def remove_file_annotation!(filename); end - end -end - -# source://code_ownership//lib/code_ownership/cli.rb#8 -class CodeOwnership::Cli - class << self - # For now, this just returns team ownership - # Later, this could also return code ownership errors about that file. - # - # source://code_ownership//lib/code_ownership/cli.rb#76 - def for_file(argv); end - - # source://code_ownership//lib/code_ownership/cli.rb#123 - def for_team(argv); end - - # source://code_ownership//lib/code_ownership/cli.rb#9 - def run!(argv); end - - private - - # source://code_ownership//lib/code_ownership/cli.rb#33 - def validate!(argv); end - end -end - -# source://code_ownership//lib/code_ownership.rb#68 -class CodeOwnership::InvalidCodeOwnershipConfigurationError < ::StandardError; end - -# source://code_ownership//lib/code_ownership/private/configuration.rb#4 -module CodeOwnership::Private - class << self - # source://code_ownership//lib/code_ownership/private.rb#30 - sig { void } - def bust_caches!; end - - # source://code_ownership//lib/code_ownership/private.rb#24 - sig { returns(::CodeOwnership::Private::Configuration) } - def configuration; end - - # source://code_ownership//lib/code_ownership/private.rb#69 - sig { returns(::CodeOwnership::Private::OwnershipMappers::FileAnnotations) } - def file_annotations_mapper; end - - # source://code_ownership//lib/code_ownership/private.rb#106 - sig { params(files: T::Array[::String]).returns(T::Hash[::String, T::Array[::String]]) } - def files_by_mapper(files); end - - # source://code_ownership//lib/code_ownership/private.rb#96 - sig { params(team_name: ::String, location_of_reference: ::String).returns(::CodeTeams::Team) } - def find_team!(team_name, location_of_reference); end - - # source://code_ownership//lib/code_ownership/private.rb#59 - sig { returns(T::Array[::CodeOwnership::Private::OwnershipMappers::Interface]) } - def mappers; end - - # Returns a string version of the relative path to a Rails constant, - # or nil if it can't find something - # - # source://code_ownership//lib/code_ownership/private.rb#77 - sig { params(klass: T.nilable(T.any(::Class, ::Module))).returns(T.nilable(::String)) } - def path_from_klass(klass); end - - # The output of this function is string pathnames relative to the root. - # - # source://code_ownership//lib/code_ownership/private.rb#90 - sig { returns(T::Array[::String]) } - def tracked_files; end - - # source://code_ownership//lib/code_ownership/private.rb#37 - sig { params(files: T::Array[::String], autocorrect: T::Boolean, stage_changes: T::Boolean).void } - def validate!(files:, autocorrect: T.unsafe(nil), stage_changes: T.unsafe(nil)); end - end -end - -# source://code_ownership//lib/code_ownership/private/configuration.rb#5 -class CodeOwnership::Private::Configuration < ::T::Struct - const :js_package_paths, T::Array[::String] - const :owned_globs, T::Array[::String] - const :skip_codeowners_validation, T::Boolean - const :unowned_globs, T::Array[::String] - - class << self - # source://code_ownership//lib/code_ownership/private/configuration.rb#15 - sig { returns(::CodeOwnership::Private::Configuration) } - def fetch; end - - # source://sorbet-runtime/0.5.9924/lib/types/struct.rb#13 - def inherited(s); end - - # source://code_ownership//lib/code_ownership/private/configuration.rb#27 - sig { params(config_hash: T::Hash[T.untyped, T.untyped]).returns(T::Array[::String]) } - def js_package_paths(config_hash); end - end -end - -# source://code_ownership//lib/code_ownership/private/configuration.rb#7 -CodeOwnership::Private::Configuration::DEFAULT_JS_PACKAGE_PATHS = T.let(T.unsafe(nil), Array) - -# source://code_ownership//lib/code_ownership/private/ownership_mappers/interface.rb#7 -module CodeOwnership::Private::OwnershipMappers; end - -# Calculate, cache, and return a mapping of file names (relative to the root -# of the repository) to team name. -# -# Example: -# -# { -# 'app/models/company.rb' => Team.find('Setup & Onboarding'), -# ... -# } -# -# source://code_ownership//lib/code_ownership/private/ownership_mappers/file_annotations.rb#17 -class CodeOwnership::Private::OwnershipMappers::FileAnnotations - include ::CodeOwnership::Private::OwnershipMappers::Interface - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/file_annotations.rb#113 - sig { override.void } - def bust_caches!; end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/file_annotations.rb#102 - sig { override.returns(T::Hash[::String, T.nilable(::CodeTeams::Team)]) } - def codeowners_lines_to_owners; end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/file_annotations.rb#108 - sig { override.returns(::String) } - def description; end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/file_annotations.rb#50 - sig { params(filename: ::String).returns(T.nilable(::CodeTeams::Team)) } - def file_annotation_based_owner(filename); end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/file_annotations.rb#29 - sig { override.params(file: ::String).returns(T.nilable(::CodeTeams::Team)) } - def map_file_to_owner(file); end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/file_annotations.rb#38 - sig { override.params(files: T::Array[::String]).returns(T::Hash[::String, T.nilable(::CodeTeams::Team)]) } - def map_files_to_owners(files); end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/file_annotations.rb#86 - sig { params(filename: ::String).void } - def remove_file_annotation!(filename); end -end - -# source://code_ownership//lib/code_ownership/private/ownership_mappers/file_annotations.rb#23 -CodeOwnership::Private::OwnershipMappers::FileAnnotations::TEAM_PATTERN = T.let(T.unsafe(nil), Regexp) - -# @abstract Subclasses must implement the `abstract` methods below. -# -# source://code_ownership//lib/code_ownership/private/ownership_mappers/interface.rb#8 -module CodeOwnership::Private::OwnershipMappers::Interface - interface! - - # @abstract - # - # source://code_ownership//lib/code_ownership/private/ownership_mappers/interface.rb#45 - sig { abstract.void } - def bust_caches!; end - - # @abstract - # - # source://code_ownership//lib/code_ownership/private/ownership_mappers/interface.rb#37 - sig { abstract.returns(T::Hash[::String, T.nilable(::CodeTeams::Team)]) } - def codeowners_lines_to_owners; end - - # @abstract - # - # source://code_ownership//lib/code_ownership/private/ownership_mappers/interface.rb#41 - sig { abstract.returns(::String) } - def description; end - - # This should be fast when run with ONE file - # - # @abstract - # - # source://code_ownership//lib/code_ownership/private/ownership_mappers/interface.rb#21 - sig { abstract.params(file: ::String).returns(T.nilable(::CodeTeams::Team)) } - def map_file_to_owner(file); end - - # This should be fast when run with MANY files - # - # @abstract - # - # source://code_ownership//lib/code_ownership/private/ownership_mappers/interface.rb#31 - sig { abstract.params(files: T::Array[::String]).returns(T::Hash[::String, T.nilable(::CodeTeams::Team)]) } - def map_files_to_owners(files); end -end - -# source://code_ownership//lib/code_ownership/private/ownership_mappers/js_package_ownership.rb#8 -class CodeOwnership::Private::OwnershipMappers::JsPackageOwnership - include ::CodeOwnership::Private::OwnershipMappers::Interface - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/js_package_ownership.rb#80 - sig { override.void } - def bust_caches!; end - - # Package ownership ignores the passed in files when generating code owners lines. - # This is because Package ownership knows that the fastest way to find code owners for package based ownership - # is to simply iterate over the packages and grab the owner, rather than iterating over each file just to get what package it is in - # In theory this means that we may generate code owners lines that cover files that are not in the passed in argument, - # but in practice this is not of consequence because in reality we never really want to generate code owners for only a - # subset of files, but rather we want code ownership for all files. - # - # source://code_ownership//lib/code_ownership/private/ownership_mappers/js_package_ownership.rb#54 - sig { override.returns(T::Hash[::String, T.nilable(::CodeTeams::Team)]) } - def codeowners_lines_to_owners; end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/js_package_ownership.rb#64 - sig { override.returns(::String) } - def description; end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/js_package_ownership.rb#18 - sig { override.params(file: ::String).returns(T.nilable(::CodeTeams::Team)) } - def map_file_to_owner(file); end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/js_package_ownership.rb#31 - sig { override.params(files: T::Array[::String]).returns(T::Hash[::String, T.nilable(::CodeTeams::Team)]) } - def map_files_to_owners(files); end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/js_package_ownership.rb#69 - sig { params(package: ::CodeOwnership::Private::ParseJsPackages::Package).returns(T.nilable(::CodeTeams::Team)) } - def owner_for_package(package); end - - private - - # takes a file and finds the relevant `package.json` file by walking up the directory - # structure. Example, given `packages/a/b/c.rb`, this looks for `packages/a/b/package.json`, `packages/a/package.json`, - # `packages/package.json`, and `package.json` in that order, stopping at the first file to actually exist. - # We do additional caching so that we don't have to check for file existence every time - # - # source://code_ownership//lib/code_ownership/private/ownership_mappers/js_package_ownership.rb#91 - sig { params(file: ::String).returns(T.nilable(::CodeOwnership::Private::ParseJsPackages::Package)) } - def map_file_to_relevant_package(file); end -end - -# source://code_ownership//lib/code_ownership/private/ownership_mappers/package_ownership.rb#8 -class CodeOwnership::Private::OwnershipMappers::PackageOwnership - include ::CodeOwnership::Private::OwnershipMappers::Interface - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/package_ownership.rb#80 - sig { override.void } - def bust_caches!; end - - # Package ownership ignores the passed in files when generating code owners lines. - # This is because Package ownership knows that the fastest way to find code owners for package based ownership - # is to simply iterate over the packages and grab the owner, rather than iterating over each file just to get what package it is in - # In theory this means that we may generate code owners lines that cover files that are not in the passed in argument, - # but in practice this is not of consequence because in reality we never really want to generate code owners for only a - # subset of files, but rather we want code ownership for all files. - # - # source://code_ownership//lib/code_ownership/private/ownership_mappers/package_ownership.rb#54 - sig { override.returns(T::Hash[::String, T.nilable(::CodeTeams::Team)]) } - def codeowners_lines_to_owners; end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/package_ownership.rb#64 - sig { override.returns(::String) } - def description; end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/package_ownership.rb#18 - sig { override.params(file: ::String).returns(T.nilable(::CodeTeams::Team)) } - def map_file_to_owner(file); end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/package_ownership.rb#31 - sig { override.params(files: T::Array[::String]).returns(T::Hash[::String, T.nilable(::CodeTeams::Team)]) } - def map_files_to_owners(files); end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/package_ownership.rb#69 - sig { params(package: ::Packs::Pack).returns(T.nilable(::CodeTeams::Team)) } - def owner_for_package(package); end -end - -# source://code_ownership//lib/code_ownership/private/ownership_mappers/team_globs.rb#8 -class CodeOwnership::Private::OwnershipMappers::TeamGlobs - include ::CodeOwnership::Private::OwnershipMappers::Interface - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/team_globs.rb#56 - sig { override.void } - def bust_caches!; end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/team_globs.rb#45 - sig { override.returns(T::Hash[::String, T.nilable(::CodeTeams::Team)]) } - def codeowners_lines_to_owners; end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/team_globs.rb#62 - sig { override.returns(::String) } - def description; end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/team_globs.rb#38 - sig { override.params(file: ::String).returns(T.nilable(::CodeTeams::Team)) } - def map_file_to_owner(file); end - - # source://code_ownership//lib/code_ownership/private/ownership_mappers/team_globs.rb#22 - sig { override.params(files: T::Array[::String]).returns(T::Hash[::String, T.nilable(::CodeTeams::Team)]) } - def map_files_to_owners(files); end -end - -# Modeled off of ParsePackwerk -# -# source://code_ownership//lib/code_ownership/private/parse_js_packages.rb#8 -module CodeOwnership::Private::ParseJsPackages - class << self - # source://code_ownership//lib/code_ownership/private/parse_js_packages.rb#57 - sig { returns(T::Array[::CodeOwnership::Private::ParseJsPackages::Package]) } - def all; end - end -end - -# source://code_ownership//lib/code_ownership/private/parse_js_packages.rb#13 -CodeOwnership::Private::ParseJsPackages::METADATA = T.let(T.unsafe(nil), String) - -# source://code_ownership//lib/code_ownership/private/parse_js_packages.rb#12 -CodeOwnership::Private::ParseJsPackages::PACKAGE_JSON_NAME = T.let(T.unsafe(nil), String) - -# source://code_ownership//lib/code_ownership/private/parse_js_packages.rb#15 -class CodeOwnership::Private::ParseJsPackages::Package < ::T::Struct - const :metadata, T::Hash[::String, T.untyped] - const :name, ::String - - # source://code_ownership//lib/code_ownership/private/parse_js_packages.rb#48 - sig { returns(::Pathname) } - def directory; end - - class << self - # source://code_ownership//lib/code_ownership/private/parse_js_packages.rb#22 - sig { params(pathname: ::Pathname).returns(::CodeOwnership::Private::ParseJsPackages::Package) } - def from(pathname); end - - # source://sorbet-runtime/0.5.9924/lib/types/struct.rb#13 - def inherited(s); end - end -end - -# source://code_ownership//lib/code_ownership/private/parse_js_packages.rb#11 -CodeOwnership::Private::ParseJsPackages::ROOT_PACKAGE_NAME = T.let(T.unsafe(nil), String) - -# source://code_ownership//lib/code_ownership/private/team_plugins/ownership.rb#5 -module CodeOwnership::Private::TeamPlugins; end - -# source://code_ownership//lib/code_ownership/private/team_plugins/github.rb#6 -class CodeOwnership::Private::TeamPlugins::Github < ::CodeTeams::Plugin - # source://code_ownership//lib/code_ownership/private/team_plugins/github.rb#13 - sig { returns(::CodeOwnership::Private::TeamPlugins::Github::GithubStruct) } - def github; end -end - -# source://code_ownership//lib/code_ownership/private/team_plugins/github.rb#10 -class CodeOwnership::Private::TeamPlugins::Github::GithubStruct < ::Struct - # Returns the value of attribute do_not_add_to_codeowners_file - # - # @return [Object] the current value of do_not_add_to_codeowners_file - def do_not_add_to_codeowners_file; end - - # Sets the attribute do_not_add_to_codeowners_file - # - # @param value [Object] the value to set the attribute do_not_add_to_codeowners_file to. - # @return [Object] the newly set value - # - # source://code_ownership//lib/code_ownership/private/team_plugins/github.rb#10 - def do_not_add_to_codeowners_file=(_); end - - # Returns the value of attribute team - # - # @return [Object] the current value of team - def team; end - - # Sets the attribute team - # - # @param value [Object] the value to set the attribute team to. - # @return [Object] the newly set value - # - # source://code_ownership//lib/code_ownership/private/team_plugins/github.rb#10 - def team=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def members; end - def new(*_arg0); end - end -end - -# source://code_ownership//lib/code_ownership/private/team_plugins/ownership.rb#6 -class CodeOwnership::Private::TeamPlugins::Ownership < ::CodeTeams::Plugin - # source://code_ownership//lib/code_ownership/private/team_plugins/ownership.rb#11 - sig { returns(T::Array[::String]) } - def owned_globs; end -end - -# source://code_ownership//lib/code_ownership/private/validations/interface.rb#5 -module CodeOwnership::Private::Validations; end - -# source://code_ownership//lib/code_ownership/private/validations/files_have_owners.rb#6 -class CodeOwnership::Private::Validations::FilesHaveOwners - include ::CodeOwnership::Private::Validations::Interface - - # source://code_ownership//lib/code_ownership/private/validations/files_have_owners.rb#12 - sig do - override - .params( - files: T::Array[::String], - autocorrect: T::Boolean, - stage_changes: T::Boolean - ).returns(T::Array[::String]) - end - def validation_errors(files:, autocorrect: T.unsafe(nil), stage_changes: T.unsafe(nil)); end -end - -# source://code_ownership//lib/code_ownership/private/validations/files_have_unique_owners.rb#6 -class CodeOwnership::Private::Validations::FilesHaveUniqueOwners - include ::CodeOwnership::Private::Validations::Interface - - # source://code_ownership//lib/code_ownership/private/validations/files_have_unique_owners.rb#12 - sig do - override - .params( - files: T::Array[::String], - autocorrect: T::Boolean, - stage_changes: T::Boolean - ).returns(T::Array[::String]) - end - def validation_errors(files:, autocorrect: T.unsafe(nil), stage_changes: T.unsafe(nil)); end -end - -# source://code_ownership//lib/code_ownership/private/validations/github_codeowners_up_to_date.rb#6 -class CodeOwnership::Private::Validations::GithubCodeownersUpToDate - include ::CodeOwnership::Private::Validations::Interface - - # source://code_ownership//lib/code_ownership/private/validations/github_codeowners_up_to_date.rb#12 - sig do - override - .params( - files: T::Array[::String], - autocorrect: T::Boolean, - stage_changes: T::Boolean - ).returns(T::Array[::String]) - end - def validation_errors(files:, autocorrect: T.unsafe(nil), stage_changes: T.unsafe(nil)); end - - private - - # Generate the contents of a CODEOWNERS file that GitHub can use to - # automatically assign reviewers - # https://help.github.com/articles/about-codeowners/ - # - # source://code_ownership//lib/code_ownership/private/validations/github_codeowners_up_to_date.rb#100 - sig { returns(T::Array[::String]) } - def codeowners_file_lines; end -end - -# @abstract Subclasses must implement the `abstract` methods below. -# -# source://code_ownership//lib/code_ownership/private/validations/interface.rb#6 -module CodeOwnership::Private::Validations::Interface - interface! - - # @abstract - # - # source://code_ownership//lib/code_ownership/private/validations/interface.rb#13 - sig do - abstract - .params( - files: T::Array[::String], - autocorrect: T::Boolean, - stage_changes: T::Boolean - ).returns(T::Array[::String]) - end - def validation_errors(files:, autocorrect: T.unsafe(nil), stage_changes: T.unsafe(nil)); end -end diff --git a/sorbet/rbi/gems/code_ownership@2.1.3.rbi b/sorbet/rbi/gems/code_ownership@2.1.3.rbi new file mode 100644 index 0000000..cb142c1 --- /dev/null +++ b/sorbet/rbi/gems/code_ownership@2.1.3.rbi @@ -0,0 +1,462 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `code_ownership` gem. +# Please instead update this file by running `bin/tapioca gem code_ownership`. + + +# pkg:gem/code_ownership#lib/code_ownership/version.rb:4 +module CodeOwnership + class << self + # Generally, you should not ever need to do this, because once your ruby process loads, cached content should not change. + # Namely, the set of files, packages, and directories which are tracked for ownership should not change. + # The primary reason this is helpful is for clients of CodeOwnership who want to test their code, and each test context + # has different ownership and tracked files. + # + # pkg:gem/code_ownership#lib/code_ownership.rb:316 + sig { void } + def bust_caches!; end + + # Given a backtrace from either `Exception#backtrace` or `caller`, find the + # first owned file in it, useful for figuring out which file is being blamed. + # + # pkg:gem/code_ownership#lib/code_ownership.rb:297 + sig do + params( + backtrace: T.nilable(T::Array[::String]), + excluded_teams: T::Array[::CodeTeams::Team] + ).returns(T.nilable([::CodeTeams::Team, ::String])) + end + def first_owned_file_for_backtrace(backtrace, excluded_teams: T.unsafe(nil)); end + + # Given a backtrace from either `Exception#backtrace` or `caller`, find the + # first line that corresponds to a file with assigned ownership + # + # pkg:gem/code_ownership#lib/code_ownership.rb:290 + sig do + params( + backtrace: T.nilable(T::Array[::String]), + excluded_teams: T::Array[::CodeTeams::Team] + ).returns(T.nilable(::CodeTeams::Team)) + end + def for_backtrace(backtrace, excluded_teams: T.unsafe(nil)); end + + # pkg:gem/code_ownership#lib/code_ownership.rb:302 + sig do + params( + klass: T.nilable(T.any(T::Class[T.anything], T::Module[T.anything])) + ).returns(T.nilable(::CodeTeams::Team)) + end + def for_class(klass); end + + # Returns the owning team for a given file path. + # + # @param file [String] The path to the file to find ownership for. Can be relative or absolute. + # @param from_codeowners [Boolean] (default: true) When true, uses CODEOWNERS file to determine ownership. + # When false, uses alternative team finding strategies (e.g., package ownership). + # from_codeowners true is faster because it simply matches the provided file to the generate CODEOWNERS file. This is a safe option when you can trust the CODEOWNERS file to be up to date. + # @param allow_raise [Boolean] (default: false) When true, raises an exception if ownership cannot be determined. + # When false, returns nil for files without ownership. + # + # @return [CodeTeams::Team, nil] The team that owns the file, or nil if no owner is found + # (unless allow_raise is true, in which case an exception is raised). + # + # @example Find owner for a file using CODEOWNERS + # team = CodeOwnership.for_file('app/models/user.rb') + # # => # + # + # @example Find owner without using CODEOWNERS + # team = CodeOwnership.for_file('app/models/user.rb', from_codeowners: false) + # # => # + # + # @example Raise if no owner is found + # team = CodeOwnership.for_file('unknown_file.rb', allow_raise: true) + # # => raises exception if no owner found + # + # pkg:gem/code_ownership#lib/code_ownership.rb:63 + sig do + params( + file: ::String, + from_codeowners: T::Boolean, + allow_raise: T::Boolean + ).returns(T.nilable(::CodeTeams::Team)) + end + def for_file(file, from_codeowners: T.unsafe(nil), allow_raise: T.unsafe(nil)); end + + # Returns detailed ownership information for a given file path. + # + # This method provides verbose ownership details including the team name, + # team configuration file path, and the reasons/sources for ownership assignment. + # It's particularly useful for debugging ownership assignments and understanding + # why a file is owned by a specific team. + # + # @param file [String] The path to the file to find ownership for. Can be relative or absolute. + # + # @return [T::Hash[Symbol, String], nil] A hash containing detailed ownership information, + # or nil if no owner is found. + # + # The returned hash contains the following keys when an owner is found: + # - :team_name [String] - The name of the owning team + # - :team_config_yml [String] - Path to the team's configuration YAML file + # - :reasons [Array] - List of reasons/sources explaining why this team owns the file + # (e.g., "CODEOWNERS pattern: /app/models/**", "Package ownership") + # + # @example Get verbose ownership details + # details = CodeOwnership.for_file_verbose('app/models/user.rb') + # # => { + # # team_name: "platform", + # # team_config_yml: "config/teams/platform.yml", + # # reasons: ["Matched pattern '/app/models/**' in CODEOWNERS"] + # # } + # + # @example Handle unowned files + # details = CodeOwnership.for_file_verbose('unowned_file.txt') + # # => nil + # + # @note This method is primarily used by the CLI tool when the --verbose flag is provided, + # allowing users to understand the ownership assignment logic. + # + # @note Unlike `for_file`, this method always uses the CODEOWNERS file and other ownership + # sources to determine ownership, providing complete context about the ownership decision. + # + # @see #for_file for a simpler ownership lookup that returns just the team + # @see CLI#for_file for the command-line interface that uses this method + # + # pkg:gem/code_ownership#lib/code_ownership.rb:158 + sig { params(file: ::String).returns(T.nilable(T::Hash[::Symbol, ::String])) } + def for_file_verbose(file); end + + # pkg:gem/code_ownership#lib/code_ownership.rb:307 + sig { params(package: ::Packs::Pack).returns(T.nilable(::CodeTeams::Team)) } + def for_package(package); end + + # pkg:gem/code_ownership#lib/code_ownership.rb:163 + sig { params(team: T.any(::CodeTeams::Team, ::String)).returns(T::Array[::String]) } + def for_team(team); end + + # Removes the file annotation (e.g., "# @team TeamName") from a file. + # + # This method removes the ownership annotation from the first line of a file, + # which is typically used to declare team ownership at the file level. + # The annotation can be in the form of: + # - Ruby comments: # @team TeamName + # - JavaScript/TypeScript comments: // @team TeamName + # - YAML comments: -# @team TeamName + # + # If the file does not have an annotation or the annotation doesn't match a valid team, + # this method does nothing. + # + # @param filename [String] The path to the file from which to remove the annotation. + # Can be relative or absolute. + # + # @return [void] + # + # @example Remove annotation from a Ruby file + # # Before: File contains "# @team Platform\nclass User; end" + # CodeOwnership.remove_file_annotation!('app/models/user.rb') + # # After: File contains "class User; end" + # + # @example Remove annotation from a JavaScript file + # # Before: File contains "// @team Frontend\nexport default function() {}" + # CodeOwnership.remove_file_annotation!('app/javascript/component.js') + # # After: File contains "export default function() {}" + # + # @note This method modifies the file in place. + # @note Leading newlines after the annotation are also removed to maintain clean formatting. + # + # pkg:gem/code_ownership#lib/code_ownership.rb:267 + sig { params(filename: ::String).void } + def remove_file_annotation!(filename); end + + # Returns the owning teams for multiple file paths using the CODEOWNERS file. + # + # This method efficiently determines ownership for multiple files in a single operation + # by leveraging the generated CODEOWNERS file. It's more performant than calling + # `for_file` multiple times when you need to check ownership for many files. + # + # @param files [Array] An array of file paths to find ownership for. + # Paths can be relative to the project root or absolute. + # @param allow_raise [Boolean] (default: false) When true, raises an exception if a team + # name in CODEOWNERS cannot be resolved to an actual team. + # When false, returns nil for files with unresolvable teams. + # + # @return [T::Hash[String, T.nilable(CodeTeams::Team)]] A hash mapping each file path to its + # owning team. Files without ownership + # or with unresolvable teams will map to nil. + # + # @example Get owners for multiple files + # files = ['app/models/user.rb', 'app/controllers/users_controller.rb', 'config/routes.rb'] + # owners = CodeOwnership.teams_for_files_from_codeowners(files) + # # => { + # # 'app/models/user.rb' => #, + # # 'app/controllers/users_controller.rb' => #, + # # 'config/routes.rb' => # + # # } + # + # @example Handle files without owners + # files = ['owned_file.rb', 'unowned_file.txt'] + # owners = CodeOwnership.teams_for_files_from_codeowners(files) + # # => { + # # 'owned_file.rb' => #, + # # 'unowned_file.txt' => nil + # # } + # + # @note This method uses caching internally for performance. The cache is populated + # as files are processed and reused for subsequent lookups. + # + # @note This method relies on the CODEOWNERS file being up-to-date. Run + # `CodeOwnership.validate!` to ensure the CODEOWNERS file is current. + # + # @see #for_file for single file ownership lookup + # @see #validate! for ensuring CODEOWNERS file is up-to-date + # + # pkg:gem/code_ownership#lib/code_ownership.rb:114 + sig do + params( + files: T::Array[::String], + allow_raise: T::Boolean + ).returns(T::Hash[::String, T.nilable(::CodeTeams::Team)]) + end + def teams_for_files_from_codeowners(files, allow_raise: T.unsafe(nil)); end + + # Validates code ownership configuration and optionally corrects issues. + # + # This method performs comprehensive validation of the code ownership setup, ensuring: + # 1. Only one ownership mechanism is defined per file (no conflicts between annotations, packages, or globs) + # 2. All referenced teams are valid (exist in CodeTeams configuration) + # 3. All files have ownership (unless explicitly listed in unowned_globs) + # 4. The .github/CODEOWNERS file is up-to-date and properly formatted + # + # When autocorrect is enabled, the method will automatically: + # - Generate or update the CODEOWNERS file based on current ownership rules + # - Fix any formatting issues in the CODEOWNERS file + # - Stage the corrected CODEOWNERS file (unless stage_changes is false) + # + # @param autocorrect [Boolean] Whether to automatically fix correctable issues (default: true) + # When true, regenerates and updates the CODEOWNERS file + # When false, only validates without making changes + # + # @param stage_changes [Boolean] Whether to stage the CODEOWNERS file after autocorrection (default: true) + # Only applies when autocorrect is true + # When false, changes are written but not staged with git + # + # @param files [Array, nil] Ignored. This is a legacy parameter that is no longer used. + # + # @return [void] + # + # @raise [RuntimeError] Raises an error if validation fails with details about: + # - Files with conflicting ownership definitions + # - References to non-existent teams + # - Files without ownership (not in unowned_globs) + # - CODEOWNERS file inconsistencies + # + # @example Basic validation with autocorrection + # CodeOwnership.validate! + # # Validates all files and auto-corrects/stages CODEOWNERS if needed + # + # @example Validation without making changes + # CodeOwnership.validate!(autocorrect: false) + # # Only checks for issues without updating CODEOWNERS + # + # @example Validate and fix but don't stage changes + # CodeOwnership.validate!(autocorrect: true, stage_changes: false) + # # Fixes CODEOWNERS but doesn't stage it with git + # + # @note This method is called by the CLI command: bin/codeownership validate + # @note The validation can be disabled for CODEOWNERS by setting skip_codeowners_validation: true in config/code_ownership.yml + # + # @see CLI.validate! for the command-line interface + # @see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners for CODEOWNERS format + # + # pkg:gem/code_ownership#lib/code_ownership.rb:224 + sig { params(autocorrect: T::Boolean, stage_changes: T::Boolean, files: T.nilable(T::Array[::String])).void } + def validate!(autocorrect: T.unsafe(nil), stage_changes: T.unsafe(nil), files: T.unsafe(nil)); end + + # Returns the version of the code_ownership gem and the codeowners-rs gem. + # + # pkg:gem/code_ownership#lib/code_ownership.rb:33 + sig { returns(T::Array[::String]) } + def version; end + end +end + +# pkg:gem/code_ownership#lib/code_ownership/cli.rb:9 +class CodeOwnership::Cli + class << self + # For now, this just returns team ownership + # Later, this could also return code ownership errors about that file. + # + # pkg:gem/code_ownership#lib/code_ownership/cli.rb:95 + def for_file(argv); end + + # pkg:gem/code_ownership#lib/code_ownership/cli.rb:129 + def for_team(argv); end + + # pkg:gem/code_ownership#lib/code_ownership/cli.rb:12 + def run!(argv); end + + # pkg:gem/code_ownership#lib/code_ownership/cli.rb:37 + def validate!(argv); end + + # pkg:gem/code_ownership#lib/code_ownership/cli.rb:89 + def version; end + end +end + +# pkg:gem/code_ownership#lib/code_ownership/cli.rb:10 +CodeOwnership::Cli::EXECUTABLE = T.let(T.unsafe(nil), String) + +# pkg:gem/code_ownership#lib/code_ownership.rb:29 +CodeOwnership::GlobsToOwningTeamMap = T.type_alias { T::Hash[::String, ::CodeTeams::Team] } + +# pkg:gem/code_ownership#lib/code_ownership/private/file_path_finder.rb:5 +module CodeOwnership::Private; end + +# pkg:gem/code_ownership#lib/code_ownership/private/file_path_finder.rb:6 +module CodeOwnership::Private::FilePathFinder + class << self + # pkg:gem/code_ownership#lib/code_ownership/private/file_path_finder.rb:38 + sig { params(backtrace: T.nilable(T::Array[::String])).returns(T::Enumerable[::String]) } + def from_backtrace(backtrace); end + + # Returns a string version of the relative path to a Rails constant, + # or nil if it can't find anything + # + # pkg:gem/code_ownership#lib/code_ownership/private/file_path_finder.rb:22 + sig { params(klass: T.nilable(T.any(T::Class[T.anything], T::Module[T.anything]))).returns(T.nilable(::String)) } + def path_from_klass(klass); end + + # pkg:gem/code_ownership#lib/code_ownership/private/file_path_finder.rb:15 + sig { returns(::Pathname) } + def pwd; end + + # pkg:gem/code_ownership#lib/code_ownership/private/file_path_finder.rb:10 + sig { returns(::String) } + def pwd_prefix; end + end +end + +# pkg:gem/code_ownership#lib/code_ownership/private/file_path_team_cache.rb:6 +module CodeOwnership::Private::FilePathTeamCache + class << self + # pkg:gem/code_ownership#lib/code_ownership/private/file_path_team_cache.rb:25 + sig { void } + def bust_cache!; end + + # pkg:gem/code_ownership#lib/code_ownership/private/file_path_team_cache.rb:30 + sig { returns(T::Hash[::String, T.nilable(::CodeTeams::Team)]) } + def cache; end + + # pkg:gem/code_ownership#lib/code_ownership/private/file_path_team_cache.rb:20 + sig { params(file_path: ::String).returns(T::Boolean) } + def cached?(file_path); end + + # pkg:gem/code_ownership#lib/code_ownership/private/file_path_team_cache.rb:10 + sig { params(file_path: ::String).returns(T.nilable(::CodeTeams::Team)) } + def get(file_path); end + + # pkg:gem/code_ownership#lib/code_ownership/private/file_path_team_cache.rb:15 + sig { params(file_path: ::String, team: T.nilable(::CodeTeams::Team)).void } + def set(file_path, team); end + end +end + +# pkg:gem/code_ownership#lib/code_ownership/private/for_file_output_builder.rb:6 +class CodeOwnership::Private::ForFileOutputBuilder + # pkg:gem/code_ownership#lib/code_ownership/private/for_file_output_builder.rb:12 + sig { params(file_path: ::String, json: T::Boolean, verbose: T::Boolean).void } + def initialize(file_path:, json:, verbose:); end + + # pkg:gem/code_ownership#lib/code_ownership/private/for_file_output_builder.rb:32 + sig { returns(::String) } + def build; end + + private + + # pkg:gem/code_ownership#lib/code_ownership/private/for_file_output_builder.rb:78 + sig { params(reasons: T::Array[::String]).returns(::String) } + def build_description_message(reasons); end + + # pkg:gem/code_ownership#lib/code_ownership/private/for_file_output_builder.rb:69 + sig { params(result_hash: T::Hash[::Symbol, T.untyped]).returns(::String) } + def build_message_for(result_hash); end + + # pkg:gem/code_ownership#lib/code_ownership/private/for_file_output_builder.rb:55 + sig { returns(T::Hash[::Symbol, T.untyped]) } + def build_terse; end + + # pkg:gem/code_ownership#lib/code_ownership/private/for_file_output_builder.rb:43 + sig { returns(T::Hash[::Symbol, T.untyped]) } + def build_verbose; end + + class << self + # pkg:gem/code_ownership#lib/code_ownership/private/for_file_output_builder.rb:19 + sig { params(file_path: ::String, json: T::Boolean, verbose: T::Boolean).returns(::String) } + def build(file_path:, json:, verbose:); end + + private + + # pkg:gem/code_ownership#lib/code_ownership/private/for_file_output_builder.rb:9 + def new(*_arg0); end + end +end + +# pkg:gem/code_ownership#lib/code_ownership/private/for_file_output_builder.rb:23 +CodeOwnership::Private::ForFileOutputBuilder::UNOWNED_OUTPUT = T.let(T.unsafe(nil), Hash) + +# pkg:gem/code_ownership#lib/code_ownership/private/team_finder.rb:6 +module CodeOwnership::Private::TeamFinder + class << self + # pkg:gem/code_ownership#lib/code_ownership/private/team_finder.rb:75 + sig do + params( + backtrace: T.nilable(T::Array[::String]), + excluded_teams: T::Array[::CodeTeams::Team] + ).returns(T.nilable([::CodeTeams::Team, ::String])) + end + def first_owned_file_for_backtrace(backtrace, excluded_teams: T.unsafe(nil)); end + + # pkg:gem/code_ownership#lib/code_ownership/private/team_finder.rb:70 + sig do + params( + backtrace: T.nilable(T::Array[::String]), + excluded_teams: T::Array[::CodeTeams::Team] + ).returns(T.nilable(::CodeTeams::Team)) + end + def for_backtrace(backtrace, excluded_teams: T.unsafe(nil)); end + + # pkg:gem/code_ownership#lib/code_ownership/private/team_finder.rb:54 + sig do + params( + klass: T.nilable(T.any(T::Class[T.anything], T::Module[T.anything])) + ).returns(T.nilable(::CodeTeams::Team)) + end + def for_class(klass); end + + # pkg:gem/code_ownership#lib/code_ownership/private/team_finder.rb:10 + sig { params(file_path: ::String, allow_raise: T::Boolean).returns(T.nilable(::CodeTeams::Team)) } + def for_file(file_path, allow_raise: T.unsafe(nil)); end + + # pkg:gem/code_ownership#lib/code_ownership/private/team_finder.rb:62 + sig { params(package: ::Packs::Pack).returns(T.nilable(::CodeTeams::Team)) } + def for_package(package); end + + # pkg:gem/code_ownership#lib/code_ownership/private/team_finder.rb:27 + sig do + params( + files: T::Array[::String], + allow_raise: T::Boolean + ).returns(T::Hash[::String, T.nilable(::CodeTeams::Team)]) + end + def teams_for_files(files, allow_raise: T.unsafe(nil)); end + + private + + # pkg:gem/code_ownership#lib/code_ownership/private/team_finder.rb:87 + sig { params(team_name: ::String, allow_raise: T::Boolean).returns(T.nilable(::CodeTeams::Team)) } + def find_team!(team_name, allow_raise: T.unsafe(nil)); end + end +end + +# pkg:gem/code_ownership#lib/code_ownership/version.rb:5 +CodeOwnership::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/code_teams@1.0.0.rbi b/sorbet/rbi/gems/code_teams@1.0.0.rbi deleted file mode 100644 index c252b40..0000000 --- a/sorbet/rbi/gems/code_teams@1.0.0.rbi +++ /dev/null @@ -1,120 +0,0 @@ -# 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`. - -module CodeTeams - class << self - sig { returns(T::Array[::CodeTeams::Team]) } - def all; end - - sig { void } - def bust_caches!; end - - sig { params(name: ::String).returns(T.nilable(::CodeTeams::Team)) } - def find(name); end - - sig { params(dir: ::String).returns(T::Array[::CodeTeams::Team]) } - def for_directory(dir); end - - sig { params(string: ::String).returns(::String) } - def tag_value_for(string); end - - sig { params(teams: T::Array[::CodeTeams::Team]).returns(T::Array[::String]) } - def validation_errors(teams); end - end -end - -class CodeTeams::IncorrectPublicApiUsageError < ::StandardError; end - -class CodeTeams::Plugin - abstract! - - sig { params(team: ::CodeTeams::Team).void } - def initialize(team); end - - class << self - sig { returns(T::Array[T.class_of(CodeTeams::Plugin)]) } - def all_plugins; end - - sig { params(team: ::CodeTeams::Team).returns(T.attached_class) } - def for(team); end - - sig { params(base: T.untyped).void } - def inherited(base); end - - sig { params(team: ::CodeTeams::Team, key: ::String).returns(::String) } - def missing_key_error_message(team, key); end - - sig { params(teams: T::Array[::CodeTeams::Team]).returns(T::Array[::String]) } - def validation_errors(teams); end - - private - - sig { params(team: ::CodeTeams::Team).returns(T.attached_class) } - def register_team(team); end - - sig { returns(T::Hash[T.nilable(::String), T::Hash[::Class, ::CodeTeams::Plugin]]) } - def registry; end - end -end - -module CodeTeams::Plugins; end - -class CodeTeams::Plugins::Identity < ::CodeTeams::Plugin - sig { returns(::CodeTeams::Plugins::Identity::IdentityStruct) } - def identity; end - - class << self - sig { override.params(teams: T::Array[::CodeTeams::Team]).returns(T::Array[::String]) } - def validation_errors(teams); end - end -end - -class CodeTeams::Plugins::Identity::IdentityStruct < ::Struct - def name; end - def name=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def members; end - def new(*_arg0); end - end -end - -class CodeTeams::Team - sig { params(config_yml: T.nilable(::String), raw_hash: T::Hash[T.untyped, T.untyped]).void } - def initialize(config_yml:, raw_hash:); end - - sig { params(other: ::Object).returns(T::Boolean) } - def ==(other); end - - sig { returns(T.nilable(::String)) } - def config_yml; end - - def eql?(*args, &blk); end - - sig { returns(::Integer) } - def hash; end - - sig { returns(::String) } - def name; end - - sig { returns(T::Hash[T.untyped, T.untyped]) } - def raw_hash; end - - sig { returns(::String) } - def to_tag; end - - class << self - sig { params(raw_hash: T::Hash[T.untyped, T.untyped]).returns(::CodeTeams::Team) } - def from_hash(raw_hash); end - - sig { params(config_yml: ::String).returns(::CodeTeams::Team) } - def from_yml(config_yml); end - end -end - -CodeTeams::UNKNOWN_TEAM_STRING = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/code_teams@1.3.0.rbi b/sorbet/rbi/gems/code_teams@1.3.0.rbi new file mode 100644 index 0000000..d24179a --- /dev/null +++ b/sorbet/rbi/gems/code_teams@1.3.0.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, **_arg1, &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/coderay@1.1.3.rbi b/sorbet/rbi/gems/coderay@1.1.3.rbi new file mode 100644 index 0000000..287a7ba --- /dev/null +++ b/sorbet/rbi/gems/coderay@1.1.3.rbi @@ -0,0 +1,3342 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `coderay` gem. +# Please instead update this file by running `bin/tapioca gem coderay`. + + +# = CodeRay Library +# +# CodeRay is a Ruby library for syntax highlighting. +# +# I try to make CodeRay easy to use and intuitive, but at the same time fully +# featured, complete, fast and efficient. +# +# See README. +# +# It consists mainly of +# * the main engine: CodeRay (Scanners::Scanner, Tokens, Encoders::Encoder) +# * the plugin system: PluginHost, Plugin +# * the scanners in CodeRay::Scanners +# * the encoders in CodeRay::Encoders +# * the styles in CodeRay::Styles +# +# Here's a fancy graphic to light up this gray docu: +# +# http://cycnus.de/raindark/coderay/scheme.png +# +# == Documentation +# +# See CodeRay, Encoders, Scanners, Tokens. +# +# == Usage +# +# Remember you need RubyGems to use CodeRay, unless you have it in your load +# path. Run Ruby with -rubygems option if required. +# +# === Highlight Ruby code in a string as html +# +# require 'coderay' +# print CodeRay.scan('puts "Hello, world!"', :ruby).html +# +# # prints something like this: +# puts "Hello, world!" +# +# +# === Highlight C code from a file in a html div +# +# require 'coderay' +# print CodeRay.scan(File.read('ruby.h'), :c).div +# print CodeRay.scan_file('ruby.h').html.div +# +# You can include this div in your page. The used CSS styles can be printed with +# +# % coderay_stylesheet +# +# === Highlight without typing too much +# +# If you are one of the hasty (or lazy, or extremely curious) people, just run this file: +# +# % ruby -rubygems /path/to/coderay/coderay.rb > example.html +# +# and look at the file it created in your browser. +# +# = CodeRay Module +# +# The CodeRay module provides convenience methods for the engine. +# +# * The +lang+ and +format+ arguments select Scanner and Encoder to use. These are +# simply lower-case symbols, like :python or :html. +# * All methods take an optional hash as last parameter, +options+, that is send to +# the Encoder / Scanner. +# * Input and language are always sorted in this order: +code+, +lang+. +# (This is in alphabetical order, if you need a mnemonic ;) +# +# You should be able to highlight everything you want just using these methods; +# so there is no need to dive into CodeRay's deep class hierarchy. +# +# The examples in the demo directory demonstrate common cases using this interface. +# +# = Basic Access Ways +# +# Read this to get a general view what CodeRay provides. +# +# == Scanning +# +# Scanning means analysing an input string, splitting it up into Tokens. +# Each Token knows about what type it is: string, comment, class name, etc. +# +# Each +lang+ (language) has its own Scanner; for example, :ruby code is +# handled by CodeRay::Scanners::Ruby. +# +# CodeRay.scan:: Scan a string in a given language into Tokens. +# This is the most common method to use. +# CodeRay.scan_file:: Scan a file and guess the language using FileType. +# +# The Tokens object you get from these methods can encode itself; see Tokens. +# +# == Encoding +# +# Encoding means compiling Tokens into an output. This can be colored HTML or +# LaTeX, a textual statistic or just the number of non-whitespace tokens. +# +# Each Encoder provides output in a specific +format+, so you select Encoders via +# formats like :html or :statistic. +# +# CodeRay.encode:: Scan and encode a string in a given language. +# CodeRay.encode_tokens:: Encode the given tokens. +# CodeRay.encode_file:: Scan a file, guess the language using FileType and encode it. +# +# == All-in-One Encoding +# +# CodeRay.encode:: Highlight a string with a given input and output format. +# +# == Instanciating +# +# You can use an Encoder instance to highlight multiple inputs. This way, the setup +# for this Encoder must only be done once. +# +# CodeRay.encoder:: Create an Encoder instance with format and options. +# CodeRay.scanner:: Create an Scanner instance for lang, with '' as default code. +# +# To make use of CodeRay.scanner, use CodeRay::Scanner::code=. +# +# The scanning methods provide more flexibility; we recommend to use these. +# +# == Reusing Scanners and Encoders +# +# If you want to re-use scanners and encoders (because that is faster), see +# CodeRay::Duo for the most convenient (and recommended) interface. +# +# pkg:gem/coderay#lib/coderay.rb:126 +module CodeRay + class << self + # Assuming the path is a subpath of lib/coderay/ + # + # pkg:gem/coderay#lib/coderay.rb:133 + def coderay_path(*path); end + + # Encode a string. + # + # This scans +code+ with the the Scanner for +lang+ and then + # encodes it with the Encoder for +format+. + # +options+ will be passed to the Encoder. + # + # See CodeRay::Encoder.encode. + # + # pkg:gem/coderay#lib/coderay.rb:196 + def encode(code, lang, format, options = T.unsafe(nil)); end + + # Encodes +filename+ (a path to a code file) with the Scanner for +lang+. + # + # See CodeRay.scan_file. + # Notice that the second argument is the output +format+, not the input language. + # + # Example: + # require 'coderay' + # page = CodeRay.encode_file 'some_c_code.c', :html + # + # pkg:gem/coderay#lib/coderay.rb:221 + def encode_file(filename, format, options = T.unsafe(nil)); end + + # Encode pre-scanned Tokens. + # Use this together with CodeRay.scan: + # + # require 'coderay' + # + # # Highlight a short Ruby code example in a HTML span + # tokens = CodeRay.scan '1 + 2', :ruby + # puts CodeRay.encode_tokens(tokens, :span) + # + # pkg:gem/coderay#lib/coderay.rb:209 + def encode_tokens(tokens, format, options = T.unsafe(nil)); end + + # Finds the Encoder class for +format+ and creates an instance, passing + # +options+ to it. + # + # Example: + # require 'coderay' + # + # stats = CodeRay.encoder(:statistic) + # stats.encode("puts 17 + 4\n", :ruby) + # + # puts '%d out of %d tokens have the kind :integer.' % [ + # stats.type_stats[:integer].count, + # stats.real_token_count + # ] + # #-> 2 out of 4 tokens have the kind :integer. + # + # pkg:gem/coderay#lib/coderay.rb:260 + def encoder(format, options = T.unsafe(nil)); end + + # Extract the options for the scanner from the +options+ hash. + # + # Returns an empty Hash if :scanner_options is not set. + # + # This is used if a method like CodeRay.encode has to provide options + # for Encoder _and_ scanner. + # + # pkg:gem/coderay#lib/coderay.rb:278 + def get_scanner_options(options); end + + # Highlight a string into a HTML
    . + # + # CSS styles use classes, so you have to include a stylesheet + # in your output. + # + # See encode. + # + # pkg:gem/coderay#lib/coderay.rb:232 + def highlight(code, lang, options = T.unsafe(nil), format = T.unsafe(nil)); end + + # Highlight a file into a HTML
    . + # + # CSS styles use classes, so you have to include a stylesheet + # in your output. + # + # See encode. + # + # pkg:gem/coderay#lib/coderay.rb:242 + def highlight_file(filename, options = T.unsafe(nil), format = T.unsafe(nil)); end + + # Scans the given +code+ (a String) with the Scanner for +lang+. + # + # This is a simple way to use CodeRay. Example: + # require 'coderay' + # page = CodeRay.scan("puts 'Hello, world!'", :ruby).html + # + # See also demo/demo_simple. + # + # pkg:gem/coderay#lib/coderay.rb:168 + def scan(code, lang, options = T.unsafe(nil), &block); end + + # Scans +filename+ (a path to a code file) with the Scanner for +lang+. + # + # If +lang+ is :auto or omitted, the CodeRay::FileType module is used to + # determine it. If it cannot find out what type it is, it uses + # CodeRay::Scanners::Text. + # + # Calls CodeRay.scan. + # + # Example: + # require 'coderay' + # page = CodeRay.scan_file('some_c_code.c').html + # + # pkg:gem/coderay#lib/coderay.rb:183 + def scan_file(filename, lang = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Finds the Scanner class for +lang+ and creates an instance, passing + # +options+ to it. + # + # See Scanner.new. + # + # pkg:gem/coderay#lib/coderay.rb:268 + def scanner(lang, options = T.unsafe(nil), &block); end + end +end + +# pkg:gem/coderay#lib/coderay.rb:130 +CodeRay::CODERAY_PATH = T.let(T.unsafe(nil), String) + +# = Duo +# +# A Duo is a convenient way to use CodeRay. You just create a Duo, +# giving it a lang (language of the input code) and a format (desired +# output format), and call Duo#highlight with the code. +# +# Duo makes it easy to re-use both scanner and encoder for a repetitive +# task. It also provides a very easy interface syntax: +# +# require 'coderay' +# CodeRay::Duo[:python, :div].highlight 'import this' +# +# Until you want to do uncommon things with CodeRay, I recommend to use +# this method, since it takes care of everything. +# +# pkg:gem/coderay#lib/coderay/duo.rb:17 +class CodeRay::Duo + # Create a new Duo, holding a lang and a format to highlight code. + # + # simple: + # CodeRay::Duo[:ruby, :html].highlight 'bla 42' + # + # with options: + # CodeRay::Duo[:ruby, :html, :hint => :debug].highlight '????::??' + # + # alternative syntax without options: + # CodeRay::Duo[:ruby => :statistic].encode 'class << self; end' + # + # alternative syntax with options: + # CodeRay::Duo[{ :ruby => :statistic }, :do => :something].encode 'abc' + # + # The options are forwarded to scanner and encoder + # (see CodeRay.get_scanner_options). + # + # pkg:gem/coderay#lib/coderay/duo.rb:37 + def initialize(lang = T.unsafe(nil), format = T.unsafe(nil), options = T.unsafe(nil)); end + + # Allows to use Duo like a proc object: + # + # CodeRay::Duo[:python => :yaml].call(code) + # + # or, in Ruby 1.9 and later: + # + # CodeRay::Duo[:python => :yaml].(code) + # + # pkg:gem/coderay#lib/coderay/duo.rb:77 + def call(code, options = T.unsafe(nil)); end + + # Tokenize and highlight the code using +scanner+ and +encoder+. + # + # pkg:gem/coderay#lib/coderay/duo.rb:64 + def encode(code, options = T.unsafe(nil)); end + + # The encoder of the duo. Only created once. + # + # pkg:gem/coderay#lib/coderay/duo.rb:59 + def encoder; end + + # pkg:gem/coderay#lib/coderay/duo.rb:19 + def format; end + + # pkg:gem/coderay#lib/coderay/duo.rb:19 + def format=(_arg0); end + + # pkg:gem/coderay#lib/coderay/duo.rb:68 + def highlight(code, options = T.unsafe(nil)); end + + # pkg:gem/coderay#lib/coderay/duo.rb:19 + def lang; end + + # pkg:gem/coderay#lib/coderay/duo.rb:19 + def lang=(_arg0); end + + # pkg:gem/coderay#lib/coderay/duo.rb:19 + def options; end + + # pkg:gem/coderay#lib/coderay/duo.rb:19 + def options=(_arg0); end + + # The scanner of the duo. Only created once. + # + # pkg:gem/coderay#lib/coderay/duo.rb:54 + def scanner; end + + class << self + # To allow calls like Duo[:ruby, :html].highlight. + # + # pkg:gem/coderay#lib/coderay/duo.rb:50 + def [](*_arg0); end + end +end + +# This module holds the Encoder class and its subclasses. +# For example, the HTML encoder is named CodeRay::Encoders::HTML +# can be found in coderay/encoders/html. +# +# Encoders also provides methods and constants for the register +# mechanism and the [] method that returns the Encoder class +# belonging to the given format. +# +# pkg:gem/coderay#lib/coderay/encoders.rb:10 +module CodeRay::Encoders + extend ::CodeRay::PluginHost +end + +# A simple Filter that removes all tokens of the :comment kind. +# +# Alias: +remove_comments+ +# +# Usage: +# CodeRay.scan('print # foo', :ruby).comment_filter.text +# #-> "print " +# +# See also: TokenKindFilter, LinesOfCode +# +# pkg:gem/coderay#lib/coderay/encoders/comment_filter.rb:15 +class CodeRay::Encoders::CommentFilter < ::CodeRay::Encoders::TokenKindFilter; end + +# pkg:gem/coderay#lib/coderay/encoders/comment_filter.rb:19 +CodeRay::Encoders::CommentFilter::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# Returns the number of tokens. +# +# Text and block tokens are counted. +# +# pkg:gem/coderay#lib/coderay/encoders/count.rb:7 +class CodeRay::Encoders::Count < ::CodeRay::Encoders::Encoder + # pkg:gem/coderay#lib/coderay/encoders/count.rb:29 + def begin_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/count.rb:33 + def begin_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/count.rb:32 + def end_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/count.rb:34 + def end_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/count.rb:25 + def text_token(text, kind); end + + protected + + # pkg:gem/coderay#lib/coderay/encoders/count.rb:19 + def finish(options); end + + # pkg:gem/coderay#lib/coderay/encoders/count.rb:13 + def setup(options); end +end + +# = Debug Encoder +# +# Fast encoder producing simple debug output. +# +# It is readable and diff-able and is used for testing. +# +# You cannot fully restore the tokens information from the +# output, because consecutive :space tokens are merged. +# +# See also: Scanners::Debug +# +# pkg:gem/coderay#lib/coderay/encoders/debug.rb:14 +class CodeRay::Encoders::Debug < ::CodeRay::Encoders::Encoder + # pkg:gem/coderay#lib/coderay/encoders/debug.rb:30 + def begin_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/debug.rb:38 + def begin_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/debug.rb:34 + def end_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/debug.rb:42 + def end_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/debug.rb:20 + def text_token(text, kind); end +end + +# pkg:gem/coderay#lib/coderay/encoders/debug.rb:18 +CodeRay::Encoders::Debug::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# = Debug Lint Encoder +# +# Debug encoder with additional checks for: +# +# - empty tokens +# - incorrect nesting +# +# It will raise an InvalidTokenStream exception when any of the above occurs. +# +# See also: Encoders::Debug +# +# pkg:gem/coderay#lib/coderay/encoders/debug_lint.rb:16 +class CodeRay::Encoders::DebugLint < ::CodeRay::Encoders::Debug + # pkg:gem/coderay#lib/coderay/encoders/debug_lint.rb:26 + def begin_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/debug_lint.rb:37 + def begin_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/debug_lint.rb:31 + def end_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/debug_lint.rb:42 + def end_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/debug_lint.rb:20 + def text_token(text, kind); end + + protected + + # pkg:gem/coderay#lib/coderay/encoders/debug_lint.rb:55 + def finish(options); end + + # pkg:gem/coderay#lib/coderay/encoders/debug_lint.rb:50 + def setup(options); end +end + +# Wraps HTML output into a DIV element, using inline styles by default. +# +# See Encoders::HTML for available options. +# +# pkg:gem/coderay#lib/coderay/encoders/div.rb:9 +class CodeRay::Encoders::Div < ::CodeRay::Encoders::HTML; end + +# pkg:gem/coderay#lib/coderay/encoders/div.rb:15 +CodeRay::Encoders::Div::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/encoders/div.rb:11 +CodeRay::Encoders::Div::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# = Encoder +# +# The Encoder base class. Together with Scanner and +# Tokens, it forms the highlighting triad. +# +# Encoder instances take a Tokens object and do something with it. +# +# The most common Encoder is surely the HTML encoder +# (CodeRay::Encoders::HTML). It highlights the code in a colorful +# html page. +# If you want the highlighted code in a div or a span instead, +# use its subclasses Div and Span. +# +# pkg:gem/coderay#lib/coderay/encoders/encoder.rb:16 +class CodeRay::Encoders::Encoder + extend ::CodeRay::Plugin + + # Creates a new Encoder. + # +options+ is saved and used for all encode operations, as long + # as you don't overwrite it there by passing additional options. + # + # Encoder objects provide three encode methods: + # - encode simply takes a +code+ string and a +lang+ + # - encode_tokens expects a +tokens+ object instead + # + # Each method has an optional +options+ parameter. These are + # added to the options you passed at creation. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:55 + def initialize(options = T.unsafe(nil)); end + + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:87 + def <<(token); end + + # Starts a token group with the given +kind+. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:123 + def begin_group(kind); end + + # Starts a new line token group with the given +kind+. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:131 + def begin_line(kind); end + + # Encode the given +code+ using the Scanner for +lang+. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:70 + def encode(code, lang, options = T.unsafe(nil)); end + + # Encode a Tokens object. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:61 + def encode_tokens(tokens, options = T.unsafe(nil)); end + + # Ends a token group with the given +kind+. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:127 + def end_group(kind); end + + # Ends a new line token group with the given +kind+. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:135 + def end_line(kind); end + + # The default file extension for this encoder. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:83 + def file_extension; end + + # You can use highlight instead of encode, if that seems + # more clear to you. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:80 + def highlight(code, lang, options = T.unsafe(nil)); end + + # The options you gave the Encoder at creating. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:43 + def options; end + + # The options you gave the Encoder at creating. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:43 + def options=(_arg0); end + + # The options you gave the Encoder at creating. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:43 + def scanner; end + + # The options you gave the Encoder at creating. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:43 + def scanner=(_arg0); end + + # Called for each text token ([text, kind]), where text is a String. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:118 + def text_token(text, kind); end + + # Called with +content+ and +kind+ of the currently scanned token. + # For simple scanners, it's enougth to implement this method. + # + # By default, it calls text_token, begin_group, end_group, begin_line, + # or end_line, depending on the +content+. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:100 + def token(content, kind); end + + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:184 + def tokens(tokens, options = T.unsafe(nil)); end + + protected + + # Do the encoding. + # + # The already created +tokens+ object must be used; it must be a + # Tokens object. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:168 + def compile(tokens, options = T.unsafe(nil)); end + + # Called with merged options after encoding starts. + # The return value is the result of encoding, typically @out. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:160 + def finish(options); end + + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:148 + def get_output(options); end + + # Append data.to_s to the output. Returns the argument. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:153 + def output(data); end + + # Called with merged options before encoding starts. + # Sets @out to an empty string. + # + # See the HTML Encoder for an example of option caching. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:144 + def setup(options); end + + class << self + # If FILE_EXTENSION isn't defined, this method returns the + # downcase class name instead. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:24 + def const_missing(sym); end + + # The default file extension for output file of this encoder class. + # + # pkg:gem/coderay#lib/coderay/encoders/encoder.rb:33 + def file_extension; end + end +end + +# Subclasses are to store their default options in this constant. +# +# pkg:gem/coderay#lib/coderay/encoders/encoder.rb:40 +CodeRay::Encoders::Encoder::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/helpers/plugin.rb:41 +CodeRay::Encoders::Encoder::PLUGIN_HOST = CodeRay::Encoders + +# A Filter encoder has another Tokens instance as output. +# It can be subclass to select, remove, or modify tokens in the stream. +# +# Subclasses of Filter are called "Filters" and can be chained. +# +# == Options +# +# === :tokens +# +# The Tokens object which will receive the output. +# +# Default: Tokens.new +# +# See also: TokenKindFilter +# +# pkg:gem/coderay#lib/coderay/encoders/filter.rb:18 +class CodeRay::Encoders::Filter < ::CodeRay::Encoders::Encoder + # pkg:gem/coderay#lib/coderay/encoders/filter.rb:39 + def begin_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/filter.rb:43 + def begin_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/filter.rb:47 + def end_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/filter.rb:51 + def end_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/filter.rb:35 + def text_token(text, kind); end + + protected + + # pkg:gem/coderay#lib/coderay/encoders/filter.rb:29 + def finish(options); end + + # pkg:gem/coderay#lib/coderay/encoders/filter.rb:23 + def setup(options); end +end + +# = HTML Encoder +# +# This is CodeRay's most important highlighter: +# It provides save, fast XHTML generation and CSS support. +# +# == Usage +# +# require 'coderay' +# puts CodeRay.scan('Some /code/', :ruby).html #-> a HTML page +# puts CodeRay.scan('Some /code/', :ruby).html(:wrap => :span) +# #-> Some /code/ +# puts CodeRay.scan('Some /code/', :ruby).span #-> the same +# +# puts CodeRay.scan('Some code', :ruby).html( +# :wrap => nil, +# :line_numbers => :inline, +# :css => :style +# ) +# +# == Options +# +# === :tab_width +# Convert \t characters to +n+ spaces (a number or false.) +# false will keep tab characters untouched. +# +# Default: 8 +# +# === :css +# How to include the styles; can be :class or :style. +# +# Default: :class +# +# === :wrap +# Wrap in :page, :div, :span or nil. +# +# You can also use Encoders::Div and Encoders::Span. +# +# Default: nil +# +# === :title +# +# The title of the HTML page (works only when :wrap is set to :page.) +# +# Default: 'CodeRay output' +# +# === :break_lines +# +# Split multiline blocks at line breaks. +# Forced to true if :line_numbers option is set to :inline. +# +# Default: false +# +# === :line_numbers +# Include line numbers in :table, :inline, or nil (no line numbers) +# +# Default: nil +# +# === :line_number_anchors +# Adds anchors and links to the line numbers. Can be false (off), true (on), +# or a prefix string that will be prepended to the anchor name. +# +# The prefix must consist only of letters, digits, and underscores. +# +# Default: true, default prefix name: "line" +# +# === :line_number_start +# Where to start with line number counting. +# +# Default: 1 +# +# === :bold_every +# Make every +n+-th number appear bold. +# +# Default: 10 +# +# === :highlight_lines +# +# Highlights certain line numbers. +# Can be any Enumerable, typically just an Array or Range, of numbers. +# +# Bolding is deactivated when :highlight_lines is set. It only makes sense +# in combination with :line_numbers. +# +# Default: nil +# +# === :hint +# Include some information into the output using the title attribute. +# Can be :info (show token kind on mouse-over), :info_long (with full path) +# or :debug (via inspect). +# +# Default: false +# +# pkg:gem/coderay#lib/coderay/encoders/html.rb:97 +class CodeRay::Encoders::HTML < ::CodeRay::Encoders::Encoder + # token groups, eg. strings + # + # pkg:gem/coderay#lib/coderay/encoders/html.rb:235 + def begin_group(kind); end + + # whole lines to be highlighted, eg. a deleted line in a diff + # + # pkg:gem/coderay#lib/coderay/encoders/html.rb:247 + def begin_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/html.rb:126 + def css; end + + # pkg:gem/coderay#lib/coderay/encoders/html.rb:241 + def end_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/html.rb:261 + def end_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/html.rb:221 + def text_token(text, kind); end + + protected + + # pkg:gem/coderay#lib/coderay/encoders/html.rb:316 + def break_lines(text, style); end + + # pkg:gem/coderay#lib/coderay/encoders/html.rb:310 + def check_group_nesting(name, kind); end + + # pkg:gem/coderay#lib/coderay/encoders/html.rb:268 + def check_options!(options); end + + # pkg:gem/coderay#lib/coderay/encoders/html.rb:324 + def close_span; end + + # pkg:gem/coderay#lib/coderay/encoders/html.rb:280 + def css_class_for_kinds(kinds); end + + # pkg:gem/coderay#lib/coderay/encoders/html.rb:195 + def finish(options); end + + # pkg:gem/coderay#lib/coderay/encoders/html.rb:289 + def make_span_for_kinds(method, hint); end + + # pkg:gem/coderay#lib/coderay/encoders/html.rb:172 + def setup(options); end + + # pkg:gem/coderay#lib/coderay/encoders/html.rb:284 + def style_for_kinds(kinds); end + + class << self + # pkg:gem/coderay#lib/coderay/encoders/html.rb:130 + def make_html_escape_hash; end + + # Generate a hint about the given +kinds+ in a +hint+ style. + # + # +hint+ may be :info, :info_long or :debug. + # + # pkg:gem/coderay#lib/coderay/encoders/html.rb:157 + def token_path_to_hint(hint, kinds); end + end +end + +# pkg:gem/coderay#lib/coderay/encoders/html/css.rb:5 +class CodeRay::Encoders::HTML::CSS + # pkg:gem/coderay#lib/coderay/encoders/html/css.rb:13 + def initialize(style = T.unsafe(nil)); end + + # pkg:gem/coderay#lib/coderay/encoders/html/css.rb:23 + def get_style_for_css_classes(css_classes); end + + # pkg:gem/coderay#lib/coderay/encoders/html/css.rb:7 + def stylesheet; end + + private + + # pkg:gem/coderay#lib/coderay/encoders/html/css.rb:49 + def parse(stylesheet); end + + class << self + # pkg:gem/coderay#lib/coderay/encoders/html/css.rb:9 + def load_stylesheet(style = T.unsafe(nil)); end + end +end + +# pkg:gem/coderay#lib/coderay/encoders/html/css.rb:36 +CodeRay::Encoders::HTML::CSS::CSS_CLASS_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/encoders/html.rb:103 +CodeRay::Encoders::HTML::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/encoders/html.rb:101 +CodeRay::Encoders::HTML::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# pkg:gem/coderay#lib/coderay/encoders/html.rb:143 +CodeRay::Encoders::HTML::HTML_ESCAPE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/encoders/html.rb:144 +CodeRay::Encoders::HTML::HTML_ESCAPE_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/encoders/html/numbering.rb:6 +module CodeRay::Encoders::HTML::Numbering + class << self + # pkg:gem/coderay#lib/coderay/encoders/html/numbering.rb:8 + def number!(output, mode = T.unsafe(nil), options = T.unsafe(nil)); end + end +end + +# This module is included in the output String of the HTML Encoder. +# +# It provides methods like wrap, div, page etc. +# +# Remember to use #clone instead of #dup to keep the modules the object was +# extended with. +# +# TODO: Rewrite this without monkey patching. +# +# pkg:gem/coderay#lib/coderay/encoders/html/output.rb:14 +module CodeRay::Encoders::HTML::Output + # pkg:gem/coderay#lib/coderay/encoders/html/output.rb:57 + def apply_title!(title); end + + # pkg:gem/coderay#lib/coderay/encoders/html/output.rb:16 + def css; end + + # pkg:gem/coderay#lib/coderay/encoders/html/output.rb:16 + def css=(_arg0); end + + # pkg:gem/coderay#lib/coderay/encoders/html/output.rb:86 + def stylesheet(in_tag = T.unsafe(nil)); end + + # pkg:gem/coderay#lib/coderay/encoders/html/output.rb:62 + def wrap!(element, *args); end + + # pkg:gem/coderay#lib/coderay/encoders/html/output.rb:52 + def wrap_in!(template); end + + # pkg:gem/coderay#lib/coderay/encoders/html/output.rb:47 + def wrapped_in; end + + # pkg:gem/coderay#lib/coderay/encoders/html/output.rb:50 + def wrapped_in=(_arg0); end + + # pkg:gem/coderay#lib/coderay/encoders/html/output.rb:43 + def wrapped_in?(element); end + + class << self + # Raises an exception if an object that doesn't respond to to_str is extended by Output, + # to prevent users from misuse. Use Module#remove_method to disable. + # + # pkg:gem/coderay#lib/coderay/encoders/html/output.rb:22 + def extended(o); end + + # pkg:gem/coderay#lib/coderay/encoders/html/output.rb:26 + def make_stylesheet(css, in_tag = T.unsafe(nil)); end + + # pkg:gem/coderay#lib/coderay/encoders/html/output.rb:36 + def page_template_for_css(css); end + end +end + +# pkg:gem/coderay#lib/coderay/encoders/html/output.rb:117 +CodeRay::Encoders::HTML::Output::DIV = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template) + +# pkg:gem/coderay#lib/coderay/encoders/html/output.rb:130 +CodeRay::Encoders::HTML::Output::PAGE = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template) + +# pkg:gem/coderay#lib/coderay/encoders/html/output.rb:115 +CodeRay::Encoders::HTML::Output::SPAN = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template) + +# pkg:gem/coderay#lib/coderay/encoders/html/output.rb:123 +CodeRay::Encoders::HTML::Output::TABLE = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template) + +# -- don't include the templates in docu +# +# pkg:gem/coderay#lib/coderay/encoders/html/output.rb:92 +class CodeRay::Encoders::HTML::Output::Template < ::String + # pkg:gem/coderay#lib/coderay/encoders/html/output.rb:104 + def apply(target, replacement); end + + class << self + # pkg:gem/coderay#lib/coderay/encoders/html/output.rb:94 + def wrap!(str, template, target); end + end +end + +# pkg:gem/coderay#lib/coderay/encoders/html.rb:146 +CodeRay::Encoders::HTML::TOKEN_KIND_TO_INFO = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/encoders/html.rb:150 +CodeRay::Encoders::HTML::TRANSPARENT_TOKEN_KINDS = T.let(T.unsafe(nil), Set) + +# A simple JSON Encoder. +# +# Example: +# CodeRay.scan('puts "Hello world!"', :ruby).json +# yields +# [ +# {"type"=>"text", "text"=>"puts", "kind"=>"ident"}, +# {"type"=>"text", "text"=>" ", "kind"=>"space"}, +# {"type"=>"block", "action"=>"open", "kind"=>"string"}, +# {"type"=>"text", "text"=>"\"", "kind"=>"delimiter"}, +# {"type"=>"text", "text"=>"Hello world!", "kind"=>"content"}, +# {"type"=>"text", "text"=>"\"", "kind"=>"delimiter"}, +# {"type"=>"block", "action"=>"close", "kind"=>"string"}, +# ] +# +# pkg:gem/coderay#lib/coderay/encoders/json.rb:18 +class CodeRay::Encoders::JSON < ::CodeRay::Encoders::Encoder + # pkg:gem/coderay#lib/coderay/encoders/json.rb:64 + def begin_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/json.rb:72 + def begin_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/json.rb:68 + def end_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/json.rb:76 + def end_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/json.rb:60 + def text_token(text, kind); end + + protected + + # pkg:gem/coderay#lib/coderay/encoders/json.rb:49 + def append(data); end + + # pkg:gem/coderay#lib/coderay/encoders/json.rb:45 + def finish(options); end + + # pkg:gem/coderay#lib/coderay/encoders/json.rb:38 + def setup(options); end +end + +# pkg:gem/coderay#lib/coderay/encoders/json.rb:35 +CodeRay::Encoders::JSON::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# Counts the LoC (Lines of Code). Returns an Integer >= 0. +# +# Alias: +loc+ +# +# Everything that is not comment, markup, doctype/shebang, or an empty line, +# is considered to be code. +# +# For example, +# * HTML files not containing JavaScript have 0 LoC +# * in a Java class without comments, LoC is the number of non-empty lines +# +# A Scanner class should define the token kinds that are not code in the +# KINDS_NOT_LOC constant, which defaults to [:comment, :doctype]. +# +# pkg:gem/coderay#lib/coderay/encoders/lines_of_code.rb:17 +class CodeRay::Encoders::LinesOfCode < ::CodeRay::Encoders::TokenKindFilter + protected + + # pkg:gem/coderay#lib/coderay/encoders/lines_of_code.rb:38 + def finish(options); end + + # pkg:gem/coderay#lib/coderay/encoders/lines_of_code.rb:25 + def setup(options); end +end + +# pkg:gem/coderay#lib/coderay/encoders/lines_of_code.rb:21 +CodeRay::Encoders::LinesOfCode::NON_EMPTY_LINE = T.let(T.unsafe(nil), Regexp) + +# = Lint Encoder +# +# Checks for: +# +# - empty tokens +# - incorrect nesting +# +# It will raise an InvalidTokenStream exception when any of the above occurs. +# +# See also: Encoders::DebugLint +# +# pkg:gem/coderay#lib/coderay/encoders/lint.rb:14 +class CodeRay::Encoders::Lint < ::CodeRay::Encoders::Debug + # pkg:gem/coderay#lib/coderay/encoders/lint.rb:28 + def begin_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/lint.rb:37 + def begin_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/lint.rb:32 + def end_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/lint.rb:41 + def end_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/lint.rb:23 + def text_token(text, kind); end + + protected + + # pkg:gem/coderay#lib/coderay/encoders/lint.rb:52 + def finish(options); end + + # pkg:gem/coderay#lib/coderay/encoders/lint.rb:48 + def setup(options); end +end + +# pkg:gem/coderay#lib/coderay/encoders/lint.rb:19 +class CodeRay::Encoders::Lint::EmptyToken < ::CodeRay::Encoders::Lint::InvalidTokenStream; end + +# pkg:gem/coderay#lib/coderay/encoders/lint.rb:21 +class CodeRay::Encoders::Lint::IncorrectTokenGroupNesting < ::CodeRay::Encoders::Lint::InvalidTokenStream; end + +# pkg:gem/coderay#lib/coderay/encoders/lint.rb:18 +class CodeRay::Encoders::Lint::InvalidTokenStream < ::StandardError; end + +# pkg:gem/coderay#lib/coderay/encoders/lint.rb:20 +class CodeRay::Encoders::Lint::UnknownTokenKind < ::CodeRay::Encoders::Lint::InvalidTokenStream; end + +# = Null Encoder +# +# Does nothing and returns an empty string. +# +# pkg:gem/coderay#lib/coderay/encoders/null.rb:7 +class CodeRay::Encoders::Null < ::CodeRay::Encoders::Encoder + # pkg:gem/coderay#lib/coderay/encoders/null.rb:11 + def text_token(text, kind); end +end + +# Wraps the output into a HTML page, using CSS classes and +# line numbers in the table format by default. +# +# See Encoders::HTML for available options. +# +# pkg:gem/coderay#lib/coderay/encoders/page.rb:10 +class CodeRay::Encoders::Page < ::CodeRay::Encoders::HTML; end + +# pkg:gem/coderay#lib/coderay/encoders/page.rb:16 +CodeRay::Encoders::Page::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/encoders/page.rb:12 +CodeRay::Encoders::Page::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# Wraps HTML output into a SPAN element, using inline styles by default. +# +# See Encoders::HTML for available options. +# +# pkg:gem/coderay#lib/coderay/encoders/span.rb:9 +class CodeRay::Encoders::Span < ::CodeRay::Encoders::HTML; end + +# pkg:gem/coderay#lib/coderay/encoders/span.rb:15 +CodeRay::Encoders::Span::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/encoders/span.rb:11 +CodeRay::Encoders::Span::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# Makes a statistic for the given tokens. +# +# Alias: +stats+ +# +# pkg:gem/coderay#lib/coderay/encoders/statistic.rb:7 +class CodeRay::Encoders::Statistic < ::CodeRay::Encoders::Encoder + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:70 + def begin_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:78 + def begin_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:86 + def block_token(action, kind); end + + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:74 + def end_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:82 + def end_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:11 + def real_token_count; end + + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:62 + def text_token(text, kind); end + + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:11 + def type_stats; end + + protected + + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:42 + def finish(options); end + + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:17 + def setup(options); end +end + +# pkg:gem/coderay#lib/coderay/encoders/statistic.rb:24 +CodeRay::Encoders::Statistic::STATS = T.let(T.unsafe(nil), String) + +# pkg:gem/coderay#lib/coderay/encoders/statistic.rb:38 +CodeRay::Encoders::Statistic::TOKEN_TYPES_ROW = T.let(T.unsafe(nil), String) + +# pkg:gem/coderay#lib/coderay/encoders/statistic.rb:13 +class CodeRay::Encoders::Statistic::TypeStats < ::Struct + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:13 + def count; end + + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:13 + def count=(_); end + + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:13 + def size; end + + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:13 + def size=(_); end + + class << self + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:13 + def [](*_arg0); end + + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:13 + def inspect; end + + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:13 + def keyword_init?; end + + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:13 + def members; end + + # pkg:gem/coderay#lib/coderay/encoders/statistic.rb:13 + def new(*_arg0); end + end +end + +# Outputs code highlighted for a color terminal. +# +# Note: This encoder is in beta. It currently doesn't use the Styles. +# +# Alias: +term+ +# +# == Authors & License +# +# By Rob Aldred (http://robaldred.co.uk) +# +# Based on idea by Nathan Weizenbaum (http://nex-3.com) +# +# MIT License (http://www.opensource.org/licenses/mit-license.php) +# +# pkg:gem/coderay#lib/coderay/encoders/terminal.rb:17 +class CodeRay::Encoders::Terminal < ::CodeRay::Encoders::Encoder + # pkg:gem/coderay#lib/coderay/encoders/terminal.rb:156 + def begin_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/terminal.rb:160 + def begin_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/terminal.rb:162 + def end_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/terminal.rb:172 + def end_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/terminal.rb:141 + def text_token(text, kind); end + + protected + + # pkg:gem/coderay#lib/coderay/encoders/terminal.rb:133 + def setup(options); end + + private + + # pkg:gem/coderay#lib/coderay/encoders/terminal.rb:179 + def open_token(kind); end +end + +# pkg:gem/coderay#lib/coderay/encoders/terminal.rb:21 +CodeRay::Encoders::Terminal::TOKEN_COLORS = T.let(T.unsafe(nil), Hash) + +# Concats the tokens into a single string, resulting in the original +# code string if no tokens were removed. +# +# Alias: +plain+, +plaintext+ +# +# == Options +# +# === :separator +# A separator string to join the tokens. +# +# Default: empty String +# +# pkg:gem/coderay#lib/coderay/encoders/text.rb:15 +class CodeRay::Encoders::Text < ::CodeRay::Encoders::Encoder + # pkg:gem/coderay#lib/coderay/encoders/text.rb:25 + def text_token(text, kind); end + + protected + + # pkg:gem/coderay#lib/coderay/encoders/text.rb:36 + def setup(options); end +end + +# pkg:gem/coderay#lib/coderay/encoders/text.rb:21 +CodeRay::Encoders::Text::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/encoders/text.rb:19 +CodeRay::Encoders::Text::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# A Filter that selects tokens based on their token kind. +# +# == Options +# +# === :exclude +# +# One or many symbols (in an Array) which shall be excluded. +# +# Default: [] +# +# === :include +# +# One or many symbols (in an array) which shall be included. +# +# Default: :all, which means all tokens are included. +# +# Exclusion wins over inclusion. +# +# See also: CommentFilter +# +# pkg:gem/coderay#lib/coderay/encoders/token_kind_filter.rb:25 +class CodeRay::Encoders::TokenKindFilter < ::CodeRay::Encoders::Filter + # Add the token group to the output stream if +kind+ matches the + # conditions. + # + # If it does not, all tokens inside the group are excluded from the + # stream, even if their kinds match. + # + # pkg:gem/coderay#lib/coderay/encoders/token_kind_filter.rb:66 + def begin_group(kind); end + + # See +begin_group+. + # + # pkg:gem/coderay#lib/coderay/encoders/token_kind_filter.rb:77 + def begin_line(kind); end + + # Take care of re-enabling the delegation of tokens to the output stream + # if an exluded group has ended. + # + # pkg:gem/coderay#lib/coderay/encoders/token_kind_filter.rb:89 + def end_group(kind); end + + # See +end_group+. + # + # pkg:gem/coderay#lib/coderay/encoders/token_kind_filter.rb:99 + def end_line(kind); end + + # Add the token to the output stream if +kind+ matches the conditions. + # + # pkg:gem/coderay#lib/coderay/encoders/token_kind_filter.rb:57 + def text_token(text, kind); end + + protected + + # pkg:gem/coderay#lib/coderay/encoders/token_kind_filter.rb:49 + def include_group?(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/token_kind_filter.rb:45 + def include_text_token?(text, kind); end + + # pkg:gem/coderay#lib/coderay/encoders/token_kind_filter.rb:35 + def setup(options); end +end + +# pkg:gem/coderay#lib/coderay/encoders/token_kind_filter.rb:29 +CodeRay::Encoders::TokenKindFilter::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# = XML Encoder +# +# Uses REXML. Very slow. +# +# pkg:gem/coderay#lib/coderay/encoders/xml.rb:7 +class CodeRay::Encoders::XML < ::CodeRay::Encoders::Encoder + # pkg:gem/coderay#lib/coderay/encoders/xml.rb:58 + def begin_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/xml.rb:62 + def end_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/xml.rb:38 + def text_token(text, kind); end + + protected + + # pkg:gem/coderay#lib/coderay/encoders/xml.rb:31 + def finish(options); end + + # pkg:gem/coderay#lib/coderay/encoders/xml.rb:22 + def setup(options); end +end + +# pkg:gem/coderay#lib/coderay/encoders/xml.rb:15 +CodeRay::Encoders::XML::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/encoders/xml.rb:11 +CodeRay::Encoders::XML::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# = YAML Encoder +# +# Slow. +# +# pkg:gem/coderay#lib/coderay/encoders/yaml.rb:9 +class CodeRay::Encoders::YAML < ::CodeRay::Encoders::Encoder + # pkg:gem/coderay#lib/coderay/encoders/yaml.rb:31 + def begin_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/yaml.rb:39 + def begin_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/yaml.rb:35 + def end_group(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/yaml.rb:43 + def end_line(kind); end + + # pkg:gem/coderay#lib/coderay/encoders/yaml.rb:27 + def text_token(text, kind); end + + protected + + # pkg:gem/coderay#lib/coderay/encoders/yaml.rb:22 + def finish(options); end + + # pkg:gem/coderay#lib/coderay/encoders/yaml.rb:16 + def setup(options); end +end + +# pkg:gem/coderay#lib/coderay/encoders/yaml.rb:13 +CodeRay::Encoders::YAML::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# = FileType +# +# A simple filetype recognizer. +# +# == Usage +# +# # determine the type of the given +# lang = FileType[file_name] +# +# # return :text if the file type is unknown +# lang = FileType.fetch file_name, :text +# +# # try the shebang line, too +# lang = FileType.fetch file_name, :text, true +# +# pkg:gem/coderay#lib/coderay/helpers/file_type.rb:17 +module CodeRay::FileType + class << self + # Try to determine the file type of the file. + # + # +filename+ is a relative or absolute path to a file. + # + # The file itself is only accessed when +read_shebang+ is set to true. + # That means you can get filetypes from files that don't exist. + # + # pkg:gem/coderay#lib/coderay/helpers/file_type.rb:29 + def [](filename, read_shebang = T.unsafe(nil)); end + + # This works like Hash#fetch. + # + # If the filetype cannot be found, the +default+ value + # is returned. + # + # pkg:gem/coderay#lib/coderay/helpers/file_type.rb:50 + def fetch(filename, default = T.unsafe(nil), read_shebang = T.unsafe(nil)); end + + protected + + # pkg:gem/coderay#lib/coderay/helpers/file_type.rb:66 + def type_from_shebang(filename); end + end +end + +# pkg:gem/coderay#lib/coderay/helpers/file_type.rb:79 +CodeRay::FileType::TypeFromExt = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/helpers/file_type.rb:139 +CodeRay::FileType::TypeFromName = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/helpers/file_type.rb:137 +CodeRay::FileType::TypeFromShebang = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/helpers/file_type.rb:19 +class CodeRay::FileType::UnknownFileType < ::Exception; end + +# = Plugin +# +# Plugins have to include this module. +# +# IMPORTANT: Use extend for this module. +# +# See CodeRay::PluginHost for examples. +# +# pkg:gem/coderay#lib/coderay/helpers/plugin.rb:10 +module CodeRay::Plugin + # pkg:gem/coderay#lib/coderay/helpers/plugin.rb:46 + def aliases; end + + # The PluginHost for this Plugin class. + # + # pkg:gem/coderay#lib/coderay/helpers/plugin.rb:39 + def plugin_host(host = T.unsafe(nil)); end + + # pkg:gem/coderay#lib/coderay/helpers/plugin.rb:12 + def plugin_id; end + + # Register this class for the given +id+. + # + # Example: + # class MyPlugin < PluginHost::BaseClass + # register_for :my_id + # ... + # end + # + # See PluginHost.register. + # + # pkg:gem/coderay#lib/coderay/helpers/plugin.rb:23 + def register_for(id); end + + # Returns the title of the plugin, or sets it to the + # optional argument +title+. + # + # pkg:gem/coderay#lib/coderay/helpers/plugin.rb:30 + def title(title = T.unsafe(nil)); end +end + +# = PluginHost +# +# A simple subclass/subfolder plugin system. +# +# Example: +# class Generators +# extend PluginHost +# plugin_path 'app/generators' +# end +# +# class Generator +# extend Plugin +# PLUGIN_HOST = Generators +# end +# +# class FancyGenerator < Generator +# register_for :fancy +# end +# +# Generators[:fancy] #-> FancyGenerator +# # or +# CodeRay.require_plugin 'Generators/fancy' +# # or +# Generators::Fancy +# +# pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:27 +module CodeRay::PluginHost + # Returns the Plugin for +id+. + # + # Example: + # yaml_plugin = MyPluginHost[:yaml] + # + # pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:49 + def [](id, *args, &blk); end + + # Returns an array of all Plugins. + # + # Note: This loads all plugins using load_all. + # + # pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:151 + def all_plugins; end + + # Tries to +load+ the missing plugin by translating +const+ to the + # underscore form (eg. LinesOfCode becomes lines_of_code). + # + # pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:61 + def const_missing(const); end + + # Define the default plugin to use when no plugin is found + # for a given id, or return the default plugin. + # + # See also map. + # + # class MyColorHost < PluginHost + # map :navy => :dark_blue + # default :gray + # end + # + # MyColorHost.default # loads and returns the Gray plugin + # + # pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:114 + def default(id = T.unsafe(nil)); end + + # Returns an array of all .rb files in the plugin path. + # + # The extension .rb is not included. + # + # pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:140 + def list; end + + # pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:57 + def load(id, *args, &blk); end + + # Loads all plugins using list and load. + # + # pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:39 + def load_all; end + + # Loads the map file (see map). + # + # This is done automatically when plugin_path is called. + # + # pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:159 + def load_plugin_map; end + + # Map a plugin_id to another. + # + # Usage: Put this in a file plugin_path/_map.rb. + # + # class MyColorHost < PluginHost + # map :navy => :dark_blue, + # :maroon => :brown, + # :luna => :moon + # end + # + # pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:95 + def map(hash); end + + # A Hash of plugion_id => Plugin pairs. + # + # pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:133 + def plugin_hash; end + + # The path where the plugins can be found. + # + # pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:79 + def plugin_path(*args); end + + # Every plugin must register itself for +id+ by calling register_for, + # which calls this method. + # + # See Plugin#register_for. + # + # pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:128 + def register(plugin, id); end + + protected + + # Return a plugin hash that automatically loads plugins. + # + # pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:172 + def make_plugin_hash; end + + # Returns the expected path to the plugin file for the given id. + # + # pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:196 + def path_to(plugin_id); end + + # Converts +id+ to a valid plugin ID String, or returns +nil+. + # + # Raises +ArgumentError+ for all other objects, or if the + # given String includes non-alphanumeric characters (\W). + # + # pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:204 + def validate_id(id); end + + class << self + # Adds the module/class to the PLUGIN_HOSTS list. + # + # pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:72 + def extended(mod); end + end +end + +# pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:33 +class CodeRay::PluginHost::HostNotFound < ::LoadError; end + +# pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:35 +CodeRay::PluginHost::PLUGIN_HOSTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:36 +CodeRay::PluginHost::PLUGIN_HOSTS_BY_ID = T.let(T.unsafe(nil), Hash) + +# Raised if Encoders::[] fails because: +# * a file could not be found +# * the requested Plugin is not registered +# +# pkg:gem/coderay#lib/coderay/helpers/plugin_host.rb:32 +class CodeRay::PluginHost::PluginNotFound < ::LoadError; end + +# = Scanners +# +# This module holds the Scanner class and its subclasses. +# For example, the Ruby scanner is named CodeRay::Scanners::Ruby +# can be found in coderay/scanners/ruby. +# +# Scanner also provides methods and constants for the register +# mechanism and the [] method that returns the Scanner class +# belonging to the given lang. +# +# See PluginHost. +# +# pkg:gem/coderay#lib/coderay/scanners.rb:18 +module CodeRay::Scanners + extend ::CodeRay::PluginHost +end + +# Scanner for C. +# +# pkg:gem/coderay#lib/coderay/scanners/c.rb:5 +class CodeRay::Scanners::C < ::CodeRay::Scanners::Scanner + protected + + # pkg:gem/coderay#lib/coderay/scanners/c.rb:44 + def scan_tokens(encoder, options); end +end + +# pkg:gem/coderay#lib/coderay/scanners/c.rb:27 +CodeRay::Scanners::C::DIRECTIVES = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/c.rb:39 +CodeRay::Scanners::C::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/c.rb:33 +CodeRay::Scanners::C::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# pkg:gem/coderay#lib/coderay/scanners/c.rb:10 +CodeRay::Scanners::C::KEYWORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/c.rb:23 +CodeRay::Scanners::C::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/c.rb:17 +CodeRay::Scanners::C::PREDEFINED_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/c.rb:40 +CodeRay::Scanners::C::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Scanner for C++. +# +# Aliases: +cplusplus+, c++ +CodeRay::Scanners::CPlusPlus = CodeRay::Scanners::Text + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:4 +class CodeRay::Scanners::CSS < ::CodeRay::Scanners::Scanner + protected + + # pkg:gem/coderay#lib/coderay/scanners/css.rb:55 + def scan_tokens(encoder, options); end + + # pkg:gem/coderay#lib/coderay/scanners/css.rb:50 + def setup; end +end + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:8 +CodeRay::Scanners::CSS::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:16 +module CodeRay::Scanners::CSS::RE; end + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:31 +CodeRay::Scanners::CSS::RE::AtKeyword = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:45 +CodeRay::Scanners::CSS::RE::AttributeSelector = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:43 +CodeRay::Scanners::CSS::RE::Class = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:38 +CodeRay::Scanners::CSS::RE::Dimension = T.let(T.unsafe(nil), Regexp) + +# differs from standard because it allows uppercase hex too +# +# pkg:gem/coderay#lib/coderay/scanners/css.rb:19 +CodeRay::Scanners::CSS::RE::Escape = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:40 +CodeRay::Scanners::CSS::RE::Function = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:17 +CodeRay::Scanners::CSS::RE::Hex = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:26 +CodeRay::Scanners::CSS::RE::HexColor = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:42 +CodeRay::Scanners::CSS::RE::Id = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:30 +CodeRay::Scanners::CSS::RE::Ident = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:20 +CodeRay::Scanners::CSS::RE::NMChar = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:21 +CodeRay::Scanners::CSS::RE::NMStart = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:29 +CodeRay::Scanners::CSS::RE::Name = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:28 +CodeRay::Scanners::CSS::RE::Num = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:32 +CodeRay::Scanners::CSS::RE::Percentage = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:44 +CodeRay::Scanners::CSS::RE::PseudoClass = T.let(T.unsafe(nil), Regexp) + +# TODO: buggy regexp +# +# pkg:gem/coderay#lib/coderay/scanners/css.rb:24 +CodeRay::Scanners::CSS::RE::String = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:22 +CodeRay::Scanners::CSS::RE::String1 = T.let(T.unsafe(nil), Regexp) + +# TODO: buggy regexp +# +# pkg:gem/coderay#lib/coderay/scanners/css.rb:23 +CodeRay::Scanners::CSS::RE::String2 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:18 +CodeRay::Scanners::CSS::RE::Unicode = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/css.rb:36 +CodeRay::Scanners::CSS::RE::Unit = T.let(T.unsafe(nil), Regexp) + +# Clojure scanner by Licenser. +# +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:6 +class CodeRay::Scanners::Clojure < ::CodeRay::Scanners::Scanner + protected + + # pkg:gem/coderay#lib/coderay/scanners/clojure.rb:145 + def scan_tokens(encoder, options); end +end + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:95 +CodeRay::Scanners::Clojure::BASIC_IDENTIFIER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:133 +CodeRay::Scanners::Clojure::COMPLEX10 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:134 +CodeRay::Scanners::Clojure::COMPLEX16 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:136 +CodeRay::Scanners::Clojure::COMPLEX2 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:135 +CodeRay::Scanners::Clojure::COMPLEX8 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:16 +CodeRay::Scanners::Clojure::CORE_FORMS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:120 +CodeRay::Scanners::Clojure::DECIMAL = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:98 +CodeRay::Scanners::Clojure::DIGIT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:99 +CodeRay::Scanners::Clojure::DIGIT10 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:100 +CodeRay::Scanners::Clojure::DIGIT16 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:102 +CodeRay::Scanners::Clojure::DIGIT2 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:101 +CodeRay::Scanners::Clojure::DIGIT8 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:107 +CodeRay::Scanners::Clojure::EXACTNESS = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:110 +CodeRay::Scanners::Clojure::EXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:109 +CodeRay::Scanners::Clojure::EXP_MARK = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:96 +CodeRay::Scanners::Clojure::IDENTIFIER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:85 +CodeRay::Scanners::Clojure::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:129 +CodeRay::Scanners::Clojure::IMAG10 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:130 +CodeRay::Scanners::Clojure::IMAG16 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:132 +CodeRay::Scanners::Clojure::IMAG2 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:131 +CodeRay::Scanners::Clojure::IMAG8 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:90 +CodeRay::Scanners::Clojure::KEYWORD_NEXT_TOKEN_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:141 +CodeRay::Scanners::Clojure::NUM = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:137 +CodeRay::Scanners::Clojure::NUM10 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:138 +CodeRay::Scanners::Clojure::NUM16 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:140 +CodeRay::Scanners::Clojure::NUM2 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:139 +CodeRay::Scanners::Clojure::NUM8 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:78 +CodeRay::Scanners::Clojure::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:112 +CodeRay::Scanners::Clojure::PREFIX10 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:113 +CodeRay::Scanners::Clojure::PREFIX16 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:115 +CodeRay::Scanners::Clojure::PREFIX2 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:114 +CodeRay::Scanners::Clojure::PREFIX8 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:106 +CodeRay::Scanners::Clojure::RADIX10 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:103 +CodeRay::Scanners::Clojure::RADIX16 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:105 +CodeRay::Scanners::Clojure::RADIX2 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:104 +CodeRay::Scanners::Clojure::RADIX8 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:125 +CodeRay::Scanners::Clojure::REAL10 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:126 +CodeRay::Scanners::Clojure::REAL16 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:128 +CodeRay::Scanners::Clojure::REAL2 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:127 +CodeRay::Scanners::Clojure::REAL8 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:108 +CodeRay::Scanners::Clojure::SIGN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:11 +CodeRay::Scanners::Clojure::SPECIAL_FORMS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:111 +CodeRay::Scanners::Clojure::SUFFIX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:97 +CodeRay::Scanners::Clojure::SYMBOL = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:116 +CodeRay::Scanners::Clojure::UINT10 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:117 +CodeRay::Scanners::Clojure::UINT16 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:119 +CodeRay::Scanners::Clojure::UINT2 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:118 +CodeRay::Scanners::Clojure::UINT8 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:121 +CodeRay::Scanners::Clojure::UREAL10 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:122 +CodeRay::Scanners::Clojure::UREAL16 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:124 +CodeRay::Scanners::Clojure::UREAL2 = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/clojure.rb:123 +CodeRay::Scanners::Clojure::UREAL8 = T.let(T.unsafe(nil), Regexp) + +# = Debug Scanner +# +# Interprets the output of the Encoders::Debug encoder (basically the inverse function). +# +# pkg:gem/coderay#lib/coderay/scanners/debug.rb:9 +class CodeRay::Scanners::Debug < ::CodeRay::Scanners::Scanner + protected + + # pkg:gem/coderay#lib/coderay/scanners/debug.rb:21 + def scan_tokens(encoder, options); end + + # pkg:gem/coderay#lib/coderay/scanners/debug.rb:16 + def setup; end +end + +# Scanner for the Delphi language (Object Pascal). +# +# Alias: +pascal+ +# +# pkg:gem/coderay#lib/coderay/scanners/delphi.rb:7 +class CodeRay::Scanners::Delphi < ::CodeRay::Scanners::Scanner + protected + + # pkg:gem/coderay#lib/coderay/scanners/delphi.rb:45 + def scan_tokens(encoder, options); end +end + +# pkg:gem/coderay#lib/coderay/scanners/delphi.rb:25 +CodeRay::Scanners::Delphi::DIRECTIVES = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/delphi.rb:36 +CodeRay::Scanners::Delphi::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring) + +# pkg:gem/coderay#lib/coderay/scanners/delphi.rb:12 +CodeRay::Scanners::Delphi::KEYWORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/delphi.rb:40 +CodeRay::Scanners::Delphi::NAME_FOLLOWS = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring) + +# Scanner for output of the diff command. +# +# Alias: +patch+ +# +# pkg:gem/coderay#lib/coderay/scanners/diff.rb:7 +class CodeRay::Scanners::Diff < ::CodeRay::Scanners::Scanner + protected + + # pkg:gem/coderay#lib/coderay/scanners/diff.rb:19 + def scan_tokens(encoder, options); end + + private + + # pkg:gem/coderay#lib/coderay/scanners/diff.rb:204 + def diff(a, b); end +end + +# pkg:gem/coderay#lib/coderay/scanners/diff.rb:12 +CodeRay::Scanners::Diff::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# Scanner for HTML ERB templates. +# +# pkg:gem/coderay#lib/coderay/scanners/erb.rb:8 +class CodeRay::Scanners::ERB < ::CodeRay::Scanners::Scanner + protected + + # pkg:gem/coderay#lib/coderay/scanners/erb.rb:38 + def reset_instance; end + + # pkg:gem/coderay#lib/coderay/scanners/erb.rb:43 + def scan_tokens(encoder, options); end + + # pkg:gem/coderay#lib/coderay/scanners/erb.rb:33 + def setup; end +end + +# pkg:gem/coderay#lib/coderay/scanners/erb.rb:15 +CodeRay::Scanners::ERB::ERB_RUBY_BLOCK = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/erb.rb:13 +CodeRay::Scanners::ERB::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/erb.rb:27 +CodeRay::Scanners::ERB::START_OF_ERB = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/go.rb:4 +class CodeRay::Scanners::Go < ::CodeRay::Scanners::Scanner + protected + + # pkg:gem/coderay#lib/coderay/scanners/go.rb:50 + def scan_tokens(encoder, options); end +end + +# pkg:gem/coderay#lib/coderay/scanners/go.rb:45 +CodeRay::Scanners::Go::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/go.rb:39 +CodeRay::Scanners::Go::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# http://golang.org/ref/spec#Keywords +# +# pkg:gem/coderay#lib/coderay/scanners/go.rb:10 +CodeRay::Scanners::Go::KEYWORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/go.rb:29 +CodeRay::Scanners::Go::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/go.rb:34 +CodeRay::Scanners::Go::PREDEFINED_FUNCTIONS = T.let(T.unsafe(nil), Array) + +# http://golang.org/ref/spec#Types +# +# pkg:gem/coderay#lib/coderay/scanners/go.rb:19 +CodeRay::Scanners::Go::PREDEFINED_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/go.rb:46 +CodeRay::Scanners::Go::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Scanner for Groovy. +# +# pkg:gem/coderay#lib/coderay/scanners/groovy.rb:7 +class CodeRay::Scanners::Groovy < ::CodeRay::Scanners::Java + protected + + # pkg:gem/coderay#lib/coderay/scanners/groovy.rb:43 + def scan_tokens(encoder, options); end + + # pkg:gem/coderay#lib/coderay/scanners/groovy.rb:39 + def setup; end +end + +# pkg:gem/coderay#lib/coderay/scanners/groovy.rb:24 +CodeRay::Scanners::Groovy::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# TODO: check list of keywords +# +# pkg:gem/coderay#lib/coderay/scanners/groovy.rb:12 +CodeRay::Scanners::Groovy::GROOVY_KEYWORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/groovy.rb:18 +CodeRay::Scanners::Groovy::GROOVY_MAGIC_VARIABLES = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/groovy.rb:20 +CodeRay::Scanners::Groovy::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# pkg:gem/coderay#lib/coderay/scanners/groovy.rb:15 +CodeRay::Scanners::Groovy::KEYWORDS_EXPECTING_VALUE = T.let(T.unsafe(nil), CodeRay::WordList) + +# pkg:gem/coderay#lib/coderay/scanners/groovy.rb:26 +CodeRay::Scanners::Groovy::REGEXP_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# TODO: interpretation inside ', ", / +# +# pkg:gem/coderay#lib/coderay/scanners/groovy.rb:29 +CodeRay::Scanners::Groovy::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/scanners/groovy.rb:25 +CodeRay::Scanners::Groovy::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/haml.rb:8 +class CodeRay::Scanners::HAML < ::CodeRay::Scanners::Scanner + protected + + # pkg:gem/coderay#lib/coderay/scanners/haml.rb:24 + def scan_tokens(encoder, options); end + + # pkg:gem/coderay#lib/coderay/scanners/haml.rb:17 + def setup; end +end + +# pkg:gem/coderay#lib/coderay/scanners/haml.rb:13 +CodeRay::Scanners::HAML::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# HTML Scanner +# +# Alias: +xhtml+ +# +# See also: Scanners::XML +# +# pkg:gem/coderay#lib/coderay/scanners/html.rb:9 +class CodeRay::Scanners::HTML < ::CodeRay::Scanners::Scanner + # pkg:gem/coderay#lib/coderay/scanners/html.rb:62 + def reset; end + + protected + + # pkg:gem/coderay#lib/coderay/scanners/html.rb:83 + def scan_css(encoder, code, state = T.unsafe(nil)); end + + # pkg:gem/coderay#lib/coderay/scanners/html.rb:76 + def scan_java_script(encoder, code); end + + # pkg:gem/coderay#lib/coderay/scanners/html.rb:90 + def scan_tokens(encoder, options); end + + # pkg:gem/coderay#lib/coderay/scanners/html.rb:70 + def setup; end +end + +# pkg:gem/coderay#lib/coderay/scanners/html.rb:39 +CodeRay::Scanners::HTML::ATTR_NAME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/html.rb:42 +CodeRay::Scanners::HTML::ENTITY = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/html.rb:20 +CodeRay::Scanners::HTML::EVENT_ATTRIBUTES = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/html.rb:41 +CodeRay::Scanners::HTML::HEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/html.rb:35 +CodeRay::Scanners::HTML::IN_ATTRIBUTE = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring) + +# pkg:gem/coderay#lib/coderay/scanners/html.rb:13 +CodeRay::Scanners::HTML::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/html.rb:57 +CodeRay::Scanners::HTML::PLAIN_STRING_CONTENT = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/scanners/html.rb:40 +CodeRay::Scanners::HTML::TAG_END = T.let(T.unsafe(nil), Regexp) + +# Scanner for JSON (JavaScript Object Notation). +# +# pkg:gem/coderay#lib/coderay/scanners/json.rb:5 +class CodeRay::Scanners::JSON < ::CodeRay::Scanners::Scanner + protected + + # See http://json.org/ for a definition of the JSON lexic/grammar. + # + # pkg:gem/coderay#lib/coderay/scanners/json.rb:26 + def scan_tokens(encoder, options); end + + # pkg:gem/coderay#lib/coderay/scanners/json.rb:21 + def setup; end +end + +# pkg:gem/coderay#lib/coderay/scanners/json.rb:15 +CodeRay::Scanners::JSON::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/json.rb:17 +CodeRay::Scanners::JSON::KEY = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/json.rb:10 +CodeRay::Scanners::JSON::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/json.rb:16 +CodeRay::Scanners::JSON::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Scanner for Java. +# +# pkg:gem/coderay#lib/coderay/scanners/java.rb:5 +class CodeRay::Scanners::Java < ::CodeRay::Scanners::Scanner + protected + + # pkg:gem/coderay#lib/coderay/scanners/java.rb:51 + def scan_tokens(encoder, options); end +end + +# pkg:gem/coderay#lib/coderay/scanners/java/builtin_types.rb:4 +module CodeRay::Scanners::Java::BuiltinTypes; end + +# :nocov: +# +# pkg:gem/coderay#lib/coderay/scanners/java/builtin_types.rb:7 +CodeRay::Scanners::Java::BuiltinTypes::List = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/java.rb:19 +CodeRay::Scanners::Java::CONSTANTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/java.rb:25 +CodeRay::Scanners::Java::DIRECTIVES = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/java.rb:40 +CodeRay::Scanners::Java::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/java.rb:47 +CodeRay::Scanners::Java::IDENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/java.rb:30 +CodeRay::Scanners::Java::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html +# +# pkg:gem/coderay#lib/coderay/scanners/java.rb:12 +CodeRay::Scanners::Java::KEYWORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/java.rb:20 +CodeRay::Scanners::Java::MAGIC_VARIABLES = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/java.rb:18 +CodeRay::Scanners::Java::RESERVED = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/java.rb:42 +CodeRay::Scanners::Java::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/scanners/java.rb:21 +CodeRay::Scanners::Java::TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/java.rb:41 +CodeRay::Scanners::Java::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Scanner for JavaScript. +# +# Aliases: +ecmascript+, +ecma_script+, +javascript+ +# +# pkg:gem/coderay#lib/coderay/scanners/java_script.rb:7 +class CodeRay::Scanners::JavaScript < ::CodeRay::Scanners::Scanner + protected + + # pkg:gem/coderay#lib/coderay/scanners/java_script.rb:224 + def reset_instance; end + + # pkg:gem/coderay#lib/coderay/scanners/java_script.rb:61 + def scan_tokens(encoder, options); end + + # pkg:gem/coderay#lib/coderay/scanners/java_script.rb:57 + def setup; end + + # pkg:gem/coderay#lib/coderay/scanners/java_script.rb:229 + def xml_scanner; end +end + +# pkg:gem/coderay#lib/coderay/scanners/java_script.rb:42 +CodeRay::Scanners::JavaScript::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/java_script.rb:36 +CodeRay::Scanners::JavaScript::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# The actual JavaScript keywords. +# +# pkg:gem/coderay#lib/coderay/scanners/java_script.rb:13 +CodeRay::Scanners::JavaScript::KEYWORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/java_script.rb:24 +CodeRay::Scanners::JavaScript::KEYWORDS_EXPECTING_VALUE = T.let(T.unsafe(nil), CodeRay::WordList) + +# pkg:gem/coderay#lib/coderay/scanners/java_script.rb:50 +CodeRay::Scanners::JavaScript::KEY_CHECK_PATTERN = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/scanners/java_script.rb:22 +CodeRay::Scanners::JavaScript::MAGIC_VARIABLES = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/java_script.rb:18 +CodeRay::Scanners::JavaScript::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/java_script.rb:44 +CodeRay::Scanners::JavaScript::REGEXP_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Reserved for future use. +# +# pkg:gem/coderay#lib/coderay/scanners/java_script.rb:29 +CodeRay::Scanners::JavaScript::RESERVED_WORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/java_script.rb:45 +CodeRay::Scanners::JavaScript::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/scanners/java_script.rb:43 +CodeRay::Scanners::JavaScript::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Scanner for the Lua[http://lua.org] programming lanuage. +# +# The language’s complete syntax is defined in +# {the Lua manual}[http://www.lua.org/manual/5.2/manual.html], +# which is what this scanner tries to conform to. +# +# pkg:gem/coderay#lib/coderay/scanners/lua.rb:11 +class CodeRay::Scanners::Lua < ::CodeRay::Scanners::Scanner + protected + + # CodeRay entry hook. Starts parsing. + # + # pkg:gem/coderay#lib/coderay/scanners/lua.rb:60 + def scan_tokens(encoder, options); end + + # Scanner initialization. + # + # pkg:gem/coderay#lib/coderay/scanners/lua.rb:54 + def setup; end +end + +# Automatic token kind selection for normal words. +# +# pkg:gem/coderay#lib/coderay/scanners/lua.rb:46 +CodeRay::Scanners::Lua::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# Keywords used in Lua. +# +# pkg:gem/coderay#lib/coderay/scanners/lua.rb:18 +CodeRay::Scanners::Lua::KEYWORDS = T.let(T.unsafe(nil), Array) + +# Constants set by the Lua core. +# +# pkg:gem/coderay#lib/coderay/scanners/lua.rb:25 +CodeRay::Scanners::Lua::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# The expressions contained in this array are parts of Lua’s `basic' +# library. Although it’s not entirely necessary to load that library, +# it is highly recommended and one would have to provide own implementations +# of some of these expressions if one does not do so. They however aren’t +# keywords, neither are they constants, but nearly predefined, so they +# get tagged as `predefined' rather than anything else. +# +# This list excludes values of form `_UPPERCASE' because the Lua manual +# requires such identifiers to be reserved by Lua anyway and they are +# highlighted directly accordingly, without the need for specific +# identifiers to be listed here. +# +# pkg:gem/coderay#lib/coderay/scanners/lua.rb:38 +CodeRay::Scanners::Lua::PREDEFINED_EXPRESSIONS = T.let(T.unsafe(nil), Array) + +# Scanner for PHP. +# +# Original by Stefan Walk. +# +# pkg:gem/coderay#lib/coderay/scanners/php.rb:10 +class CodeRay::Scanners::PHP < ::CodeRay::Scanners::Scanner + protected + + # pkg:gem/coderay#lib/coderay/scanners/php.rb:23 + def reset_instance; end + + # pkg:gem/coderay#lib/coderay/scanners/php.rb:234 + def scan_tokens(encoder, options); end + + # pkg:gem/coderay#lib/coderay/scanners/php.rb:19 + def setup; end +end + +# pkg:gem/coderay#lib/coderay/scanners/php.rb:15 +CodeRay::Scanners::PHP::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/php.rb:197 +module CodeRay::Scanners::PHP::RE; end + +# pkg:gem/coderay#lib/coderay/scanners/php.rb:211 +CodeRay::Scanners::PHP::RE::HTML_INDICATOR = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/php.rb:213 +CodeRay::Scanners::PHP::RE::IDENTIFIER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/php.rb:216 +CodeRay::Scanners::PHP::RE::OPERATOR = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/php.rb:206 +CodeRay::Scanners::PHP::RE::PHP_END = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/php.rb:199 +CodeRay::Scanners::PHP::RE::PHP_START = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/php.rb:214 +CodeRay::Scanners::PHP::RE::VARIABLE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/php.rb:28 +module CodeRay::Scanners::PHP::Words; end + +# according to http://php.net/quickref.php on 2009-04-21; +# all functions with _ excluded (module functions) and selected additional functions +# +# pkg:gem/coderay#lib/coderay/scanners/php.rb:50 +CodeRay::Scanners::PHP::Words::BUILTIN_FUNCTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/php.rb:46 +CodeRay::Scanners::PHP::Words::CLASSES = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/php.rb:145 +CodeRay::Scanners::PHP::Words::CONSTANTS = T.let(T.unsafe(nil), Array) + +# TODO: more built-in PHP functions? +# +# pkg:gem/coderay#lib/coderay/scanners/php.rb:140 +CodeRay::Scanners::PHP::Words::EXCEPTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/php.rb:184 +CodeRay::Scanners::PHP::Words::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring) + +# according to http://www.php.net/manual/en/reserved.keywords.php +# +# pkg:gem/coderay#lib/coderay/scanners/php.rb:31 +CodeRay::Scanners::PHP::Words::KEYWORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/php.rb:41 +CodeRay::Scanners::PHP::Words::LANGUAGE_CONSTRUCTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/php.rb:178 +CodeRay::Scanners::PHP::Words::PREDEFINED = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/php.rb:39 +CodeRay::Scanners::PHP::Words::TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/php.rb:193 +CodeRay::Scanners::PHP::Words::VARIABLE_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# Scanner for Python. Supports Python 3. +# +# Based on pygments' PythonLexer, see +# http://dev.pocoo.org/projects/pygments/browser/pygments/lexers/agile.py. +# +# pkg:gem/coderay#lib/coderay/scanners/python.rb:8 +class CodeRay::Scanners::Python < ::CodeRay::Scanners::Scanner + protected + + # pkg:gem/coderay#lib/coderay/scanners/python.rb:103 + def scan_tokens(encoder, options); end +end + +# pkg:gem/coderay#lib/coderay/scanners/python.rb:86 +CodeRay::Scanners::Python::DEF_NEW_STATE = T.let(T.unsafe(nil), CodeRay::WordList) + +# pkg:gem/coderay#lib/coderay/scanners/python.rb:91 +CodeRay::Scanners::Python::DESCRIPTOR = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/python.rb:97 +CodeRay::Scanners::Python::DOCSTRING_COMING = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/python.rb:65 +CodeRay::Scanners::Python::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/python.rb:57 +CodeRay::Scanners::Python::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# pkg:gem/coderay#lib/coderay/scanners/python.rb:13 +CodeRay::Scanners::Python::KEYWORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/python.rb:64 +CodeRay::Scanners::Python::NAME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/python.rb:21 +CodeRay::Scanners::Python::OLD_KEYWORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/python.rb:68 +CodeRay::Scanners::Python::OPERATOR = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/python.rb:37 +CodeRay::Scanners::Python::PREDEFINED_EXCEPTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/python.rb:25 +CodeRay::Scanners::Python::PREDEFINED_METHODS_AND_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/python.rb:52 +CodeRay::Scanners::Python::PREDEFINED_VARIABLES_AND_CONSTANTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/python.rb:82 +CodeRay::Scanners::Python::STRING_CONTENT_REGEXP = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/scanners/python.rb:78 +CodeRay::Scanners::Python::STRING_DELIMITER_REGEXP = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/scanners/python.rb:66 +CodeRay::Scanners::Python::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# = Raydebug Scanner +# +# Highlights the output of the Encoders::Debug encoder. +# +# pkg:gem/coderay#lib/coderay/scanners/raydebug.rb:9 +class CodeRay::Scanners::Raydebug < ::CodeRay::Scanners::Scanner + protected + + # pkg:gem/coderay#lib/coderay/scanners/raydebug.rb:22 + def scan_tokens(encoder, options); end + + # pkg:gem/coderay#lib/coderay/scanners/raydebug.rb:17 + def setup; end +end + +# This scanner is really complex, since Ruby _is_ a complex language! +# +# It tries to highlight 100% of all common code, +# and 90% of strange codes. +# +# It is optimized for HTML highlighting, and is not very useful for +# parsing or pretty printing. +# +# pkg:gem/coderay#lib/coderay/scanners/ruby.rb:11 +class CodeRay::Scanners::Ruby < ::CodeRay::Scanners::Scanner + # pkg:gem/coderay#lib/coderay/scanners/ruby.rb:19 + def interpreted_string_state; end + + protected + + # pkg:gem/coderay#lib/coderay/scanners/ruby.rb:29 + def scan_tokens(encoder, options); end + + # pkg:gem/coderay#lib/coderay/scanners/ruby.rb:25 + def setup; end +end + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:5 +module CodeRay::Scanners::Ruby::Patterns; end + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:72 +CodeRay::Scanners::Ruby::Patterns::BINARY = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:106 +CodeRay::Scanners::Ruby::Patterns::CHARACTER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:55 +CodeRay::Scanners::Ruby::Patterns::CLASS_VARIABLE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:96 +CodeRay::Scanners::Ruby::Patterns::CONTROL_META_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:132 +CodeRay::Scanners::Ruby::Patterns::DATA = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:69 +CodeRay::Scanners::Ruby::Patterns::DECIMAL = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:102 +CodeRay::Scanners::Ruby::Patterns::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:74 +CodeRay::Scanners::Ruby::Patterns::EXPONENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:168 +CodeRay::Scanners::Ruby::Patterns::FANCY_STRING_INTERPRETED = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:161 +CodeRay::Scanners::Ruby::Patterns::FANCY_STRING_KIND = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:160 +CodeRay::Scanners::Ruby::Patterns::FANCY_STRING_START = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:76 +CodeRay::Scanners::Ruby::Patterns::FLOAT_OR_INT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:75 +CodeRay::Scanners::Ruby::Patterns::FLOAT_SUFFIX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:57 +CodeRay::Scanners::Ruby::Patterns::GLOBAL_VARIABLE = T.let(T.unsafe(nil), Regexp) + +# NOTE: This is not completely correct, but +# nobody needs heredoc delimiters ending with \n. +# +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:116 +CodeRay::Scanners::Ruby::Patterns::HEREDOC_OPEN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:71 +CodeRay::Scanners::Ruby::Patterns::HEXADECIMAL = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:38 +CodeRay::Scanners::Ruby::Patterns::IDENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:28 +CodeRay::Scanners::Ruby::Patterns::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:54 +CodeRay::Scanners::Ruby::Patterns::INSTANCE_VARIABLE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:7 +CodeRay::Scanners::Ruby::Patterns::KEYWORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:151 +CodeRay::Scanners::Ruby::Patterns::KEYWORDS_EXPECTING_VALUE = T.let(T.unsafe(nil), CodeRay::WordList) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:32 +CodeRay::Scanners::Ruby::Patterns::KEYWORD_NEW_STATE = T.let(T.unsafe(nil), CodeRay::WordList) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:53 +CodeRay::Scanners::Ruby::Patterns::METHOD_AFTER_DOT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:40 +CodeRay::Scanners::Ruby::Patterns::METHOD_NAME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:52 +CodeRay::Scanners::Ruby::Patterns::METHOD_NAME_EX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:41 +CodeRay::Scanners::Ruby::Patterns::METHOD_NAME_OPERATOR = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:87 +CodeRay::Scanners::Ruby::Patterns::METHOD_NAME_OR_SYMBOL = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:51 +CodeRay::Scanners::Ruby::Patterns::METHOD_SUFFIX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:77 +CodeRay::Scanners::Ruby::Patterns::NUMERIC = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:56 +CodeRay::Scanners::Ruby::Patterns::OBJECT_VARIABLE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:70 +CodeRay::Scanners::Ruby::Patterns::OCTAL = T.let(T.unsafe(nil), Regexp) + +# See http://murfy.de/ruby-constants. +# +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:17 +CodeRay::Scanners::Ruby::Patterns::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:58 +CodeRay::Scanners::Ruby::Patterns::PREFIX_VARIABLE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:61 +CodeRay::Scanners::Ruby::Patterns::QUOTE_TO_TYPE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:67 +CodeRay::Scanners::Ruby::Patterns::REGEXP_MODIFIERS = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:126 +CodeRay::Scanners::Ruby::Patterns::RUBYDOC = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:138 +CodeRay::Scanners::Ruby::Patterns::RUBYDOC_OR_DATA = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:89 +CodeRay::Scanners::Ruby::Patterns::SIMPLE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:79 +CodeRay::Scanners::Ruby::Patterns::SYMBOL = T.let(T.unsafe(nil), Regexp) + +# Checks for a valid value to follow. This enables +# value_expected in method calls without parentheses. +# +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:142 +CodeRay::Scanners::Ruby::Patterns::VALUE_FOLLOWS = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/patterns.rb:59 +CodeRay::Scanners::Ruby::Patterns::VARIABLE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/ruby/string_state.rb:8 +class CodeRay::Scanners::Ruby::StringState < ::Struct + # pkg:gem/coderay#lib/coderay/scanners/ruby/string_state.rb:48 + def initialize(kind, interpreted, delim, heredoc = T.unsafe(nil)); end + + # pkg:gem/coderay#lib/coderay/scanners/ruby/string_state.rb:63 + def heredoc_pattern(delim, interpreted, indented); end + + class << self + # pkg:gem/coderay#lib/coderay/scanners/ruby/string_state.rb:40 + def simple_key_pattern(delim); end + end +end + +# pkg:gem/coderay#lib/coderay/scanners/ruby/string_state.rb:10 +CodeRay::Scanners::Ruby::StringState::CLOSING_PAREN = T.let(T.unsafe(nil), Hash) + +# debug, if I try to change it with << +# +# pkg:gem/coderay#lib/coderay/scanners/ruby/string_state.rb:17 +CodeRay::Scanners::Ruby::StringState::STRING_PATTERN = T.let(T.unsafe(nil), Hash) + +# by Josh Goebel +# +# pkg:gem/coderay#lib/coderay/scanners/sql.rb:5 +class CodeRay::Scanners::SQL < ::CodeRay::Scanners::Scanner + # pkg:gem/coderay#lib/coderay/scanners/sql.rb:66 + def scan_tokens(encoder, options); end +end + +# pkg:gem/coderay#lib/coderay/scanners/sql.rb:23 +CodeRay::Scanners::SQL::COMMANDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/sql.rb:38 +CodeRay::Scanners::SQL::DIRECTIVES = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/sql.rb:55 +CodeRay::Scanners::SQL::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/sql.rb:46 +CodeRay::Scanners::SQL::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring) + +# pkg:gem/coderay#lib/coderay/scanners/sql.rb:9 +CodeRay::Scanners::SQL::KEYWORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/sql.rb:18 +CodeRay::Scanners::SQL::OBJECTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/sql.rb:44 +CodeRay::Scanners::SQL::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/sql.rb:36 +CodeRay::Scanners::SQL::PREDEFINED_FUNCTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/sql.rb:28 +CodeRay::Scanners::SQL::PREDEFINED_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/scanners/sql.rb:60 +CodeRay::Scanners::SQL::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/scanners/sql.rb:58 +CodeRay::Scanners::SQL::STRING_PREFIXES = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/coderay#lib/coderay/scanners/sql.rb:56 +CodeRay::Scanners::SQL::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# A scanner for Sass. +# +# pkg:gem/coderay#lib/coderay/scanners/sass.rb:5 +class CodeRay::Scanners::Sass < ::CodeRay::Scanners::CSS + protected + + # pkg:gem/coderay#lib/coderay/scanners/sass.rb:16 + def scan_tokens(encoder, options); end + + # pkg:gem/coderay#lib/coderay/scanners/sass.rb:12 + def setup; end +end + +# = Scanner +# +# The base class for all Scanners. +# +# It is a subclass of Ruby's great +StringScanner+, which +# makes it easy to access the scanning methods inside. +# +# It is also +Enumerable+, so you can use it like an Array of +# Tokens: +# +# require 'coderay' +# +# c_scanner = CodeRay::Scanners[:c].new "if (*p == '{') nest++;" +# +# for text, kind in c_scanner +# puts text if kind == :operator +# end +# +# # prints: (*==)++; +# +# OK, this is a very simple example :) +# You can also use +map+, +any?+, +find+ and even +sort_by+, +# if you want. +# +# pkg:gem/coderay#lib/coderay/scanners/scanner.rb:29 +class CodeRay::Scanners::Scanner < ::StringScanner + include ::Enumerable + extend ::CodeRay::Plugin + + # Create a new Scanner. + # + # * +code+ is the input String and is handled by the superclass + # StringScanner. + # * +options+ is a Hash with Symbols as keys. + # It is merged with the default options of the class (you can + # overwrite default options here.) + # + # Else, a Tokens object is used. + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:125 + def initialize(code = T.unsafe(nil), options = T.unsafe(nil)); end + + # The string in binary encoding. + # + # To be used with #pos, which is the index of the byte the scanner + # will scan next. + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:218 + def binary_string; end + + # The current column position of the scanner, starting with 1. + # See also: #line. + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:209 + def column(pos = T.unsafe(nil)); end + + # Traverse the tokens. + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:192 + def each(&block); end + + # the default file extension for this scanner + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:160 + def file_extension; end + + # the Plugin ID for this scanner + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:155 + def lang; end + + # The current line position of the scanner, starting with 1. + # See also: #column. + # + # Beware, this is implemented inefficiently. It should be used + # for debugging only. + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:202 + def line(pos = T.unsafe(nil)); end + + # Sets back the scanner. Subclasses should redefine the reset_instance + # method instead of this one. + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:142 + def reset; end + + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:44 + def state; end + + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:44 + def state=(_arg0); end + + # Set a new string to be scanned. + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:148 + def string=(code); end + + # Scan the code and returns all tokens in a Tokens object. + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:165 + def tokenize(source = T.unsafe(nil), options = T.unsafe(nil)); end + + # Cache the result of tokenize. + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:187 + def tokens; end + + protected + + # Scanner error with additional status information + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:314 + def raise_inspect(message, tokens, state = T.unsafe(nil), ambit = T.unsafe(nil), backtrace = T.unsafe(nil)); end + + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:289 + def raise_inspect_arguments(message, tokens, state, ambit); end + + # Resets the scanner. + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:265 + def reset_instance; end + + # Shorthand for scan_until(/\z/). + # This method also avoids a JRuby 1.9 mode bug. + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:328 + def scan_rest; end + + # This is the central method, and commonly the only one a + # subclass implements. + # + # Subclasses must implement this method; it must return +tokens+ + # and must only use Tokens#<< for storing scanned tokens! + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:260 + def scan_tokens(tokens, options); end + + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:305 + def scanner_state_info(state); end + + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:239 + def set_string_from_source(source); end + + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:250 + def set_tokens_from_options(options); end + + # Can be implemented by subclasses to do some initialization + # that has to be done once per instance. + # + # Use reset for initialization that has to be done once per + # scan. + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:236 + def setup; end + + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:322 + def tokens_last(tokens, n); end + + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:318 + def tokens_size(tokens); end + + class << self + # The encoding used internally by this scanner. + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:71 + def encoding(name = T.unsafe(nil)); end + + # The typical filename suffix for this scanner's language. + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:66 + def file_extension(extension = T.unsafe(nil)); end + + # The lang of this Scanner class, which is equal to its Plugin ID. + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:76 + def lang; end + + # Normalizes the given code into a string with UNIX newlines, in the + # scanner's internal encoding, with invalid and undefined charachters + # replaced by placeholders. Always returns a new object. + # + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:51 + def normalize(code); end + + protected + + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:82 + def encode_with_encoding(code, target_encoding); end + + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:100 + def guess_encoding(s); end + + # pkg:gem/coderay#lib/coderay/scanners/scanner.rb:96 + def to_unix(code); end + end +end + +# The default options for all scanner classes. +# +# Define @default_options for subclasses. +# +# pkg:gem/coderay#lib/coderay/scanners/scanner.rb:40 +CodeRay::Scanners::Scanner::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/scanners/scanner.rb:42 +CodeRay::Scanners::Scanner::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# pkg:gem/coderay#lib/coderay/helpers/plugin.rb:41 +CodeRay::Scanners::Scanner::PLUGIN_HOST = CodeRay::Scanners + +# pkg:gem/coderay#lib/coderay/scanners/scanner.rb:299 +CodeRay::Scanners::Scanner::SCANNER_STATE_INFO = T.let(T.unsafe(nil), String) + +# pkg:gem/coderay#lib/coderay/scanners/scanner.rb:271 +CodeRay::Scanners::Scanner::SCAN_ERROR_MESSAGE = T.let(T.unsafe(nil), String) + +# Raised if a Scanner fails while scanning +# +# pkg:gem/coderay#lib/coderay/scanners/scanner.rb:35 +class CodeRay::Scanners::Scanner::ScanError < ::StandardError; end + +# pkg:gem/coderay#lib/coderay/scanners/taskpaper.rb:4 +class CodeRay::Scanners::Taskpaper < ::CodeRay::Scanners::Scanner + protected + + # pkg:gem/coderay#lib/coderay/scanners/taskpaper.rb:11 + def scan_tokens(encoder, options); end +end + +# Scanner for plain text. +# +# Yields just one token of the kind :plain. +# +# Alias: +plaintext+, +plain+ +# +# pkg:gem/coderay#lib/coderay/scanners/text.rb:9 +class CodeRay::Scanners::Text < ::CodeRay::Scanners::Scanner + protected + + # pkg:gem/coderay#lib/coderay/scanners/text.rb:18 + def scan_tokens(encoder, options); end +end + +# pkg:gem/coderay#lib/coderay/scanners/text.rb:14 +CodeRay::Scanners::Text::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# Scanner for XML. +# +# Currently this is the same scanner as Scanners::HTML. +# +# pkg:gem/coderay#lib/coderay/scanners/xml.rb:9 +class CodeRay::Scanners::XML < ::CodeRay::Scanners::HTML; end + +# Scanner for YAML. +# +# Based on the YAML scanner from Syntax by Jamis Buck. +# +# pkg:gem/coderay#lib/coderay/scanners/yaml.rb:7 +class CodeRay::Scanners::YAML < ::CodeRay::Scanners::Scanner + protected + + # pkg:gem/coderay#lib/coderay/scanners/yaml.rb:16 + def scan_tokens(encoder, options); end +end + +# pkg:gem/coderay#lib/coderay/scanners/yaml.rb:12 +CodeRay::Scanners::YAML::KINDS_NOT_LOC = T.let(T.unsafe(nil), Symbol) + +# This module holds the Style class and its subclasses. +# +# See Plugin. +# +# pkg:gem/coderay#lib/coderay/styles.rb:6 +module CodeRay::Styles + extend ::CodeRay::PluginHost +end + +# A colorful theme using CSS 3 colors (with alpha channel). +# +# pkg:gem/coderay#lib/coderay/styles/alpha.rb:5 +class CodeRay::Styles::Alpha < ::CodeRay::Styles::Style; end + +# pkg:gem/coderay#lib/coderay/styles/alpha.rb:14 +CodeRay::Styles::Alpha::CSS_MAIN_STYLES = T.let(T.unsafe(nil), String) + +# pkg:gem/coderay#lib/coderay/styles/alpha.rb:53 +CodeRay::Styles::Alpha::TOKEN_COLORS = T.let(T.unsafe(nil), String) + +# Base class for styles. +# +# Styles are used by Encoders::HTML to colorize tokens. +# +# pkg:gem/coderay#lib/coderay/styles/style.rb:8 +class CodeRay::Styles::Style + extend ::CodeRay::Plugin +end + +# pkg:gem/coderay#lib/coderay/styles/style.rb:12 +CodeRay::Styles::Style::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/coderay#lib/coderay/helpers/plugin.rb:41 +CodeRay::Styles::Style::PLUGIN_HOST = CodeRay::Styles + +# A Hash of all known token kinds and their associated CSS classes. +# +# pkg:gem/coderay#lib/coderay/token_kinds.rb:4 +CodeRay::TokenKinds = T.let(T.unsafe(nil), Hash) + +# The Tokens class represents a list of tokens returned from +# a Scanner. It's actually just an Array with a few helper methods. +# +# A token itself is not a special object, just two elements in an Array: +# * the _token_ _text_ (the original source of the token in a String) or +# a _token_ _action_ (begin_group, end_group, begin_line, end_line) +# * the _token_ _kind_ (a Symbol representing the type of the token) +# +# It looks like this: +# +# ..., '# It looks like this', :comment, ... +# ..., '3.1415926', :float, ... +# ..., '$^', :error, ... +# +# Some scanners also yield sub-tokens, represented by special +# token actions, for example :begin_group and :end_group. +# +# The Ruby scanner, for example, splits "a string" into: +# +# [ +# :begin_group, :string, +# '"', :delimiter, +# 'a string', :content, +# '"', :delimiter, +# :end_group, :string +# ] +# +# Tokens can be used to save the output of a Scanners in a simple +# Ruby object that can be send to an Encoder later: +# +# tokens = CodeRay.scan('price = 2.59', :ruby).tokens +# tokens.encode(:html) +# tokens.html +# CodeRay.encoder(:html).encode_tokens(tokens) +# +# Tokens gives you the power to handle pre-scanned code very easily: +# You can serialize it to a JSON string and store it in a database, pass it +# around to encode it more than once, send it to other algorithms... +# +# pkg:gem/coderay#lib/coderay/tokens.rb:41 +class CodeRay::Tokens < ::Array + # pkg:gem/coderay#lib/coderay/tokens.rb:156 + def begin_group(kind); end + + # pkg:gem/coderay#lib/coderay/tokens.rb:158 + def begin_line(kind); end + + # Return the actual number of tokens. + # + # pkg:gem/coderay#lib/coderay/tokens.rb:151 + def count; end + + # Encode the tokens using encoder. + # + # encoder can be + # * a plugin name like :html oder 'statistic' + # * an Encoder object + # + # options are passed to the encoder. + # + # pkg:gem/coderay#lib/coderay/tokens.rb:56 + def encode(encoder, options = T.unsafe(nil)); end + + # pkg:gem/coderay#lib/coderay/tokens.rb:157 + def end_group(kind); end + + # pkg:gem/coderay#lib/coderay/tokens.rb:159 + def end_line(kind); end + + # Redirects unknown methods to encoder calls. + # + # For example, if you call +tokens.html+, the HTML encoder + # is used to highlight the tokens. + # + # pkg:gem/coderay#lib/coderay/tokens.rb:70 + def method_missing(meth, options = T.unsafe(nil)); end + + # The Scanner instance that created the tokens. + # + # pkg:gem/coderay#lib/coderay/tokens.rb:47 + def scanner; end + + # The Scanner instance that created the tokens. + # + # pkg:gem/coderay#lib/coderay/tokens.rb:47 + def scanner=(_arg0); end + + # Split the tokens into parts of the given +sizes+. + # + # The result will be an Array of Tokens objects. The parts have + # the text size specified by the parameter. In addition, each + # part closes all opened tokens. This is useful to insert tokens + # betweem them. + # + # This method is used by @Scanner#tokenize@ when called with an Array + # of source strings. The Diff encoder uses it for inline highlighting. + # + # pkg:gem/coderay#lib/coderay/tokens.rb:85 + def split_into_parts(*sizes); end + + # pkg:gem/coderay#lib/coderay/tokens.rb:155 + def text_token(*_arg0); end + + # Turn tokens into a string by concatenating them. + # + # pkg:gem/coderay#lib/coderay/tokens.rb:62 + def to_s; end + + # pkg:gem/coderay#lib/coderay/tokens.rb:160 + def tokens(*_arg0); end +end + +# The result of a scan operation is a TokensProxy, but should act like Tokens. +# +# This proxy makes it possible to use the classic CodeRay.scan.encode API +# while still providing the benefits of direct streaming. +# +# pkg:gem/coderay#lib/coderay/tokens_proxy.rb:7 +class CodeRay::TokensProxy + # Create a new TokensProxy with the arguments of CodeRay.scan. + # + # pkg:gem/coderay#lib/coderay/tokens_proxy.rb:12 + def initialize(input, lang, options = T.unsafe(nil), block = T.unsafe(nil)); end + + # pkg:gem/coderay#lib/coderay/tokens_proxy.rb:9 + def block; end + + # pkg:gem/coderay#lib/coderay/tokens_proxy.rb:9 + def block=(_arg0); end + + # Overwrite Struct#each. + # + # pkg:gem/coderay#lib/coderay/tokens_proxy.rb:48 + def each(*args, &blk); end + + # Call CodeRay.encode if +encoder+ is a Symbol; + # otherwise, convert the receiver to tokens and call encoder.encode_tokens. + # + # pkg:gem/coderay#lib/coderay/tokens_proxy.rb:21 + def encode(encoder, options = T.unsafe(nil)); end + + # pkg:gem/coderay#lib/coderay/tokens_proxy.rb:9 + def input; end + + # pkg:gem/coderay#lib/coderay/tokens_proxy.rb:9 + def input=(_arg0); end + + # pkg:gem/coderay#lib/coderay/tokens_proxy.rb:9 + def lang; end + + # pkg:gem/coderay#lib/coderay/tokens_proxy.rb:9 + def lang=(_arg0); end + + # Tries to call encode; + # delegates to tokens otherwise. + # + # pkg:gem/coderay#lib/coderay/tokens_proxy.rb:31 + def method_missing(method, *args, &blk); end + + # pkg:gem/coderay#lib/coderay/tokens_proxy.rb:9 + def options; end + + # pkg:gem/coderay#lib/coderay/tokens_proxy.rb:9 + def options=(_arg0); end + + # A (cached) scanner instance to use for the scan task. + # + # pkg:gem/coderay#lib/coderay/tokens_proxy.rb:43 + def scanner; end + + # The (cached) result of the tokenized input; a Tokens instance. + # + # pkg:gem/coderay#lib/coderay/tokens_proxy.rb:38 + def tokens; end +end + +# pkg:gem/coderay#lib/coderay/version.rb:2 +CodeRay::VERSION = T.let(T.unsafe(nil), String) + +# = WordList +# +# A Hash subclass designed for mapping word lists to token types. +# +# A WordList is a Hash with some additional features. +# It is intended to be used for keyword recognition. +# +# WordList is optimized to be used in Scanners, +# typically to decide whether a given ident is a special token. +# +# For case insensitive words use WordList::CaseIgnoring. +# +# Example: +# +# # define word arrays +# RESERVED_WORDS = %w[ +# asm break case continue default do else +# ] +# +# PREDEFINED_TYPES = %w[ +# int long short char void +# ] +# +# # make a WordList +# IDENT_KIND = WordList.new(:ident). +# add(RESERVED_WORDS, :reserved). +# add(PREDEFINED_TYPES, :predefined_type) +# +# ... +# +# def scan_tokens tokens, options +# ... +# +# elsif scan(/[A-Za-z_][A-Za-z_0-9]*/) +# # use it +# kind = IDENT_KIND[match] +# ... +# +# pkg:gem/coderay#lib/coderay/helpers/word_list.rb:40 +class CodeRay::WordList < ::Hash + # Create a new WordList with +default+ as default value. + # + # pkg:gem/coderay#lib/coderay/helpers/word_list.rb:43 + def initialize(default = T.unsafe(nil)); end + + # Add words to the list and associate them with +value+. + # + # Returns +self+, so you can concat add calls. + # + # pkg:gem/coderay#lib/coderay/helpers/word_list.rb:50 + def add(words, value = T.unsafe(nil)); end +end + +# A CaseIgnoring WordList is like a WordList, only that +# keys are compared case-insensitively (normalizing keys using +downcase+). +# +# pkg:gem/coderay#lib/coderay/helpers/word_list.rb:60 +class CodeRay::WordList::CaseIgnoring < ::CodeRay::WordList + # pkg:gem/coderay#lib/coderay/helpers/word_list.rb:62 + def [](key); end + + # pkg:gem/coderay#lib/coderay/helpers/word_list.rb:66 + def []=(key, value); 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..ac8bf9c --- /dev/null +++ b/sorbet/rbi/gems/concurrent-ruby@1.3.8.rbi @@ -0,0 +1,10591 @@ +# 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 +# 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, **_arg1, &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 + # 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 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 flatten_merge(*args); end + + # pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/set.rb:33 + def freeze(*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 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 +# @!visibility private +# @!visibility private +# @!visibility private +# @!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 +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# +# pkg:gem/concurrent-ruby#lib/concurrent-ruby/concurrent/thread_safe/util.rb:4 +module Concurrent::ThreadSafe; end + +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# @!visibility private +# @!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 +# @!visibility private +# @!visibility private +# @!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..3d9f595 --- /dev/null +++ b/sorbet/rbi/gems/connection_pool@3.0.2.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `connection_pool` gem. +# Please instead update this file by running `bin/tapioca gem connection_pool`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/constant_resolver@0.3.0.rbi b/sorbet/rbi/gems/constant_resolver@0.3.0.rbi new file mode 100644 index 0000000..921a1f2 --- /dev/null +++ b/sorbet/rbi/gems/constant_resolver@0.3.0.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `constant_resolver` gem. +# Please instead update this file by running `bin/tapioca gem constant_resolver`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem 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..099fd1c --- /dev/null +++ b/sorbet/rbi/gems/crass@1.0.7.rbi @@ -0,0 +1,9 @@ +# 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`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem 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/dogapi@1.45.0.rbi b/sorbet/rbi/gems/dogapi@1.45.0.rbi index 8cf465a..dc72aaf 100644 --- a/sorbet/rbi/gems/dogapi@1.45.0.rbi +++ b/sorbet/rbi/gems/dogapi@1.45.0.rbi @@ -1,551 +1,2075 @@ -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `dogapi` gem. -# Please instead update this file by running `bin/tapioca sync`. - # typed: true +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `dogapi` gem. +# Please instead update this file by running `bin/tapioca gem dogapi`. + + +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2011-Present Datadog, Inc. +# +# pkg:gem/dogapi#lib/dogapi/version.rb:5 module Dogapi class << self + # pkg:gem/dogapi#lib/dogapi/common.rb:208 def find_datadog_host; end + + # pkg:gem/dogapi#lib/dogapi/common.rb:216 def find_localhost; end + + # pkg:gem/dogapi#lib/dogapi/common.rb:230 def find_proxy; end + + # Very simplified hash with indifferent access - access to string or symbol + # keys via symbols. E.g.: + # my_hash = { 'foo' => 1 } + # Dogapi.symbolized_access(my_hash) + # my_hash[:foo] # => 1 + # + # pkg:gem/dogapi#lib/dogapi/common.rb:250 def symbolized_access(hash); end + + # pkg:gem/dogapi#lib/dogapi/common.rb:236 def validate_tags(tags); end end end +# Superclass that deals with the details of communicating with the DataDog API +# +# pkg:gem/dogapi#lib/dogapi/common.rb:87 class Dogapi::APIService + # pkg:gem/dogapi#lib/dogapi/common.rb:89 def initialize(api_key, application_key, silent = T.unsafe(nil), timeout = T.unsafe(nil), endpoint = T.unsafe(nil), skip_ssl_validation = T.unsafe(nil)); end + # pkg:gem/dogapi#lib/dogapi/common.rb:88 def api_key; end + + # pkg:gem/dogapi#lib/dogapi/common.rb:88 def application_key; end + + # Manages the HTTP connection + # + # pkg:gem/dogapi#lib/dogapi/common.rb:99 def connect; end + + # pkg:gem/dogapi#lib/dogapi/common.rb:198 def handle_redirect(conn, req, resp, retries = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/common.rb:185 def handle_response(resp); end + + # pkg:gem/dogapi#lib/dogapi/common.rb:167 def prepare_params(extra_params, url, with_app_key); end + + # pkg:gem/dogapi#lib/dogapi/common.rb:152 def prepare_request(method, url, params, body, send_json, with_app_key); end + + # Prepares the request and handles the response + # + # +method+ is an implementation of Net::HTTP::Request (e.g. Net::HTTP::Post) + # + # +params+ is a Hash that will be converted to request parameters + # + # pkg:gem/dogapi#lib/dogapi/common.rb:135 def request(method, url, extra_params, body, send_json, with_app_key = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/common.rb:180 def should_set_api_and_app_keys_in_params?(url); end + + # pkg:gem/dogapi#lib/dogapi/common.rb:123 def suppress_error_if_silent(e); end end +# A simple DogAPI client +# +# See Dogapi::V1 for the thick underlying clients +# +# Class methods return a tuple of (+response_code+, +response_body+). Unless +# otherwise noted, the response body is deserialized JSON. Up-to-date +# information about the JSON object structure is available in the HTTP API +# documentation, here[https://github.com/DataDog/dogapi/wiki]. +# +# pkg:gem/dogapi#lib/dogapi/facade.rb:62 class Dogapi::Client + # pkg:gem/dogapi#lib/dogapi/facade.rb:68 def initialize(api_key, application_key = T.unsafe(nil), host = T.unsafe(nil), device = T.unsafe(nil), silent = T.unsafe(nil), timeout = T.unsafe(nil), endpoint = T.unsafe(nil), skip_ssl_validation = T.unsafe(nil)); end + # pkg:gem/dogapi#lib/dogapi/facade.rb:406 def add_items_to_dashboard_list(dashboard_list_id, dashboards); end + + # Add the tags to the given host + # + # +host_id+ can be the host's numeric id or string name + # + # +tags+ is and Array of Strings + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:298 def add_tags(host_id, tags, source = T.unsafe(nil)); end + + # ALERTS + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:426 def alert(query, options = T.unsafe(nil)); end + + # Get all tags and their associated hosts at your org + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:282 def all_tags(source = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:818 def aws_integration_create(config); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:822 def aws_integration_delete(config); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:830 def aws_integration_generate_external_id(config); end + + # AWS INTEGRATION + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:814 def aws_integration_list; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:826 def aws_integration_list_namespaces; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:834 def aws_integration_update(config, new_config); end + + # AWS Logs Integration + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:842 def aws_logs_add_lambda(config); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:862 def aws_logs_check_lambda(config); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:866 def aws_logs_check_services(config); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:858 def aws_logs_integration_delete(config); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:854 def aws_logs_integrations_list; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:846 def aws_logs_list_services; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:850 def aws_logs_save_services(config); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:878 def azure_integration_create(config); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:882 def azure_integration_delete(config); end + + # AZURE INTEGRATION + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:874 def azure_integration_list; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:890 def azure_integration_update(config); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:886 def azure_integration_update_host_filters(config); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:176 def batch_metrics; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:597 def can_delete_monitors(monitor_ids); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:705 def can_delete_service_level_objective(slo_ids); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:657 def cancel_downtime(downtime_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:661 def cancel_downtime_by_scope(scope); end + + # Post a comment + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:254 def comment(message, options = T.unsafe(nil)); end + + # Create a dashboard. + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:358 def create_board(title, widgets, layout_type, options = T.unsafe(nil)); end + + # Create a dashboard. + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:329 def create_dashboard(title, description, graphs, template_variables = T.unsafe(nil), read_only = T.unsafe(nil)); end + + # DASHBOARD LISTS + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:386 def create_dashboard_list(name); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:495 def create_embed(graph_json, description = T.unsafe(nil)); end + + # INTEGRATIONS + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:795 def create_integration(source_type_name, config); end + + # LOGS PIPELINES + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:725 def create_logs_pipeline(name, filter, options = T.unsafe(nil)); end + + # SCREENBOARD + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:510 def create_screenboard(description); end + + # SERVICE LEVEL OBJECTIVES + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:685 def create_service_level_objective(type, slo_name, thresholds, options = T.unsafe(nil)); end + + # SYNTHETICS + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:541 def create_synthetics_test(type, config, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:459 def create_user(description = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:63 def datadog_host; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:63 def datadog_host=(_arg0); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:438 def delete_alert(alert_id); end + + # Delete the given dashboard. + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:378 def delete_board(dashboard_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:263 def delete_comment(comment_id); end + + # Delete the given dashboard. + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:349 def delete_dashboard(dash_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:402 def delete_dashboard_list(dashboard_list_id); end + + # Delete an event + # + # +id+ of the event to delete + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:217 def delete_event(id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:807 def delete_integration(source_type_name); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:414 def delete_items_from_dashboard_list(dashboard_list_id, dashboards); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:741 def delete_logs_pipeline(pipeline_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:713 def delete_many_service_level_objective(slo_ids); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:601 def delete_monitor(monitor_id, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:526 def delete_screenboard(board_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:709 def delete_service_level_objective(slo_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:549 def delete_synthetics_tests(test_ids); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:717 def delete_timeframes_service_level_objective(ops); end + + # Remove all tags from the given host + # + # +host_id+ can be the host's numeric id or string name + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:320 def detach_tags(host_id, source = T.unsafe(nil)); end + + # DEPRECATED: Spelling mistake temporarily preserved as an alias. + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:312 def detatch_tags(host_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:475 def disable_user(handle); end + + # Record an event + # + # Optional arguments: + # :host => String + # :device => String + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:201 def emit_event(event, options = T.unsafe(nil)); end + + # Record a single point of metric data + # + # Optional arguments: + # :timestamp => Ruby stdlib Time + # :host => String + # :device => String + # :options => Map + # + # options[:type] = "count" to specify a counter metric + # options[:tags] = ["tag1", "tag2"] to tag the point + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:132 def emit_point(metric, value, options = T.unsafe(nil)); end + + # Record a set of points of metric data + # + # +points+ is an array of [Time, value] doubles + # + # Optional arguments: + # :host => String + # :device => String + # :options => Map + # + # options[:type] = "count" to specify a counter metric + # options[:tags] = ["tag1", "tag2"] to tag the point + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:154 def emit_points(metric, points, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:499 def enable_embed(embed_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:905 def gcp_integration_create(config); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:901 def gcp_integration_delete(config); end + + # GCP INTEGRATION + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:897 def gcp_integration_list; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:909 def gcp_integration_update(config); end + + # Get a list of active metrics since a given time + # +from+ The seconds since the unix epoch [Time, Integer] + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:189 def get_active_metrics(from); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:434 def get_alert(alert_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:442 def get_all_alerts; end + + # Fetch all dashboards. + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:373 def get_all_boards; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:398 def get_all_dashboard_lists; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:665 def get_all_downtimes(options = T.unsafe(nil)); end + + # EMBEDS + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:487 def get_all_embeds; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:733 def get_all_logs_pipelines; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:605 def get_all_monitors(options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:522 def get_all_screenboards; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:557 def get_all_synthetics_tests; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:463 def get_all_users; end + + # Fetch the given dashboard. + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:368 def get_board(dashboard_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:932 def get_custom_metrics_usage(start_hr, end_hr = T.unsafe(nil)); end + + # Fetch the given dashboard. + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:339 def get_dashboard(dash_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:394 def get_dashboard_list(dashboard_list_id); end + + # Fetch all of the dashboards. + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:344 def get_dashboards; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:653 def get_downtime(downtime_id, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:491 def get_embed(embed_id, description = T.unsafe(nil)); end + + # Get the details of an event + # + # +id+ of the event to get + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:210 def get_event(id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:944 def get_fargate_usage(start_hr, end_hr = T.unsafe(nil)); end + + # Get hourly usage information for different datadog service + # Usage data is delayed by up to 72 hours from when it was incurred. It is retained for the past 15 months.# + # format of dates is ISO-8601 UTC YYYY-MM-DDThh + # ex: + # require 'time' + # Time.now.utc.strftime('%Y-%m-%dT%H') + # => "2019-05-05T13" + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:924 def get_hosts_usage(start_hr, end_hr = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:803 def get_integration(source_type_name); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:418 def get_items_of_dashboard_list(dashboard_list_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:729 def get_logs_pipeline(pipeline_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:928 def get_logs_usage(start_hr, end_hr = T.unsafe(nil)); end + + # Get metadata information on an existing Datadog metric + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:758 def get_metadata(metric); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:593 def get_monitor(monitor_id, options = T.unsafe(nil)); end + + # Get a set of points by query between from and to + # + # +from+ The seconds since the unix epoch [Time, Integer] + # +to+ The seconds since the unix epoch [Time, Integer] + # +query+ The query string [String] + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:172 def get_points(query, from, to); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:518 def get_screenboard(board_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:693 def get_service_level_objective(slo_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:697 def get_service_level_objective_history(slo_id, from_ts, to_ts); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:573 def get_synthetics_devices; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:577 def get_synthetics_locations; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:569 def get_synthetics_result(test_id, result_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:565 def get_synthetics_results(test_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:561 def get_synthetics_test(test_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:940 def get_synthetics_usage(start_hr, end_hr = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:936 def get_traces_usage(start_hr, end_hr = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:467 def get_user(handle); end + + # Graph snapshot + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:480 def graph_snapshot(metric_query, start_ts, end_ts, event_query = T.unsafe(nil)); end + + # Get all tags for the given host + # + # +host_id+ can be the host's numeric id or string name + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:289 def host_tags(host_id, source = T.unsafe(nil), by_source = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:787 def host_totals; end + + # User invite + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:455 def invite(emails, options = T.unsafe(nil)); end + + # MONITORS + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:585 def monitor(type, query, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:446 def mute_alerts; end + + # HOST MUTING + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:673 def mute_host(hostname, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:621 def mute_monitor(monitor_id, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:613 def mute_monitors; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:629 def resolve_monitors(monitor_groups = T.unsafe(nil), options = T.unsafe(nil), version = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:503 def revoke_embed(embed_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:534 def revoke_screenboard(board_id); end + + # MONITOR DOWNTIME + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:645 def schedule_downtime(scope, options = T.unsafe(nil)); end + + # Run the given search query. + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:272 def search(query); end + + # HOSTS + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:783 def search_hosts(options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:637 def search_monitor_groups(options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:633 def search_monitors(options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:701 def search_service_level_objective(slo_ids = T.unsafe(nil), query = T.unsafe(nil), offset = T.unsafe(nil), limit = T.unsafe(nil)); end + + # SERVICE CHECKS + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:749 def service_check(check, host, status, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:530 def share_screenboard(board_id); end + + # DEPRECATED: Recording events with a duration has been deprecated. + # The functionality will be removed in a later release. + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:237 def start_event(event, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:553 def start_pause_synthetics_test(test_id, new_status); end + + # Get an optionally filtered event stream + # + # +start+ is a Time object for when to start the stream + # + # +stop+ is a Time object for when to end the stream + # + # Optional arguments: + # :priority => "normal" or "low" + # :sources => String, see https://github.com/DataDog/dogapi/wiki/Event for a current list of sources + # :tags => Array of Strings + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:231 def stream(start, stop, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:450 def unmute_alerts; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:677 def unmute_host(hostname); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:625 def unmute_monitor(monitor_id, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:617 def unmute_monitors; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:430 def update_alert(alert_id, query, options = T.unsafe(nil)); end + + # Update a dashboard. + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:363 def update_board(dashboard_id, title, widgets, layout_type, options = T.unsafe(nil)); end + + # Post a comment + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:259 def update_comment(comment_id, options = T.unsafe(nil)); end + + # Update a dashboard. + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:334 def update_dashboard(dash_id, title, description, graphs, template_variables = T.unsafe(nil), read_only = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:390 def update_dashboard_list(dashboard_list_id, name); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:649 def update_downtime(downtime_id, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:799 def update_integration(source_type_name, config); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:410 def update_items_of_dashboard_list(dashboard_list_id, dashboards); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:737 def update_logs_pipeline(pipeline_id, name, filter, options = T.unsafe(nil)); end + + # Update metadata fields for an existing Datadog metric. + # If the metadata does not exist for the metric it is created by + # the update. + # Optional arguments: + # :type => String, type of the metric (ex. "gauge", "rate", etc.) + # see http://docs.datadoghq.com/metrictypes/ + # :description => String, description of the metric + # :short_name => String, short name of the metric + # :unit => String, unit type associated with the metric (ex. "byte", "operation") + # see http://docs.datadoghq.com/units/ for full list + # :per_unit => String, per unit type (ex. "second" as in "queries per second") + # see http://docs.datadoghq.com/units/ for full + # :statsd_interval => Integer, statsd flush interval for metric in seconds (if applicable) + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:775 def update_metadata(metric, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:589 def update_monitor(monitor_id, query, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:514 def update_screenboard(board_id, description); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:689 def update_service_level_objective(slo_id, type, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:545 def update_synthetics_test(test_id, type, config, options = T.unsafe(nil)); end + + # Replace the tags on the given host + # + # +host_id+ can be the host's numeric id or string name + # + # +tags+ is and Array of Strings + # + # pkg:gem/dogapi#lib/dogapi/facade.rb:307 def update_tags(host_id, tags, source = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:471 def update_user(handle, description = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:64 def v2; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:64 def v2=(_arg0); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:609 def validate_monitor(type, query, options = T.unsafe(nil)); end private + # pkg:gem/dogapi#lib/dogapi/facade.rb:950 def override_scope(options = T.unsafe(nil)); end end +# A simple DogAPI client supporting the version 2. +# +# See Dogapi::V2 for the thick underlying clients +# +# pkg:gem/dogapi#lib/dogapi/facade.rb:14 class Dogapi::ClientV2 + # pkg:gem/dogapi#lib/dogapi/facade.rb:16 def initialize(api_key, application_key = T.unsafe(nil), host = T.unsafe(nil), device = T.unsafe(nil), silent = T.unsafe(nil), timeout = T.unsafe(nil), endpoint = T.unsafe(nil), skip_ssl_validation = T.unsafe(nil)); end + # pkg:gem/dogapi#lib/dogapi/facade.rb:36 def add_items_to_dashboard_list(dashboard_list_id, dashboards); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:15 def datadog_host; end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:15 def datadog_host=(_arg0); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:44 def delete_items_from_dashboard_list(dashboard_list_id, dashboards); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:48 def get_items_of_dashboard_list(dashboard_list_id); end + + # pkg:gem/dogapi#lib/dogapi/facade.rb:40 def update_items_of_dashboard_list(dashboard_list_id, dashboards); end end +# Metadata class for storing the details of an event +# +# pkg:gem/dogapi#lib/dogapi/event.rb:13 class Dogapi::Event + # Optional arguments: + # :date_happened => time in seconds since the epoch (defaults to now) + # :msg_title => String + # :priority => String + # :parent => event ID (integer) + # :tags => array of Strings + # :event_object => String + # :alert_type => 'success', 'error' + # :event_type => String + # :source_type_name => String + # :aggregation_key => String + # + # pkg:gem/dogapi#lib/dogapi/event.rb:33 def initialize(msg_text, options = T.unsafe(nil)); end + # pkg:gem/dogapi#lib/dogapi/event.rb:14 def aggregation_key; end + + # pkg:gem/dogapi#lib/dogapi/event.rb:14 def date_happened; end + + # pkg:gem/dogapi#lib/dogapi/event.rb:14 def msg_text; end + + # pkg:gem/dogapi#lib/dogapi/event.rb:14 def msg_title; end + + # pkg:gem/dogapi#lib/dogapi/event.rb:14 def parent; end + + # pkg:gem/dogapi#lib/dogapi/event.rb:14 def priority; end + + # pkg:gem/dogapi#lib/dogapi/event.rb:14 def tags; end + + # Copy and pasted from the internets + # http://stackoverflow.com/a/5031637/25276 + # + # pkg:gem/dogapi#lib/dogapi/event.rb:58 def to_hash; end end +# DEPRECATED: Going forward, use the V1 services. This legacy service will be +# removed in an upcoming release. +# +# pkg:gem/dogapi#lib/dogapi/event.rb:67 class Dogapi::EventService < ::Dogapi::Service + # DEPRECATED: Going forward, use the V1 services. This legacy service will be + # removed in an upcoming release. + # + # pkg:gem/dogapi#lib/dogapi/event.rb:105 def start(api_key, event, scope, source_type = T.unsafe(nil)); end + + # DEPRECATED: Going forward, use the V1 services. This legacy service will be + # removed in an upcoming release. + # + # pkg:gem/dogapi#lib/dogapi/event.rb:75 def submit(api_key, event, scope = T.unsafe(nil), source_type = T.unsafe(nil)); end private + # pkg:gem/dogapi#lib/dogapi/event.rb:124 def finish(api_key, event_id, successful = T.unsafe(nil)); end end +# pkg:gem/dogapi#lib/dogapi/event.rb:69 Dogapi::EventService::API_VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/dogapi#lib/dogapi/event.rb:70 Dogapi::EventService::MAX_BODY_LENGTH = T.let(T.unsafe(nil), Integer) + +# pkg:gem/dogapi#lib/dogapi/event.rb:71 Dogapi::EventService::MAX_TITLE_LENGTH = T.let(T.unsafe(nil), Integer) +# DEPRECATED: Going forward, use the V1 services. This legacy service will be +# removed in an upcoming release. +# +# pkg:gem/dogapi#lib/dogapi/metric.rb:14 class Dogapi::MetricService < ::Dogapi::Service + # DEPRECATED: Going forward, use the V1 services. This legacy service will be + # removed in an upcoming release. + # + # pkg:gem/dogapi#lib/dogapi/metric.rb:20 def submit(api_key, scope, metric, points); end end +# pkg:gem/dogapi#lib/dogapi/metric.rb:16 Dogapi::MetricService::API_VERSION = T.let(T.unsafe(nil), String) +# Metadata class to hold the scope of an API call +# +# pkg:gem/dogapi#lib/dogapi/common.rb:29 class Dogapi::Scope + # pkg:gem/dogapi#lib/dogapi/common.rb:31 def initialize(host = T.unsafe(nil), device = T.unsafe(nil)); end + # pkg:gem/dogapi#lib/dogapi/common.rb:30 def device; end + + # pkg:gem/dogapi#lib/dogapi/common.rb:30 def host; end end +# DEPRECATED: Going forward, use the newer APIService. +# +# pkg:gem/dogapi#lib/dogapi/common.rb:38 class Dogapi::Service + # DEPRECATED: Going forward, use the newer APIService. + # + # pkg:gem/dogapi#lib/dogapi/common.rb:40 def initialize(api_key, api_host = T.unsafe(nil)); end + # DEPRECATED: Going forward, use the newer APIService. + # + # pkg:gem/dogapi#lib/dogapi/common.rb:46 def connect; end + + # DEPRECATED: Going forward, use the newer APIService. + # + # pkg:gem/dogapi#lib/dogapi/common.rb:59 def request(method, url, params); end end +# pkg:gem/dogapi#lib/dogapi/common.rb:20 Dogapi::USER_AGENT = T.let(T.unsafe(nil), String) + +# pkg:gem/dogapi#lib/dogapi/v1/alert.rb:6 class Dogapi::V1; end +# for namespacing +# +# pkg:gem/dogapi#lib/dogapi/v1/alert.rb:8 class Dogapi::V1::AlertService < ::Dogapi::APIService + # pkg:gem/dogapi#lib/dogapi/v1/alert.rb:12 def alert(query, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/alert.rb:32 def delete_alert(alert_id); end + + # pkg:gem/dogapi#lib/dogapi/v1/alert.rb:28 def get_alert(alert_id); end + + # pkg:gem/dogapi#lib/dogapi/v1/alert.rb:36 def get_all_alerts; end + + # pkg:gem/dogapi#lib/dogapi/v1/alert.rb:40 def mute_alerts; end + + # pkg:gem/dogapi#lib/dogapi/v1/alert.rb:44 def unmute_alerts; end + + # pkg:gem/dogapi#lib/dogapi/v1/alert.rb:20 def update_alert(alert_id, query, options); end end +# pkg:gem/dogapi#lib/dogapi/v1/alert.rb:10 Dogapi::V1::AlertService::API_VERSION = T.let(T.unsafe(nil), String) +# AwsIntegrationService for user interaction with AWS configs. +# +# pkg:gem/dogapi#lib/dogapi/v1/aws_integration.rb:9 class Dogapi::V1::AwsIntegrationService < ::Dogapi::APIService + # Create an AWS integration + # :config => Hash: integration config. + # config = { + # :account_id => '', + # :host_tags => ['api:example'], + # :role_name => '' + # } + # + # Access Key/Secret Access Key based accounts (GovCloud and China only) + # + # config = { + # :access_key_id => '', + # :host_tags => ['api:example'], + # :secret_access_key => '' + # } + # + # dog = Dogapi::Client.new(api_key, app_key) + # + # puts dog.aws_integration_create(config) + # + # pkg:gem/dogapi#lib/dogapi/v1/aws_integration.rb:37 def aws_integration_create(config); end + + # Delete an integration + # :config => Hash: integration config. + # config = { + # :account_id => '', + # :role_name => '' + # } + # Access Key/Secret Access Key based accounts (GovCloud and China only) + # + # config = { + # :access_key_id => '', + # } + # + # dog = Dogapi::Client.new(api_key, app_key) + # + # puts dog.aws_integration_delete(config) + # + # pkg:gem/dogapi#lib/dogapi/v1/aws_integration.rb:56 def aws_integration_delete(config); end + + # Generate new AWS external ID for a specific integrated account + # :config => Hash: integration config. + # config = { + # :account_id => '', + # :role_name => '' + # } + # + # dog = Dogapi::Client.new(api_key, app_key) + # + # puts dog.aws_integration_generate_external_id(config) + # + # pkg:gem/dogapi#lib/dogapi/v1/aws_integration.rb:75 def aws_integration_generate_external_id(config); end + + # Retrieve AWS integration information + # + # pkg:gem/dogapi#lib/dogapi/v1/aws_integration.rb:14 def aws_integration_list; end + + # List available AWS namespaces + # + # pkg:gem/dogapi#lib/dogapi/v1/aws_integration.rb:61 def aws_integration_list_namespaces; end + + # puts dog.aws_integration_update(config, new_config) + # + # pkg:gem/dogapi#lib/dogapi/v1/aws_integration.rb:108 def aws_integration_update(config, new_config); end end +# pkg:gem/dogapi#lib/dogapi/v1/aws_integration.rb:11 Dogapi::V1::AwsIntegrationService::API_VERSION = T.let(T.unsafe(nil), String) +# AwsLogsService for user interaction with AWS configs. +# +# pkg:gem/dogapi#lib/dogapi/v1/aws_logs.rb:9 class Dogapi::V1::AwsLogsService < ::Dogapi::APIService + # Create an AWS integration + # :config => Hash: integration config. + # config = { + # :account_id => '', + # :lambda_arn => '' + # } + # + # dog = Dogapi::Client.new(api_key, app_key) + # + # puts dog.aws_logs_add_lambda(config) + # + # pkg:gem/dogapi#lib/dogapi/v1/aws_logs.rb:30 def aws_logs_add_lambda(config); end + + # contents of config should be + # >>> :account_id => '' + # >>> :lambda_arn => '' + # + # pkg:gem/dogapi#lib/dogapi/v1/aws_logs.rb:81 def aws_logs_check_lambda(config); end + + # contents of config should be + # :account_id => '' + # :services => ['s3', 'elb', 'elbv2', 'cloudfront', 'redshift', 'lambda'] + # + # pkg:gem/dogapi#lib/dogapi/v1/aws_logs.rb:98 def aws_logs_check_services(config); end + + # Delete an AWS Logs integration + # :config => Hash: integration config. + # config = { + # :account_id => '', + # :lambda_arn => '' + # } + # + # dog = Dogapi::Client.new(api_key, app_key) + # + # puts dog.aws_logs_integration_delete(config) + # + # pkg:gem/dogapi#lib/dogapi/v1/aws_logs.rb:63 def aws_logs_integration_delete(config); end + + # List all Datadog-AWS Logs integrations configured in your Datadog account. + # + # pkg:gem/dogapi#lib/dogapi/v1/aws_logs.rb:35 def aws_logs_integrations_list; end + + # Get the list of current AWS services for which Datadog offers automatic log collection. + # Use returned service IDs with the services parameter for the Enable + # an AWS service log collection API endpoint. + # + # pkg:gem/dogapi#lib/dogapi/v1/aws_logs.rb:16 def aws_logs_list_services; end + + # Enable automatic log collection for a list of services. + # This should be run after running 'aws_logs_add_lambda' to save the config. + # config = { + # :account_id => '', + # :services => ['s3', 'elb', 'elbv2', 'cloudfront', 'redshift', 'lambda'] + # } + # + # dog = Dogapi::Client.new(api_key, app_key) + # + # puts dog.aws_logs_save_services(config) + # + # pkg:gem/dogapi#lib/dogapi/v1/aws_logs.rb:49 def aws_logs_save_services(config); end end +# pkg:gem/dogapi#lib/dogapi/v1/aws_logs.rb:11 Dogapi::V1::AwsLogsService::API_VERSION = T.let(T.unsafe(nil), String) +# AzureIntegrationService for user interaction with Azure configs. +# +# pkg:gem/dogapi#lib/dogapi/v1/azure_integration.rb:9 class Dogapi::V1::AzureIntegrationService < ::Dogapi::APIService + # Create an Azure integration + # :config => Hash: integration config. + # config = { + # :tenant_name => '', + # :host_filters => 'new:filter', + # :client_id => '', + # :client_secret => '' + # } + # + # dog = Dogapi::Client.new(api_key, app_key) + # + # puts dog.azure_integration_create(config) + # + # pkg:gem/dogapi#lib/dogapi/v1/azure_integration.rb:44 def azure_integration_create(config); end + + # Delete an Azure integration + # :config => Hash: integration config. + # config = { + # :tenant_name => '', + # :client_id => '' + # } + # + # dog = Dogapi::Client.new(api_key, app_key) + # + # puts dog.azure_integration_delete(config) + # + # pkg:gem/dogapi#lib/dogapi/v1/azure_integration.rb:28 def azure_integration_delete(config); end + + # Retrieve Azure integration information + # + # pkg:gem/dogapi#lib/dogapi/v1/azure_integration.rb:14 def azure_integration_list; end + + # Update a configured Azure account. + # :config => Hash: integration config. + # config = { + # :tenant_name => '', + # :new_tenant_name => '', + # :host_filters => ':,:', + # :client_id => '', + # :new_client_id => '' + # } + # + # dog = Dogapi::Client.new(api_key, app_key) + # + # puts dog.azure_integration_update(config) + # + # pkg:gem/dogapi#lib/dogapi/v1/azure_integration.rb:76 def azure_integration_update(config); end + + # Update an Azure integrations host filters + # :config => Hash: integration config. + # config = { + # :tenant_name => '', + # :host_filters => 'new:filter', + # :client_id => '' + # } + # + # dog = Dogapi::Client.new(api_key, app_key) + # + # puts dog.azure_integration_update_host_filters(config) + # + # pkg:gem/dogapi#lib/dogapi/v1/azure_integration.rb:59 def azure_integration_update_host_filters(config); end end +# pkg:gem/dogapi#lib/dogapi/v1/azure_integration.rb:11 Dogapi::V1::AzureIntegrationService::API_VERSION = T.let(T.unsafe(nil), String) +# for namespacing +# +# pkg:gem/dogapi#lib/dogapi/v1/comment.rb:8 class Dogapi::V1::CommentService < ::Dogapi::APIService + # Submit a comment. + # + # pkg:gem/dogapi#lib/dogapi/v1/comment.rb:13 def comment(message, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/comment.rb:26 def delete_comment(comment_id); end + + # Update a comment. + # + # pkg:gem/dogapi#lib/dogapi/v1/comment.rb:22 def update_comment(comment_id, options = T.unsafe(nil)); end end +# pkg:gem/dogapi#lib/dogapi/v1/comment.rb:10 Dogapi::V1::CommentService::API_VERSION = T.let(T.unsafe(nil), String) +# for namespacing +# +# pkg:gem/dogapi#lib/dogapi/v1/dash.rb:8 class Dogapi::V1::DashService < ::Dogapi::APIService + # pkg:gem/dogapi#lib/dogapi/v1/dash.rb:12 def create_dashboard(title, description, graphs, template_variables = T.unsafe(nil), read_only = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/dash.rb:44 def delete_dashboard(dash_id); end + + # pkg:gem/dogapi#lib/dogapi/v1/dash.rb:36 def get_dashboard(dash_id); end + + # pkg:gem/dogapi#lib/dogapi/v1/dash.rb:40 def get_dashboards; end + + # pkg:gem/dogapi#lib/dogapi/v1/dash.rb:24 def update_dashboard(dash_id, title, description, graphs, template_variables = T.unsafe(nil), read_only = T.unsafe(nil)); end end +# pkg:gem/dogapi#lib/dogapi/v1/dash.rb:10 Dogapi::V1::DashService::API_VERSION = T.let(T.unsafe(nil), String) +# Dashboard List API +# +# pkg:gem/dogapi#lib/dogapi/v1/dashboard_list.rb:9 class Dogapi::V1::DashboardListService < ::Dogapi::APIService + # pkg:gem/dogapi#lib/dogapi/v1/dashboard_list.rb:53 def add_items(resource_id, dashboards); end + + # pkg:gem/dogapi#lib/dogapi/v1/dashboard_list.rb:35 def all; end + + # pkg:gem/dogapi#lib/dogapi/v1/dashboard_list.rb:15 def create(name); end + + # pkg:gem/dogapi#lib/dogapi/v1/dashboard_list.rb:39 def delete(resource_id); end + + # pkg:gem/dogapi#lib/dogapi/v1/dashboard_list.rb:81 def delete_items(resource_id, dashboards); end + + # pkg:gem/dogapi#lib/dogapi/v1/dashboard_list.rb:31 def get(resource_id); end + + # pkg:gem/dogapi#lib/dogapi/v1/dashboard_list.rb:43 def get_items(resource_id); end + + # pkg:gem/dogapi#lib/dogapi/v1/dashboard_list.rb:23 def update(resource_id, name); end + + # pkg:gem/dogapi#lib/dogapi/v1/dashboard_list.rb:67 def update_items(resource_id, dashboards); end end +# pkg:gem/dogapi#lib/dogapi/v1/dashboard_list.rb:11 Dogapi::V1::DashboardListService::API_VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/dogapi#lib/dogapi/v1/dashboard_list.rb:12 Dogapi::V1::DashboardListService::RESOURCE_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/dogapi#lib/dogapi/v1/dashboard_list.rb:13 Dogapi::V1::DashboardListService::SUB_RESOURCE_NAME = T.let(T.unsafe(nil), String) +# Dashboard API +# +# pkg:gem/dogapi#lib/dogapi/v1/dashboard.rb:9 class Dogapi::V1::DashboardService < ::Dogapi::APIService + # Create new dashboard + # + # Required arguments: + # :title => String: Title of the dashboard + # :widgets => JSON: List of widgets to display on the dashboard + # :layout_type => String: Layout type of the dashboard. + # Allowed values: 'ordered' or 'free' + # Optional arguments: + # :description => String: Description of the dashboard + # :is_read_only => Boolean: Whether this dashboard is read-only. + # If True, only the author and admins can make changes to it. + # :notify_list => JSON: List of handles of users to notify when changes are made to this dashboard + # e.g. '["user1@domain.com", "user2@domain.com"]' + # :template_variables => JSON: List of template variables for this dashboard. + # e.g. [{"name": "host", "prefix": "host", "default": "my-host"}] + # :template_variable_presets => JSON: List of template variables saved views + # e.g. { + # "name": "my_template_variable_preset", + # "template_variables": [{"name": "host", "prefix": "host", "default": "my-host"}] + # } + # + # pkg:gem/dogapi#lib/dogapi/v1/dashboard.rb:34 def create_board(title, widgets, layout_type, options); end + + # Delete the given dashboard + # + # Required argument: + # :dashboard_id => String: ID of the dashboard + # + # pkg:gem/dogapi#lib/dogapi/v1/dashboard.rb:106 def delete_board(dashboard_id); end + + # Fetch all custom dashboards + # + # pkg:gem/dogapi#lib/dogapi/v1/dashboard.rb:98 def get_all_boards; end + + # Fetch the given dashboard + # + # Required argument: + # :dashboard_id => String: ID of the dashboard + # + # pkg:gem/dogapi#lib/dogapi/v1/dashboard.rb:93 def get_board(dashboard_id); end + + # Update a dashboard + # + # Required arguments: + # :dashboard_id => String: ID of the dashboard + # :title => String: Title of the dashboard + # :widgets => JSON: List of widgets to display on the dashboard + # :layout_type => String: Layout type of the dashboard. + # Allowed values: 'ordered' or 'free' + # Optional arguments: + # :description => String: Description of the dashboard + # :is_read_only => Boolean: Whether this dashboard is read-only. + # If True, only the author and admins can make changes to it. + # :notify_list => JSON: List of handles of users to notify when changes are made to this dashboard + # e.g. '["user1@domain.com", "user2@domain.com"]' + # :template_variables => JSON: List of template variables for this dashboard. + # e.g. [{"name": "host", "prefix": "host", "default": "my-host"}] + # :template_variable_presets => JSON: List of template variables saved views + # e.g. { + # "name": "my_template_variable_preset", + # "template_variables": [{"name": "host", "prefix": "host", "default": "my-host"}] + # } + # + # pkg:gem/dogapi#lib/dogapi/v1/dashboard.rb:72 def update_board(dashboard_id, title, widgets, layout_type, options); end end +# pkg:gem/dogapi#lib/dogapi/v1/dashboard.rb:11 Dogapi::V1::DashboardService::API_VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/dogapi#lib/dogapi/v1/dashboard.rb:12 Dogapi::V1::DashboardService::RESOURCE_NAME = T.let(T.unsafe(nil), String) +# ================ +# EMBED API +# ================ +# +# pkg:gem/dogapi#lib/dogapi/v1/embed.rb:11 class Dogapi::V1::EmbedService < ::Dogapi::APIService + # Create an embeddable graph + # + # :graph_json => JSON: graph definition + # :timeframe => String: representing the interval of the graph. Default is "1_hour" + # :size => String: representing the size of the graph. Default is "medium". + # :legend => String: flag representing whether a legend is displayed. Default is "no". + # :title => String: represents title of the graph. Default is "Embed created through API." + # + # pkg:gem/dogapi#lib/dogapi/v1/embed.rb:37 def create_embed(graph_json, description = T.unsafe(nil)); end + + # Enable a specific embed + # + # :embed_id => String: embed token for a specific embed + # + # pkg:gem/dogapi#lib/dogapi/v1/embed.rb:48 def enable_embed(embed_id); end + + # Get all embeds for the API user's org + # + # pkg:gem/dogapi#lib/dogapi/v1/embed.rb:16 def get_all_embeds; end + + # Get a specific embed + # + # :embed_id => String: embed token for a specific embed + # :size => String: "small", "medium"(defualt), "large", or "xlarge". + # :legend => String: "yes" or "no"(default) + # :template_vars => String: variable name => variable value (any number of template vars) + # + # pkg:gem/dogapi#lib/dogapi/v1/embed.rb:26 def get_embed(embed_id, description = T.unsafe(nil)); end + + # Revoke a specific embed + # + # :embed_id => String: embed token for a specific embed + # + # pkg:gem/dogapi#lib/dogapi/v1/embed.rb:55 def revoke_embed(embed_id); end end +# pkg:gem/dogapi#lib/dogapi/v1/embed.rb:13 Dogapi::V1::EmbedService::API_VERSION = T.let(T.unsafe(nil), String) +# Event-specific client affording more granular control than the simple Dogapi::Client +# +# pkg:gem/dogapi#lib/dogapi/v1/event.rb:9 class Dogapi::V1::EventService < ::Dogapi::APIService + # pkg:gem/dogapi#lib/dogapi/v1/event.rb:34 def delete(id); end + + # pkg:gem/dogapi#lib/dogapi/v1/event.rb:30 def get(id); end + + # Records an Event with no duration + # + # pkg:gem/dogapi#lib/dogapi/v1/event.rb:16 def post(event, scope = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/event.rb:38 def stream(start, stop, options = T.unsafe(nil)); end end +# pkg:gem/dogapi#lib/dogapi/v1/event.rb:11 Dogapi::V1::EventService::API_VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/dogapi#lib/dogapi/v1/event.rb:12 Dogapi::V1::EventService::MAX_BODY_LENGTH = T.let(T.unsafe(nil), Integer) + +# pkg:gem/dogapi#lib/dogapi/v1/event.rb:13 Dogapi::V1::EventService::MAX_TITLE_LENGTH = T.let(T.unsafe(nil), Integer) +# GcpIntegrationService for user interaction with gcp configs. +# +# pkg:gem/dogapi#lib/dogapi/v1/gcp_integration.rb:9 class Dogapi::V1::GcpIntegrationService < ::Dogapi::APIService + # Create an gcp integration + # :config => Hash: integration config. + # config = { + # :type => 'service_account', + # :project_id => '', + # :private_key_id => '', + # :private_key => '', + # :client_email => '', + # :client_id => '', + # :auth_uri => '', + # :token_uri => '', + # :auth_provider_x509_cert_url => '', + # :client_x509_cert_url => '', + # :host_filters => ':,:,' + # } + # + # dog = Dogapi::Client.new(api_key, app_key) + # + # puts dog.gcp_integration_create(config) + # + # pkg:gem/dogapi#lib/dogapi/v1/gcp_integration.rb:51 def gcp_integration_create(config); end + + # Delete an gcp integration + # :config => Hash: integration config. + # config = { + # :project_id => 'datadog-sandbox', + # :client_email => 'email@example.com' + # } + # + # dog = Dogapi::Client.new(api_key, app_key) + # + # puts dog.gcp_integration_delete(config) + # + # pkg:gem/dogapi#lib/dogapi/v1/gcp_integration.rb:28 def gcp_integration_delete(config); end + + # Retrieve gcp integration information + # + # pkg:gem/dogapi#lib/dogapi/v1/gcp_integration.rb:14 def gcp_integration_list; end + + # Update a configured gcp account. + # :config => Hash: integration config. + # config = { + # :project_id => '', + # :client_email => '', + # :host_filters => ':,:,' + # :automute => true # takes a boolean and toggles GCE automuting + # } + # + # dog = Dogapi::Client.new(api_key, app_key) + # + # puts dog.gcp_integration_update(config) + # + # pkg:gem/dogapi#lib/dogapi/v1/gcp_integration.rb:67 def gcp_integration_update(config); end end +# pkg:gem/dogapi#lib/dogapi/v1/gcp_integration.rb:11 Dogapi::V1::GcpIntegrationService::API_VERSION = T.let(T.unsafe(nil), String) +# Hosts API +# +# pkg:gem/dogapi#lib/dogapi/v1/hosts.rb:9 class Dogapi::V1::HostsService < ::Dogapi::APIService + # pkg:gem/dogapi#lib/dogapi/v1/hosts.rb:13 def search(options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/hosts.rb:17 def totals; end end +# pkg:gem/dogapi#lib/dogapi/v1/hosts.rb:11 Dogapi::V1::HostsService::API_VERSION = T.let(T.unsafe(nil), String) +# for namespacing +# +# pkg:gem/dogapi#lib/dogapi/v1/integration.rb:8 class Dogapi::V1::IntegrationService < ::Dogapi::APIService + # Create an integration + # + # :source_type_name => String: the name of an integration source + # :config => Hash: integration config that varies based on the source type. + # See https://docs.datadoghq.com/api/#integrations. + # + # pkg:gem/dogapi#lib/dogapi/v1/integration.rb:17 def create_integration(source_type_name, config); end + + # Delete an integration + # + # :source_type_name => String: the name of an integration source + # + # pkg:gem/dogapi#lib/dogapi/v1/integration.rb:40 def delete_integration(source_type_name); end + + # Retrieve integration information + # + # :source_type_name => String: the name of an integration source + # + # pkg:gem/dogapi#lib/dogapi/v1/integration.rb:33 def get_integration(source_type_name); end + + # Update an integration + # + # :source_type_name => String: the name of an integration source + # :config => Hash: integration config that varies based on the source type. + # source type (https://docs.datadoghq.com/api/#integrations) + # + # pkg:gem/dogapi#lib/dogapi/v1/integration.rb:26 def update_integration(source_type_name, config); end end +# pkg:gem/dogapi#lib/dogapi/v1/integration.rb:10 Dogapi::V1::IntegrationService::API_VERSION = T.let(T.unsafe(nil), String) +# for namespacing +# +# pkg:gem/dogapi#lib/dogapi/v1/logs_pipeline.rb:7 class Dogapi::V1::LogsPipelineService < ::Dogapi::APIService + # pkg:gem/dogapi#lib/dogapi/v1/logs_pipeline.rb:10 def create_logs_pipeline(name, filter, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/logs_pipeline.rb:36 def delete_logs_pipeline(pipeline_id); end + + # pkg:gem/dogapi#lib/dogapi/v1/logs_pipeline.rb:23 def get_all_logs_pipelines; end + + # pkg:gem/dogapi#lib/dogapi/v1/logs_pipeline.rb:19 def get_logs_pipeline(pipeline_id); end + + # pkg:gem/dogapi#lib/dogapi/v1/logs_pipeline.rb:27 def update_logs_pipeline(pipeline_id, name, filter, options = T.unsafe(nil)); end end +# pkg:gem/dogapi#lib/dogapi/v1/logs_pipeline.rb:8 Dogapi::V1::LogsPipelineService::API_VERSION = T.let(T.unsafe(nil), String) +# pkg:gem/dogapi#lib/dogapi/v1/metadata.rb:8 class Dogapi::V1::MetadataService < ::Dogapi::APIService + # pkg:gem/dogapi#lib/dogapi/v1/metadata.rb:12 def get(metric_name); end + + # pkg:gem/dogapi#lib/dogapi/v1/metadata.rb:16 def update(metric_name, options = T.unsafe(nil)); end end +# pkg:gem/dogapi#lib/dogapi/v1/metadata.rb:10 Dogapi::V1::MetadataService::API_VERSION = T.let(T.unsafe(nil), String) +# Event-specific client affording more granular control than the simple Dogapi::Client +# +# pkg:gem/dogapi#lib/dogapi/v1/metric.rb:9 class Dogapi::V1::MetricService < ::Dogapi::APIService + # pkg:gem/dogapi#lib/dogapi/v1/metric.rb:40 def flush_buffer; end + + # pkg:gem/dogapi#lib/dogapi/v1/metric.rb:13 def get(query, from, to); end + + # pkg:gem/dogapi#lib/dogapi/v1/metric.rb:89 def get_active_metrics(from); end + + # pkg:gem/dogapi#lib/dogapi/v1/metric.rb:62 def make_metric_payload(metric, points, scope, options); end + + # pkg:gem/dogapi#lib/dogapi/v1/metric.rb:46 def submit(*args); end + + # pkg:gem/dogapi#lib/dogapi/v1/metric.rb:29 def submit_to_api(metric, points, scope, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/metric.rb:34 def submit_to_buffer(metric, points, scope, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/metric.rb:54 def switch_to_batched; end + + # pkg:gem/dogapi#lib/dogapi/v1/metric.rb:58 def switch_to_single; end + + # pkg:gem/dogapi#lib/dogapi/v1/metric.rb:22 def upload(metrics); end end +# pkg:gem/dogapi#lib/dogapi/v1/metric.rb:11 Dogapi::V1::MetricService::API_VERSION = T.let(T.unsafe(nil), String) +# for namespacing +# +# pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:7 class Dogapi::V1::MonitorService < ::Dogapi::APIService + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:45 def can_delete_monitors(monitor_ids); end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:140 def cancel_downtime(downtime_id); end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:144 def cancel_downtime_by_scope(scope); end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:56 def delete_monitor(monitor_id, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:148 def get_all_downtimes(options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:60 def get_all_monitors(options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:136 def get_downtime(downtime_id, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:32 def get_monitor(monitor_id, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:10 def monitor(type, query, options = T.unsafe(nil)); end + + # HOST MUTING + # + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:155 def mute_host(hostname, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:94 def mute_monitor(monitor_id, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:86 def mute_monitors; end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:102 def resolve_monitors(monitor_groups = T.unsafe(nil), options = T.unsafe(nil), version = T.unsafe(nil)); end + + # DOWNTIMES + # + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:124 def schedule_downtime(scope, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:117 def search_monitor_groups(options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:113 def search_monitors(options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:159 def unmute_host(hostname); end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:98 def unmute_monitor(monitor_id, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:90 def unmute_monitors; end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:132 def update_downtime(downtime_id, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:19 def update_monitor(monitor_id, query = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:77 def validate_monitor(type, query, options = T.unsafe(nil)); end end +# pkg:gem/dogapi#lib/dogapi/v1/monitor.rb:8 Dogapi::V1::MonitorService::API_VERSION = T.let(T.unsafe(nil), String) +# for namespacing +# +# pkg:gem/dogapi#lib/dogapi/v1/screenboard.rb:8 class Dogapi::V1::ScreenboardService < ::Dogapi::APIService + # pkg:gem/dogapi#lib/dogapi/v1/screenboard.rb:12 def create_screenboard(description); end + + # pkg:gem/dogapi#lib/dogapi/v1/screenboard.rb:28 def delete_screenboard(board_id); end + + # pkg:gem/dogapi#lib/dogapi/v1/screenboard.rb:24 def get_all_screenboards; end + + # pkg:gem/dogapi#lib/dogapi/v1/screenboard.rb:20 def get_screenboard(board_id); end + + # pkg:gem/dogapi#lib/dogapi/v1/screenboard.rb:36 def revoke_screenboard(board_id); end + + # pkg:gem/dogapi#lib/dogapi/v1/screenboard.rb:32 def share_screenboard(board_id); end + + # pkg:gem/dogapi#lib/dogapi/v1/screenboard.rb:16 def update_screenboard(board_id, description); end end +# pkg:gem/dogapi#lib/dogapi/v1/screenboard.rb:10 Dogapi::V1::ScreenboardService::API_VERSION = T.let(T.unsafe(nil), String) +# for namespacing +# +# pkg:gem/dogapi#lib/dogapi/v1/search.rb:8 class Dogapi::V1::SearchService < ::Dogapi::APIService + # pkg:gem/dogapi#lib/dogapi/v1/search.rb:12 def search(query); end end +# pkg:gem/dogapi#lib/dogapi/v1/search.rb:10 Dogapi::V1::SearchService::API_VERSION = T.let(T.unsafe(nil), String) +# pkg:gem/dogapi#lib/dogapi/v1/service_check.rb:8 class Dogapi::V1::ServiceCheckService < ::Dogapi::APIService + # pkg:gem/dogapi#lib/dogapi/v1/service_check.rb:12 def service_check(check, host, status, options = T.unsafe(nil)); end end +# pkg:gem/dogapi#lib/dogapi/v1/service_check.rb:10 Dogapi::V1::ServiceCheckService::API_VERSION = T.let(T.unsafe(nil), String) +# Implements Service Level Objectives endpoints +# +# pkg:gem/dogapi#lib/dogapi/v1/service_level_objective.rb:9 class Dogapi::V1::ServiceLevelObjectiveService < ::Dogapi::APIService + # pkg:gem/dogapi#lib/dogapi/v1/service_level_objective.rb:103 def can_delete_service_level_objective(slo_ids); end + + # pkg:gem/dogapi#lib/dogapi/v1/service_level_objective.rb:13 def create_service_level_objective(type, slo_name, thresholds, options = T.unsafe(nil)); end + + # pkg:gem/dogapi#lib/dogapi/v1/service_level_objective.rb:83 def delete_many_service_level_objective(slo_ids); end + + # pkg:gem/dogapi#lib/dogapi/v1/service_level_objective.rb:79 def delete_service_level_objective(slo_id); end + + # pkg:gem/dogapi#lib/dogapi/v1/service_level_objective.rb:90 def delete_timeframes_service_level_objective(ops); end + + # pkg:gem/dogapi#lib/dogapi/v1/service_level_objective.rb:62 def get_service_level_objective(slo_id); end + + # pkg:gem/dogapi#lib/dogapi/v1/service_level_objective.rb:95 def get_service_level_objective_history(slo_id, from_ts, to_ts); end + + # pkg:gem/dogapi#lib/dogapi/v1/service_level_objective.rb:66 def search_service_level_objective(slo_ids, query, offset, limit); end + + # pkg:gem/dogapi#lib/dogapi/v1/service_level_objective.rb:37 def update_service_level_objective(slo_id, type, options = T.unsafe(nil)); end end +# pkg:gem/dogapi#lib/dogapi/v1/service_level_objective.rb:11 Dogapi::V1::ServiceLevelObjectiveService::API_VERSION = T.let(T.unsafe(nil), String) +# for namespacing +# +# pkg:gem/dogapi#lib/dogapi/v1/snapshot.rb:8 class Dogapi::V1::SnapshotService < ::Dogapi::APIService + # pkg:gem/dogapi#lib/dogapi/v1/snapshot.rb:12 def snapshot(metric_query, start_ts, end_ts, event_query = T.unsafe(nil)); end end +# pkg:gem/dogapi#lib/dogapi/v1/snapshot.rb:10 Dogapi::V1::SnapshotService::API_VERSION = T.let(T.unsafe(nil), String) +# for namespacing +# SyntheticsService is the class responsible for dealing with the synthetics +# +# pkg:gem/dogapi#lib/dogapi/v1/synthetics.rb:8 class Dogapi::V1::SyntheticsService < ::Dogapi::APIService + # Create a synthetics test: POST /v1/synthetics/tests/ + # + # pkg:gem/dogapi#lib/dogapi/v1/synthetics.rb:13 def create_synthetics_test(type, config, options = T.unsafe(nil)); end + + # Delete synthetics tests + # + # pkg:gem/dogapi#lib/dogapi/v1/synthetics.rb:33 def delete_synthetics_tests(test_ids); end + + # Get all synthetics tests: GET /v1/synthetics/tests + # + # pkg:gem/dogapi#lib/dogapi/v1/synthetics.rb:49 def get_all_synthetics_tests; end + + # Get devices for browser checks: GET /v1/synthetics/browser/devices + # + # pkg:gem/dogapi#lib/dogapi/v1/synthetics.rb:70 def get_synthetics_devices; end + + # Get available locations: GET /v1/synthetics/locations + # + # pkg:gem/dogapi#lib/dogapi/v1/synthetics.rb:75 def get_synthetics_locations; end + + # Get a specific result for a synthetics test: + # GET /v1/synthetics/tests//results/ + # + # pkg:gem/dogapi#lib/dogapi/v1/synthetics.rb:65 def get_synthetics_result(test_id, result_id); end + + # Get the most recent results for a synthetics test: GET /v1/synthetics/tests//results + # + # pkg:gem/dogapi#lib/dogapi/v1/synthetics.rb:59 def get_synthetics_results(test_id); end + + # Get info on a synthetics test: GET /v1/synthetics/tests/ + # + # pkg:gem/dogapi#lib/dogapi/v1/synthetics.rb:54 def get_synthetics_test(test_id); end + + # Start of pause a synthetics test: POST /v1/synthetics/tests//status + # + # pkg:gem/dogapi#lib/dogapi/v1/synthetics.rb:41 def start_pause_synthetics_test(test_id, new_status); end + + # Edit a synthetics test: PUT /v1/synthetics/tests/ + # + # pkg:gem/dogapi#lib/dogapi/v1/synthetics.rb:23 def update_synthetics_test(test_id, type, config, options = T.unsafe(nil)); end end +# pkg:gem/dogapi#lib/dogapi/v1/synthetics.rb:10 Dogapi::V1::SyntheticsService::API_VERSION = T.let(T.unsafe(nil), String) +# pkg:gem/dogapi#lib/dogapi/v1/tag.rb:9 class Dogapi::V1::TagService < ::Dogapi::APIService + # Adds a list of tags to a host + # + # pkg:gem/dogapi#lib/dogapi/v1/tag.rb:37 def add(host_id, tags, source = T.unsafe(nil)); end + + # Remove all tags from a host + # + # pkg:gem/dogapi#lib/dogapi/v1/tag.rb:71 def detach(host_id, source = T.unsafe(nil)); end + + # DEPRECATED: Spelling mistake temporarily preserved as an alias. + # + # pkg:gem/dogapi#lib/dogapi/v1/tag.rb:65 def detatch(host_id); end + + # Gets all tags for a given host + # + # pkg:gem/dogapi#lib/dogapi/v1/tag.rb:24 def get(host_id, source = T.unsafe(nil), by_source = T.unsafe(nil)); end + + # Gets all tags in your org and the hosts tagged with them + # + # pkg:gem/dogapi#lib/dogapi/v1/tag.rb:14 def get_all(source = T.unsafe(nil)); end + + # Remove all tags from a host and replace them with a new list + # + # pkg:gem/dogapi#lib/dogapi/v1/tag.rb:51 def update(host_id, tags, source = T.unsafe(nil)); end end +# pkg:gem/dogapi#lib/dogapi/v1/tag.rb:11 Dogapi::V1::TagService::API_VERSION = T.let(T.unsafe(nil), String) +# for namespacing +# +# pkg:gem/dogapi#lib/dogapi/v1/usage.rb:8 class Dogapi::V1::UsageService < ::Dogapi::APIService + # Retrieve hourly custom metrics usage information + # + # :start_hr => String: Datetime ISO-8601 UTC YYYY-MM-DDThh, for usage beginning at this hour + # :end_hr => String: Datetime ISO-8601 UTC YYYY-MM-DDThh, default start_hr+1d, for usage ending BEFORE this hour + # + # pkg:gem/dogapi#lib/dogapi/v1/usage.rb:44 def get_custom_metrics_usage(start_hr, end_hr = T.unsafe(nil)); end + + # Retrieve hourly fargate usage information + # + # :start_hr => String: Datetime ISO-8601 UTC YYYY-MM-DDThh, for usage beginning at this hour + # :end_hr => String: Datetime ISO-8601 UTC YYYY-MM-DDThh, default start_hr+1d, for usage ending BEFORE this hour + # + # pkg:gem/dogapi#lib/dogapi/v1/usage.rb:86 def get_fargate_usage(start_hr, end_hr = T.unsafe(nil)); end + + # Retrieve hourly host usage information + # + # :start_hr => String: Datetime ISO-8601 UTC YYYY-MM-DDThh, for usage beginning at this hour + # :end_hr => String: Datetime ISO-8601 UTC YYYY-MM-DDThh, default start_hr+1d, for usage ending BEFORE this hour + # + # pkg:gem/dogapi#lib/dogapi/v1/usage.rb:16 def get_hosts_usage(start_hr, end_hr = T.unsafe(nil)); end + + # Retrieve hourly logs usage information + # + # :start_hr => String: Datetime ISO-8601 UTC YYYY-MM-DDThh, for usage beginning at this hour + # :end_hr => String: Datetime ISO-8601 UTC YYYY-MM-DDThh, default start_hr+1d, for usage ending BEFORE this hour + # + # pkg:gem/dogapi#lib/dogapi/v1/usage.rb:30 def get_logs_usage(start_hr, end_hr = T.unsafe(nil)); end + + # Retrieve hourly synthetics usage information + # + # :start_hr => String: Datetime ISO-8601 UTC YYYY-MM-DDThh, for usage beginning at this hour + # :end_hr => String: Datetime ISO-8601 UTC YYYY-MM-DDThh, default start_hr+1d, for usage ending BEFORE this hour + # + # pkg:gem/dogapi#lib/dogapi/v1/usage.rb:72 def get_synthetics_usage(start_hr, end_hr = T.unsafe(nil)); end + + # Retrieve hourly trace search usage information + # + # :start_hr => String: Datetime ISO-8601 UTC YYYY-MM-DDThh, for usage beginning at this hour + # :end_hr => String: Datetime ISO-8601 UTC YYYY-MM-DDThh, default start_hr+1d, for usage ending BEFORE this hour + # + # pkg:gem/dogapi#lib/dogapi/v1/usage.rb:58 def get_traces_usage(start_hr, end_hr = T.unsafe(nil)); end end +# pkg:gem/dogapi#lib/dogapi/v1/usage.rb:10 Dogapi::V1::UsageService::API_VERSION = T.let(T.unsafe(nil), String) +# for namespacing +# +# pkg:gem/dogapi#lib/dogapi/v1/user.rb:8 class Dogapi::V1::UserService < ::Dogapi::APIService + # Create a user + # + # :description => Hash: user description containing 'handle' and 'name' properties + # + # pkg:gem/dogapi#lib/dogapi/v1/user.rb:27 def create_user(description = T.unsafe(nil)); end + + # Disable a user + # + # :handle => String: user handle + # + # pkg:gem/dogapi#lib/dogapi/v1/user.rb:55 def disable_user(handle); end + + # Retrieve all users + # + # pkg:gem/dogapi#lib/dogapi/v1/user.rb:39 def get_all_users; end + + # Retrieve user information + # + # :handle => String: user handle + # + # pkg:gem/dogapi#lib/dogapi/v1/user.rb:34 def get_user(handle); end + + # DEPRECATED: Going forward, we're using a new and more restful API, + # the new methods are get_user, create_user, update_user, disable_user + # + # pkg:gem/dogapi#lib/dogapi/v1/user.rb:14 def invite(emails, options = T.unsafe(nil)); end + + # Update a user + # + # :handle => String: user handle + # :description => Hash: user description optionally containing 'name', 'email', + # 'is_admin', 'disabled' properties + # + # pkg:gem/dogapi#lib/dogapi/v1/user.rb:48 def update_user(handle, description = T.unsafe(nil)); end end +# pkg:gem/dogapi#lib/dogapi/v1/user.rb:10 Dogapi::V1::UserService::API_VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/dogapi#lib/dogapi/v2/dashboard_list.rb:6 class Dogapi::V2; end +# Dashboard List API +# +# pkg:gem/dogapi#lib/dogapi/v2/dashboard_list.rb:9 class Dogapi::V2::DashboardListService < ::Dogapi::APIService + # pkg:gem/dogapi#lib/dogapi/v2/dashboard_list.rb:25 def add_items(resource_id, dashboards); end + + # pkg:gem/dogapi#lib/dogapi/v2/dashboard_list.rb:53 def delete_items(resource_id, dashboards); end + + # pkg:gem/dogapi#lib/dogapi/v2/dashboard_list.rb:15 def get_items(resource_id); end + + # pkg:gem/dogapi#lib/dogapi/v2/dashboard_list.rb:39 def update_items(resource_id, dashboards); end end +# pkg:gem/dogapi#lib/dogapi/v2/dashboard_list.rb:11 Dogapi::V2::DashboardListService::API_VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/dogapi#lib/dogapi/v2/dashboard_list.rb:12 Dogapi::V2::DashboardListService::RESOURCE_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/dogapi#lib/dogapi/v2/dashboard_list.rb:13 Dogapi::V2::DashboardListService::SUB_RESOURCE_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/dogapi#lib/dogapi/version.rb:6 Dogapi::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/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.8.2.rbi b/sorbet/rbi/gems/io-console@0.8.2.rbi new file mode 100644 index 0000000..73616ab --- /dev/null +++ b/sorbet/rbi/gems/io-console@0.8.2.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..35eec9f --- /dev/null +++ b/sorbet/rbi/gems/loofah@2.25.2.rbi @@ -0,0 +1,9 @@ +# 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`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/manual.rbi b/sorbet/rbi/gems/manual.rbi deleted file mode 100644 index c81088e..0000000 --- a/sorbet/rbi/gems/manual.rbi +++ /dev/null @@ -1,4 +0,0 @@ -class Pathname - def glob(glob) - end -end diff --git a/sorbet/rbi/gems/method_source@1.1.0.rbi b/sorbet/rbi/gems/method_source@1.1.0.rbi new file mode 100644 index 0000000..feaff62 --- /dev/null +++ b/sorbet/rbi/gems/method_source@1.1.0.rbi @@ -0,0 +1,293 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `method_source` gem. +# Please instead update this file by running `bin/tapioca gem method_source`. + + +# pkg:gem/method_source#lib/method_source.rb:163 +class Method + include ::MethodSource::SourceLocation::MethodExtensions + include ::MethodSource::MethodExtensions +end + +# pkg:gem/method_source#lib/method_source/version.rb:1 +module MethodSource + extend ::MethodSource::CodeHelpers + + class << self + # Clear cache. + # + # pkg:gem/method_source#lib/method_source.rb:59 + def clear_cache; end + + # Helper method responsible for opening source file and buffering up + # the comments for a specified method. Defined here to avoid polluting + # `Method` class. + # @param [Array] source_location The array returned by Method#source_location + # @param [String] method_name + # @return [String] The comments up to the point of the method. + # + # pkg:gem/method_source#lib/method_source.rb:38 + def comment_helper(source_location, name = T.unsafe(nil)); end + + # @deprecated — use MethodSource::CodeHelpers#expression_at + # + # pkg:gem/method_source#lib/method_source.rb:71 + def extract_code(source_location); end + + # Load a memoized copy of the lines in a file. + # + # @param [String] file_name + # @param [String] method_name + # @return [Array] the contents of the file + # @raise [SourceNotFoundError] + # + # pkg:gem/method_source#lib/method_source.rb:51 + def lines_for(file_name, name = T.unsafe(nil)); end + + # Helper method responsible for extracting method body. + # Defined here to avoid polluting `Method` class. + # @param [Array] source_location The array returned by Method#source_location + # @param [String] method_name + # @return [String] The method body + # + # pkg:gem/method_source#lib/method_source.rb:23 + def source_helper(source_location, name = T.unsafe(nil)); end + + # @deprecated — use MethodSource::CodeHelpers#complete_expression? + # + # pkg:gem/method_source#lib/method_source.rb:64 + def valid_expression?(str); end + end +end + +# pkg:gem/method_source#lib/method_source/code_helpers.rb:3 +module MethodSource::CodeHelpers + # Retrieve the comment describing the expression on the given line of the given file. + # + # This is useful to get module or method documentation. + # + # @param [Array, File, String] file The file to parse, either as a File or as + # a String or an Array of lines. + # @param [Integer] line_number The line number at which to look. + # NOTE: The first line in a file is line 1! + # @return [String] The comment + # + # pkg:gem/method_source#lib/method_source/code_helpers.rb:52 + def comment_describing(file, line_number); end + + # Determine if a string of code is a complete Ruby expression. + # @param [String] code The code to validate. + # @return [Boolean] Whether or not the code is a complete Ruby expression. + # @raise [SyntaxError] Any SyntaxError that does not represent incompleteness. + # @example + # complete_expression?("class Hello") #=> false + # complete_expression?("class Hello; end") #=> true + # complete_expression?("class 123") #=> SyntaxError: unexpected tINTEGER + # + # pkg:gem/method_source#lib/method_source/code_helpers.rb:66 + def complete_expression?(str); end + + # Retrieve the first expression starting on the given line of the given file. + # + # This is useful to get module or method source code. + # + # @param [Array, File, String] file The file to parse, either as a File or as + # @param [Integer] line_number The line number at which to look. + # NOTE: The first line in a file is + # line 1! + # @param [Hash] options The optional configuration parameters. + # @option options [Boolean] :strict If set to true, then only completely + # valid expressions are returned. Otherwise heuristics are used to extract + # expressions that may have been valid inside an eval. + # @option options [Integer] :consume A number of lines to automatically + # consume (add to the expression buffer) without checking for validity. + # @return [String] The first complete expression + # @raise [SyntaxError] If the first complete expression can't be identified + # + # pkg:gem/method_source#lib/method_source/code_helpers.rb:20 + def expression_at(file, line_number, options = T.unsafe(nil)); end + + private + + # Get the first expression from the input. + # + # @param [Array] lines + # @param [Integer] consume A number of lines to automatically + # consume (add to the expression buffer) without checking for validity. + # @yield a clean-up function to run before checking for complete_expression + # @return [String] a valid ruby expression + # @raise [SyntaxError] + # + # pkg:gem/method_source#lib/method_source/code_helpers.rb:92 + def extract_first_expression(lines, consume = T.unsafe(nil), &block); end + + # Get the last comment from the input. + # + # @param [Array] lines + # @return [String] + # + # pkg:gem/method_source#lib/method_source/code_helpers.rb:106 + def extract_last_comment(lines); end +end + +# An exception matcher that matches only subsets of SyntaxErrors that can be +# fixed by adding more input to the buffer. +# +# pkg:gem/method_source#lib/method_source/code_helpers.rb:124 +module MethodSource::CodeHelpers::IncompleteExpression + class << self + # pkg:gem/method_source#lib/method_source/code_helpers.rb:137 + def ===(ex); end + + # pkg:gem/method_source#lib/method_source/code_helpers.rb:149 + def rbx?; end + end +end + +# pkg:gem/method_source#lib/method_source/code_helpers.rb:125 +MethodSource::CodeHelpers::IncompleteExpression::GENERIC_REGEXPS = T.let(T.unsafe(nil), Array) + +# pkg:gem/method_source#lib/method_source/code_helpers.rb:133 +MethodSource::CodeHelpers::IncompleteExpression::RBX_ONLY_REGEXPS = T.let(T.unsafe(nil), Array) + +# This module is to be included by `Method` and `UnboundMethod` and +# provides the `#source` functionality +# +# pkg:gem/method_source#lib/method_source.rb:77 +module MethodSource::MethodExtensions + # Return the comments associated with the method class/module. + # @return [String] The method's comments as a string + # @raise SourceNotFoundException + # + # @example + # MethodSource::MethodExtensions.method(:included).module_comment + # => + # # This module is to be included by `Method` and `UnboundMethod` and + # # provides the `#source` functionality + # + # pkg:gem/method_source#lib/method_source.rb:139 + def class_comment; end + + # Return the comments associated with the method as a string. + # @return [String] The method's comments as a string + # @raise SourceNotFoundException + # + # @example + # Set.instance_method(:clear).comment.display + # => + # # Removes all elements and returns self. + # + # pkg:gem/method_source#lib/method_source.rb:126 + def comment; end + + # pkg:gem/method_source#lib/method_source.rb:159 + def module_comment; end + + # Return the sourcecode for the method as a string + # @return [String] The method sourcecode as a string + # @raise SourceNotFoundException + # + # @example + # Set.instance_method(:clear).source.display + # => + # def clear + # @hash.clear + # self + # end + # + # pkg:gem/method_source#lib/method_source.rb:114 + def source; end + + class << self + # We use the included hook to patch Method#source on rubinius. + # We need to use the included hook as Rubinius defines a `source` + # on Method so including a module will have no effect (as it's + # higher up the MRO). + # @param [Class] klass The class that includes the module. + # + # pkg:gem/method_source#lib/method_source.rb:84 + def included(klass); end + end +end + +# pkg:gem/method_source#lib/method_source/source_location.rb:2 +module MethodSource::ReeSourceLocation + # Ruby enterprise edition provides all the information that's + # needed, in a slightly different way. + # + # pkg:gem/method_source#lib/method_source/source_location.rb:5 + def source_location; end +end + +# pkg:gem/method_source#lib/method_source/source_location.rb:10 +module MethodSource::SourceLocation; end + +# pkg:gem/method_source#lib/method_source/source_location.rb:11 +module MethodSource::SourceLocation::MethodExtensions + # JRuby version source_location hack + # @return [Array] A two element array containing the source location of the method + # Return the source location of a method for Ruby 1.8. + # @return [Array] A two element array. First element is the + # file, second element is the line in the file where the + # method definition is found. + # + # pkg:gem/method_source#lib/method_source/source_location.rb:40 + def source_location; end + + private + + # pkg:gem/method_source#lib/method_source/source_location.rb:26 + def trace_func(event, file, line, id, binding, classname); end +end + +# pkg:gem/method_source#lib/method_source/source_location.rb:54 +module MethodSource::SourceLocation::ProcExtensions + # Return the source location for a Proc (Rubinius only) + # @return [Array] A two element array. First element is the + # file, second element is the line in the file where the + # proc definition is found. + # Return the source location for a Proc (in implementations + # without Proc#source_location) + # @return [Array] A two element array. First element is the + # file, second element is the line in the file where the + # proc definition is found. + # + # pkg:gem/method_source#lib/method_source/source_location.rb:74 + def source_location; end +end + +# pkg:gem/method_source#lib/method_source/source_location.rb:81 +module MethodSource::SourceLocation::UnboundMethodExtensions + # JRuby version source_location hack + # @return [Array] A two element array containing the source location of the method + # Return the source location of an instance method for Ruby 1.8. + # @return [Array] A two element array. First element is the + # file, second element is the line in the file where the + # method definition is found. + # + # pkg:gem/method_source#lib/method_source/source_location.rb:101 + def source_location; end +end + +# An Exception to mark errors that were raised trying to find the source from +# a given source_location. +# +# pkg:gem/method_source#lib/method_source.rb:16 +class MethodSource::SourceNotFoundError < ::StandardError; end + +# pkg:gem/method_source#lib/method_source/version.rb:2 +MethodSource::VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/method_source#lib/method_source.rb:173 +class Proc + include ::MethodSource::SourceLocation::ProcExtensions + include ::MethodSource::MethodExtensions +end + +# pkg:gem/method_source#lib/method_source.rb:168 +class UnboundMethod + include ::MethodSource::SourceLocation::UnboundMethodExtensions + include ::MethodSource::MethodExtensions +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..3433366 --- /dev/null +++ b/sorbet/rbi/gems/minitest@6.0.6.rbi @@ -0,0 +1,1482 @@ +# 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: +# :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:755 +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 " {"foo" => "bar"} +# MultiJSON.generate({foo: "bar"}) #=> '{"foo":"bar"}' +# +# @example Specifying an adapter +# MultiJSON.use(:oj) +# MultiJSON.parse('{"foo":"bar"}', adapter: :json_gem) +# +# @api public +# Deprecated public API kept around for one major release +# +# Each method here emits a one-time deprecation warning on first call and +# delegates to its current-API counterpart. The whole file is loaded by +# {MultiJSON} so the deprecation surface stays out of the main module +# definition. +# +# @api private +# +# pkg:gem/multi_json#lib/multi_json/concurrency.rb:3 +module MultiJSON + extend ::MultiJSON::Options + extend ::MultiJSON::AdapterSelector + + # Returns the current adapter class + # + # Honors a fiber-local override set by {.with_adapter} so concurrent + # blocks observe their own adapter without clobbering the process-wide + # default. Falls back to the process default when no override is set. + # + # @api public + # @return [Class] the current adapter class + # @example + # MultiJSON.adapter #=> MultiJSON::Adapters::Oj + # + # pkg:gem/multi_json#lib/multi_json.rb:127 + def adapter; end + + # Sets the adapter to use for JSON operations + # + # @api public + # @return [Class] the loaded adapter class + # @example + # MultiJSON.adapter = :json_gem + # + # pkg:gem/multi_json#lib/multi_json.rb:159 + def adapter=(new_adapter); end + + # Returns the adapter to use for the given options + # + # ``nil`` is accepted as a no-options sentinel — explicit + # ``current_adapter(nil)`` calls fall through to the process default + # adapter without raising. + # + # @api public + # @param options [Hash, nil] options that may contain :adapter key, or + # nil to use the process default + # @return [Class] adapter class + # @example + # MultiJSON.current_adapter(adapter: :oj) #=> MultiJSON::Adapters::Oj + # + # pkg:gem/multi_json#lib/multi_json.rb:200 + def current_adapter(options = T.unsafe(nil)); end + + # Serializes a Ruby object to a JSON string + # + # @api public + # @param object [Object] object to serialize + # @param options [Hash] serialization options (adapter-specific) + # @return [String] JSON string + # @example + # MultiJSON.generate({foo: "bar"}) #=> '{"foo":"bar"}' + # + # pkg:gem/multi_json#lib/multi_json.rb:214 + def generate(object, options = T.unsafe(nil)); end + + # Parses a JSON string into a Ruby object + # + # Returns ``nil`` for ``nil``, empty, and whitespace-only inputs + # instead of raising. Pass an explicit non-blank string if you want + # to surface a {ParseError} for empty payloads at the call site. + # + # @api public + # @param string [String, #read] JSON string or IO-like object + # @param options [Hash] parsing options (adapter-specific) + # @return [Object, nil] parsed Ruby object, or nil for blank input + # @raise [ParseError] if parsing fails + # @raise [AdapterError] if the adapter doesn't define a ``ParseError`` constant + # @example + # MultiJSON.parse('{"foo":"bar"}') #=> {"foo" => "bar"} + # MultiJSON.parse("") #=> nil + # MultiJSON.parse(" \n") #=> nil + # + # pkg:gem/multi_json#lib/multi_json.rb:178 + def parse(string, options = T.unsafe(nil)); end + + # Sets the adapter to use for JSON operations + # + # The merged-options cache is only reset when the new adapter loads + # successfully. A failed ``use(:nonexistent)`` leaves the cache in + # place so the previously-active adapter keeps its cached entries. + # + # @api public + # @param new_adapter [Symbol, String, Module, nil] adapter specification + # @return [Class] the loaded adapter class + # @example + # MultiJSON.use(:oj) + # + # pkg:gem/multi_json#lib/multi_json.rb:145 + def use(new_adapter); end + + private + + # Instance-method delegate for the deprecated default_options getter + # + # @api private + # @deprecated Use {MultiJSON.load_options} or {MultiJSON.dump_options} instead + # @return [Hash] the current load options + # @example + # class Foo; include MultiJSON; end + # Foo.new.send(:default_options) + # + # pkg:gem/multi_json#lib/multi_json/deprecated.rb:110 + def default_options; end + + # Instance-method delegate for the deprecated default_options setter + # + # @api private + # @deprecated Use {MultiJSON.load_options=} and {MultiJSON.dump_options=} instead + # @param value [Hash] options hash + # @return [Hash] the options hash + # @example + # class Foo; include MultiJSON; end + # Foo.new.send(:default_options=, symbolize_keys: true) + # + # pkg:gem/multi_json#lib/multi_json/deprecated.rb:98 + def default_options=(value); end + + # Instance-method delegate for {MultiJSON.with_adapter} + # + # @api private + # @param new_adapter [Symbol, String, Module] adapter to use + # @yield block to execute with the temporary adapter + # @return [Object] result of the block + # @example + # class Foo; include MultiJSON; end + # Foo.new.send(:with_adapter, :json_gem) { ... } + # + # pkg:gem/multi_json#lib/multi_json.rb:264 + def with_adapter(new_adapter, &_arg1); end + + class << self + # Returns the current adapter class + # + # Honors a fiber-local override set by {.with_adapter} so concurrent + # blocks observe their own adapter without clobbering the process-wide + # default. Falls back to the process default when no override is set. + # + # @api public + # @return [Class] the current adapter class + # @example + # MultiJSON.adapter #=> MultiJSON::Adapters::Oj + # + # pkg:gem/multi_json#lib/multi_json.rb:127 + def adapter; end + + # pkg:gem/multi_json#lib/multi_json.rb:160 + def adapter=(new_adapter); end + + # pkg:gem/multi_json#lib/multi_json/deprecated.rb:55 + def cached_options(*args, **kwargs); end + + # Returns the adapter to use for the given options + # + # ``nil`` is accepted as a no-options sentinel — explicit + # ``current_adapter(nil)`` calls fall through to the process default + # adapter without raising. + # + # @api public + # @param options [Hash, nil] options that may contain :adapter key, or + # nil to use the process default + # @return [Class] adapter class + # @example + # MultiJSON.current_adapter(adapter: :oj) #=> MultiJSON::Adapters::Oj + # + # pkg:gem/multi_json#lib/multi_json.rb:200 + def current_adapter(options = T.unsafe(nil)); end + + # pkg:gem/multi_json#lib/multi_json/deprecated.rb:32 + def decode(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json/deprecated.rb:32 + def default_engine(*args, **kwargs, &block); end + + # Instance-method delegate for the deprecated default_options getter + # + # @api private + # @deprecated Use {MultiJSON.load_options} or {MultiJSON.dump_options} instead + # @return [Hash] the current load options + # @example + # class Foo; include MultiJSON; end + # Foo.new.send(:default_options) + # + # pkg:gem/multi_json#lib/multi_json/deprecated.rb:55 + def default_options(*args, **kwargs); end + + # Instance-method delegate for the deprecated default_options setter + # + # @api private + # @deprecated Use {MultiJSON.load_options=} and {MultiJSON.dump_options=} instead + # @param value [Hash] options hash + # @return [Hash] the options hash + # @example + # class Foo; include MultiJSON; end + # Foo.new.send(:default_options=, symbolize_keys: true) + # + # pkg:gem/multi_json#lib/multi_json/deprecated.rb:55 + def default_options=(*args, **kwargs); end + + # pkg:gem/multi_json#lib/multi_json/deprecated.rb:32 + def dump(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json/deprecated.rb:32 + def encode(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json/deprecated.rb:32 + def engine(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json/deprecated.rb:32 + def engine=(*args, **kwargs, &block); end + + # Serializes a Ruby object to a JSON string + # + # @api public + # @param object [Object] object to serialize + # @param options [Hash] serialization options (adapter-specific) + # @return [String] JSON string + # @example + # MultiJSON.generate({foo: "bar"}) #=> '{"foo":"bar"}' + # + # pkg:gem/multi_json#lib/multi_json.rb:214 + def generate(object, options = T.unsafe(nil)); end + + # pkg:gem/multi_json#lib/multi_json/deprecated.rb:32 + def load(*args, **kwargs, &block); end + + # Parses a JSON string into a Ruby object + # + # Returns ``nil`` for ``nil``, empty, and whitespace-only inputs + # instead of raising. Pass an explicit non-blank string if you want + # to surface a {ParseError} for empty payloads at the call site. + # + # @api public + # @param string [String, #read] JSON string or IO-like object + # @param options [Hash] parsing options (adapter-specific) + # @return [Object, nil] parsed Ruby object, or nil for blank input + # @raise [ParseError] if parsing fails + # @raise [AdapterError] if the adapter doesn't define a ``ParseError`` constant + # @example + # MultiJSON.parse('{"foo":"bar"}') #=> {"foo" => "bar"} + # MultiJSON.parse("") #=> nil + # MultiJSON.parse(" \n") #=> nil + # + # pkg:gem/multi_json#lib/multi_json.rb:178 + def parse(string, options = T.unsafe(nil)); end + + # Resolve the ``ParseError`` constant for an adapter class + # + # The result is memoized on the adapter class itself in a + # ``@_multi_json_parse_error`` ivar so subsequent ``MultiJSON.load`` + # calls skip the constant lookup entirely. The lookup is performed + # with ``inherit: false`` so a stray top-level ``::ParseError`` + # constant in the host process is correctly ignored on every + # supported Ruby implementation — TruffleRuby's ``::`` operator + # walks the ancestor chain and would otherwise pick up the top-level + # constant. Custom adapters that don't define their own + # ``ParseError`` get a clear {AdapterError} instead of the bare + # ``NameError`` Ruby would raise from the rescue clause. + # + # @api private + # @param adapter_class [Class] adapter class to inspect + # @return [Class] the adapter's ParseError class + # @raise [AdapterError] when the adapter doesn't define ParseError + # + # pkg:gem/multi_json#lib/multi_json.rb:100 + def parse_error_class_for(adapter_class); end + + # pkg:gem/multi_json#lib/multi_json/deprecated.rb:55 + def reset_cached_options!(*args, **kwargs); end + + # Sets the adapter to use for JSON operations + # + # The merged-options cache is only reset when the new adapter loads + # successfully. A failed ``use(:nonexistent)`` leaves the cache in + # place so the previously-active adapter keeps its cached entries. + # + # @api public + # @param new_adapter [Symbol, String, Module, nil] adapter specification + # @return [Class] the loaded adapter class + # @example + # MultiJSON.use(:oj) + # + # pkg:gem/multi_json#lib/multi_json.rb:145 + def use(new_adapter); end + + # Emit a deprecation warning at most once per process for the given key + # + # Defined as a singleton method (rather than via module_function) so + # there is exactly one definition for mutation tests to target. + # Public so the deprecated ``load_options`` / ``dump_options`` + # aliases on the {Options} mixin can invoke it without routing + # through ``MultiJSON.send(...)``. + # + # The warning is tagged with the ``:deprecated`` category so callers + # can silence the whole set with ``Warning[:deprecated] = false`` or + # surface it via ``ruby -W:deprecated`` — the standard Ruby idiom for + # library deprecations since 2.7. + # + # @api private + # @param key [Symbol] identifier for the deprecation (typically the method name) + # @param message [String] warning message to emit on first call + # @return [void] + # @example + # MultiJSON.warn_deprecation_once(:foo, "MultiJSON.foo is deprecated") + # + # pkg:gem/multi_json#lib/multi_json.rb:74 + def warn_deprecation_once(key, message); end + + # Executes a block using the specified adapter + # + # Defined as a singleton method so mutation testing has exactly one + # definition to target. The override is stored in fiber-local storage + # so concurrent fibers and threads each see their own adapter without + # racing on a shared module variable; nested calls save and restore + # the previous fiber-local value. + # + # @api public + # @param new_adapter [Symbol, String, Module] adapter to use + # @yield block to execute with the temporary adapter + # @return [Object] result of the block + # @example + # MultiJSON.with_adapter(:json_gem) { MultiJSON.dump({}) } + # + # pkg:gem/multi_json#lib/multi_json.rb:241 + def with_adapter(new_adapter); end + + # pkg:gem/multi_json#lib/multi_json/deprecated.rb:32 + def with_engine(*args, **kwargs, &block); end + + private + + # Define a deprecated alias that delegates to a new method name + # + # The generated singleton method emits a one-time deprecation + # warning naming the replacement, then forwards all positional and + # keyword arguments plus any block to ``replacement``. Used for the + # ``load`` / ``dump`` / ``decode`` / ``encode`` / ``engine*`` / + # ``with_engine`` / ``default_engine`` aliases that are scheduled + # for removal in v2.0. + # + # @api private + # @param name [Symbol] deprecated method name + # @param replacement [Symbol] current-API method to delegate to + # @return [Symbol] the defined method name + # @example + # deprecate_alias :load, :parse + # + # pkg:gem/multi_json#lib/multi_json/deprecated.rb:30 + def deprecate_alias(name, replacement); end + + # Define a deprecated method whose body needs custom delegation + # + # Used for the ``default_options`` / ``default_options=`` pair + # whose body fans out to multiple replacement methods, and for the + # ``cached_options`` / ``reset_cached_options!`` no-op stubs that + # have no current-API counterpart at all. The block runs in its + # own lexical ``self``, which is the ``MultiJSON`` module since + # every call site sits inside ``module MultiJSON`` below. + # + # @api private + # @param name [Symbol] deprecated method name + # @param message [String] warning to emit on first call + # @yield body to evaluate after the warning + # @return [Symbol] the defined method name + # @example + # deprecate_method(:cached_options, "...") { nil } + # + # pkg:gem/multi_json#lib/multi_json/deprecated.rb:54 + def deprecate_method(name, message, &body); end + end +end + +# Raised when an adapter cannot be loaded or is not recognized +# +# @api public +# +# pkg:gem/multi_json#lib/multi_json/adapter_error.rb:7 +class MultiJSON::AdapterError < ::ArgumentError + # Create a new AdapterError + # + # @api public + # @param message [String, nil] error message + # @param cause [Exception, nil] the original exception + # @return [AdapterError] new error instance + # @example + # AdapterError.new("Unknown adapter", cause: original_error) + # + # pkg:gem/multi_json#lib/multi_json/adapter_error.rb:16 + def initialize(message = T.unsafe(nil), cause: T.unsafe(nil)); end + + class << self + # Build an AdapterError from an original exception + # + # The original exception's class name is included in the message + # so a downstream consumer reading just the AdapterError can tell + # whether the underlying failure was a `LoadError`, an + # `ArgumentError` from the spec validator, or some other class + # without having to look at `error.cause` separately. + # + # @api public + # @param original_exception [Exception] the original load error + # @return [AdapterError] new error with formatted message + # @example + # AdapterError.build(LoadError.new("cannot load such file")) + # + # pkg:gem/multi_json#lib/multi_json/adapter_error.rb:34 + def build(original_exception); end + end +end + +# Handles adapter discovery, loading, and selection +# +# Adapters can be specified as: +# - Symbol/String: adapter name (e.g., :oj, "json_gem") +# - Module: adapter class directly +# - nil/false: use default adapter +# +# @api private +# +# pkg:gem/multi_json#lib/multi_json/adapter_selector.rb:12 +module MultiJSON::AdapterSelector + extend ::MultiJSON::AdapterSelector + + # Returns the default adapter to use + # + # @api private + # @return [Symbol] adapter name + # @example + # AdapterSelector.default_adapter #=> :oj + # + # pkg:gem/multi_json#lib/multi_json/adapter_selector.rb:61 + def default_adapter; end + + # Returns the default adapter class, excluding the given adapter name + # + # Used by adapters that only implement one direction (e.g. + # FastJsonparser only parses) so the other direction can be delegated + # to whichever library MultiJSON would otherwise pick. + # + # @api private + # @param excluded [Symbol] adapter name to skip during detection + # @return [Class] the adapter class + # @example + # AdapterSelector.default_adapter_excluding(:fast_jsonparser) #=> MultiJSON::Adapters::Oj + # + # pkg:gem/multi_json#lib/multi_json/adapter_selector.rb:76 + def default_adapter_excluding(excluded); end + + private + + # Detects the best available JSON adapter + # + # @api private + # @return [Symbol] adapter name + # + # pkg:gem/multi_json#lib/multi_json/adapter_selector.rb:91 + def detect_best_adapter; end + + # Returns the fallback adapter when no others available + # + # The json gem is a Ruby default gem since Ruby 1.9, so in practice + # the installable-adapter step always succeeds before reaching this + # fallback on any supported Ruby version. The warning below only + # fires in tests that deliberately break the require path. + # + # @api private + # @return [Symbol] the json_gem adapter name + # + # pkg:gem/multi_json#lib/multi_json/adapter_selector.rb:142 + def fallback_adapter; end + + # Tries to require and use an installable adapter + # + # @api private + # @param excluding [Symbol, nil] adapter name to skip during detection + # @return [Symbol, nil] adapter name if successfully required + # + # pkg:gem/multi_json#lib/multi_json/adapter_selector.rb:113 + def installable_adapter(excluding: T.unsafe(nil)); end + + # Loads an adapter from a specification + # + # @api private + # @param adapter_spec [Symbol, String, Module, nil, false] adapter specification + # @return [Class] the adapter class + # + # pkg:gem/multi_json#lib/multi_json/adapter_selector.rb:164 + def load_adapter(adapter_spec); end + + # Loads an adapter by its string name + # + # ``jrjackson`` (the JrJackson gem's name) is normalized to + # ``jr_jackson`` (the adapter file/class name) for backwards + # compatibility with the original gem-name alias. + # + # @api private + # @param name [String] adapter name + # @return [Class] the adapter class + # + # pkg:gem/multi_json#lib/multi_json/adapter_selector.rb:186 + def load_adapter_by_name(name); end + + # Finds an already-loaded JSON library + # + # @api private + # @param excluding [Symbol, nil] adapter name to skip during detection + # @return [Symbol, nil] adapter name if found + # + # pkg:gem/multi_json#lib/multi_json/adapter_selector.rb:100 + def loaded_adapter(excluding: T.unsafe(nil)); end + + # Attempts to require a JSON library + # + # @api private + # @param adapter_name [Symbol] adapter to require + # @return [Boolean] true if require succeeded + # + # pkg:gem/multi_json#lib/multi_json/adapter_selector.rb:126 + def try_require(adapter_name); end + + # Validate that an adapter satisfies the documented contract + # + # Custom adapters are accepted as modules/classes, so fail fast + # during adapter resolution rather than later on the first load or + # dump call. + # + # @api private + # @param adapter [Module] adapter class or module + # @return [Module] the validated adapter + # @raise [AdapterError] when the adapter is missing a required class method + # or ParseError constant + # + # pkg:gem/multi_json#lib/multi_json/adapter_selector.rb:206 + def validate_adapter!(adapter); end + + # Warns the user about reaching the last-resort fallback + # + # @api private + # @return [void] + # + # pkg:gem/multi_json#lib/multi_json/adapter_selector.rb:152 + def warn_about_fallback; end +end + +# Per-adapter metadata, in preference order (fastest first). Each +# entry maps the adapter symbol to its ``require`` path and the +# constant whose presence indicates the backing library is already +# loaded. ``loaded`` is a ``::``-separated path so we can walk it +# without an explicit ``defined?`` check. +# +# The hash order is split per platform: on MRI/TruffleRuby the +# bundled benchmark suite ranks json_gem ahead of fast_jsonparser/ +# oj/yajl on Ruby 3.4+; on JRuby the FFI-vs-pure-Ruby tradeoff +# hasn't been re-benchmarked yet, so jr_jackson stays first there. +# CI re-runs the benchmark with ``--verify-preference`` to fail +# if the observed ranking diverges. +# :nocov: +# +# pkg:gem/multi_json#lib/multi_json/adapter_selector.rb:28 +MultiJSON::AdapterSelector::ADAPTERS = T.let(T.unsafe(nil), Hash) + +# Backwards-compatible view of {ADAPTERS} that exposes only the +# require paths. Tests still poke at this constant to stub or break +# the require step. +# +# pkg:gem/multi_json#lib/multi_json/adapter_selector.rb:53 +MultiJSON::AdapterSelector::REQUIREMENT_MAP = T.let(T.unsafe(nil), Hash) + +# Catalog of process-wide mutexes used to serialize MultiJSON's lazy +# initializers and adapter swaps. Each mutex protects a distinct +# piece of mutable state. Callers go through {.synchronize} rather +# than touching the mutex constants directly so the constants +# themselves can stay {.private_constant} and the surface of the +# module is documented in one place. +# +# @api private +# +# pkg:gem/multi_json#lib/multi_json/concurrency.rb:12 +module MultiJSON::Concurrency + class << self + # Run a block while holding the named mutex + # + # The ``name`` symbol must be one of the keys in the internal + # ``MUTEXES`` table; an unknown name raises ``KeyError`` so a + # typo at the call site fails fast instead of silently dropping + # synchronization on the floor. + # + # @api private + # @param name [Symbol] mutex identifier + # @yield block to execute while holding the mutex + # @return [Object] the block's return value + # @raise [KeyError] when ``name`` does not match a known mutex + # @example + # MultiJSON::Concurrency.synchronize(:adapter) { ... } + # + # pkg:gem/multi_json#lib/multi_json/concurrency.rb:53 + def synchronize(name, &_arg1); end + end +end + +# Catalog of mutexes keyed by symbolic name. Each entry maps the +# public name passed to {.synchronize} to the underlying mutex +# instance. The names are documented inline so callers can find +# what each mutex protects without leaving this file. +# +# pkg:gem/multi_json#lib/multi_json/concurrency.rb:17 +MultiJSON::Concurrency::MUTEXES = T.let(T.unsafe(nil), Hash) + +# Tracks which deprecation warnings have already been emitted so each one +# fires at most once per process. Stored as a Set rather than a Hash so +# presence checks have unambiguous semantics for mutation tests. +# +# pkg:gem/multi_json#lib/multi_json.rb:52 +MultiJSON::DEPRECATION_WARNINGS_SHOWN = T.let(T.unsafe(nil), Set) + +# Legacy aliases for backward compatibility +# +# pkg:gem/multi_json#lib/multi_json/parse_error.rb:102 +MultiJSON::DecodeError = MultiJSON::ParseError + +# pkg:gem/multi_json#lib/multi_json/parse_error.rb:102 +MultiJSON::LoadError = MultiJSON::ParseError + +# Mixin providing configurable parse/generate options +# +# Supports static hashes or dynamic callables (procs/lambdas). +# Extended by both MultiJSON (global options) and Adapter classes. +# +# @api private +# +# pkg:gem/multi_json#lib/multi_json/options.rb:10 +module MultiJSON::Options + # Get default generate options + # + # @api private + # @deprecated Use {#default_generate_options} instead. Will be removed in v2.0. + # @return [Hash] frozen empty hash + # + # pkg:gem/multi_json#lib/multi_json/options.rb:155 + def default_dump_options; end + + # Get default generate options + # + # @api private + # @return [Hash] frozen empty hash + # + # pkg:gem/multi_json#lib/multi_json/options.rb:81 + def default_generate_options; end + + # Get default parse options + # + # @api private + # @deprecated Use {#default_parse_options} instead. Will be removed in v2.0. + # @return [Hash] frozen empty hash + # + # pkg:gem/multi_json#lib/multi_json/options.rb:146 + def default_load_options; end + + # Get default parse options + # + # @api private + # @return [Hash] frozen empty hash + # + # pkg:gem/multi_json#lib/multi_json/options.rb:73 + def default_parse_options; end + + # Get options for generate operations + # + # @api public + # @deprecated Use {#generate_options} instead. Will be removed in v2.0. + # @param args [Array] forwarded to the callable, ignored otherwise + # @return [Hash] resolved options hash + # @example + # MultiJSON.dump_options #=> {} + # + # pkg:gem/multi_json#lib/multi_json/options.rb:135 + def dump_options(*args); end + + # Set options for generate operations + # + # @api public + # @deprecated Use {#generate_options=} instead. Will be removed in v2.0. + # @param options [Hash, Proc] options hash or callable + # @return [Hash, Proc] the options + # @example + # MultiJSON.dump_options = {pretty: true} + # + # pkg:gem/multi_json#lib/multi_json/options.rb:107 + def dump_options=(options); end + + # Get options for generate operations + # + # @api public + # @param args [Array] forwarded to the callable, ignored otherwise + # @return [Hash] resolved options hash + # @example + # MultiJSON.generate_options #=> {} + # + # pkg:gem/multi_json#lib/multi_json/options.rb:65 + def generate_options(*args); end + + # Set options for generate operations + # + # @api public + # @param options [Hash, Proc] options hash or callable + # @return [Hash, Proc] the options + # @example + # MultiJSON.generate_options = {pretty: true} + # + # pkg:gem/multi_json#lib/multi_json/options.rb:37 + def generate_options=(options); end + + # Get options for parse operations + # + # @api public + # @deprecated Use {#parse_options} instead. Will be removed in v2.0. + # @param args [Array] forwarded to the callable, ignored otherwise + # @return [Hash] resolved options hash + # @example + # MultiJSON.load_options #=> {} + # + # pkg:gem/multi_json#lib/multi_json/options.rb:121 + def load_options(*args); end + + # Set options for parse operations + # + # @api public + # @deprecated Use {#parse_options=} instead. Will be removed in v2.0. + # @param options [Hash, Proc] options hash or callable + # @return [Hash, Proc] the options + # @example + # MultiJSON.load_options = {symbolize_keys: true} + # + # pkg:gem/multi_json#lib/multi_json/options.rb:93 + def load_options=(options); end + + # Get options for parse operations + # + # When `@parse_options` is a callable (proc/lambda), it's invoked + # with `args` as positional arguments — typically the merged + # options hash from `Adapter.merged_parse_options`. When it's a + # plain hash, `args` is ignored. + # + # @api public + # @param args [Array] forwarded to the callable, ignored otherwise + # @return [Hash] resolved options hash + # @example + # MultiJSON.parse_options #=> {} + # + # pkg:gem/multi_json#lib/multi_json/options.rb:54 + def parse_options(*args); end + + # Set options for parse operations + # + # @api public + # @param options [Hash, Proc] options hash or callable + # @return [Hash, Proc] the options + # @example + # MultiJSON.parse_options = {symbolize_keys: true} + # + # pkg:gem/multi_json#lib/multi_json/options.rb:25 + def parse_options=(options); end + + private + + # Invokes a callable options provider + # + # @api private + # @param callable [Proc] options provider + # @param args [Array] arguments forwarded when the callable is non-arity-zero + # @return [Hash] options returned by the callable + # + # pkg:gem/multi_json#lib/multi_json/options.rb:182 + def invoke_callable(callable, *args); end + + # Resolves options from a hash or callable + # + # @api private + # @param options [Hash, Proc, nil] options configuration + # @param args [Array] arguments forwarded to a callable provider + # @return [Hash, nil] resolved options hash + # + # pkg:gem/multi_json#lib/multi_json/options.rb:167 + def resolve_options(options, *args); end +end + +# Steep needs an inline `#:` annotation here because `{}.freeze` +# would be inferred as `Hash[untyped, untyped]` and trip +# `UnannotatedEmptyCollection`. The annotation requires +# `Hash.new.freeze` (not the `{}.freeze` rubocop would prefer) +# because the `#:` cast only applies to method-call results. +# +# pkg:gem/multi_json#lib/multi_json/options.rb:16 +MultiJSON::Options::EMPTY_OPTIONS = T.let(T.unsafe(nil), Hash) + +# Thread-safe bounded cache for merged options hashes +# +# Caches are separated for load and dump operations. Each cache is +# bounded to prevent unbounded memory growth when options are +# generated dynamically. The ``Store`` backend is chosen at load time +# based on ``RUBY_ENGINE``: JRuby uses Concurrent::Map (shipped as a +# runtime dependency of the java-platform gem); MRI and TruffleRuby +# use a Hash guarded by a Mutex. +# +# @api private +# +# pkg:gem/multi_json#lib/multi_json/options_cache.rb:14 +module MultiJSON::OptionsCache + class << self + # Get the dump options cache + # + # @api private + # @return [Store] dump cache store + # + # pkg:gem/multi_json#lib/multi_json/options_cache.rb:25 + def dump; end + + # Get the load options cache + # + # @api private + # @return [Store] load cache store + # + # pkg:gem/multi_json#lib/multi_json/options_cache.rb:31 + def load; end + + # Maximum number of entries per cache store + # + # Applies to both the dump and load caches. Existing entries are + # left in place until normal eviction trims them below a lowered + # limit; call {.reset} if you need to evict immediately. + # + # @api public + # @return [Integer] current cache size limit + # @example + # MultiJSON::OptionsCache.max_cache_size = 5000 + # MultiJSON::OptionsCache.max_cache_size #=> 5000 + # + # pkg:gem/multi_json#lib/multi_json/options_cache.rb:44 + def max_cache_size; end + + # Set the maximum number of entries per cache store + # + # @api public + # @param value [Integer] positive entry cap + # @return [Integer] the validated value + # @raise [ArgumentError] when value is not a positive Integer + # @example + # MultiJSON::OptionsCache.max_cache_size = 5000 + # + # pkg:gem/multi_json#lib/multi_json/options_cache.rb:54 + def max_cache_size=(value); end + + # Reset both caches + # + # @api private + # @return [void] + # + # pkg:gem/multi_json#lib/multi_json/options_cache.rb:64 + def reset; end + end +end + +# Dynamic require path so MRI (mutex_store) and JRuby +# (concurrent_store) execute the same physical line, avoiding a +# dead-branch ``require_relative`` that would otherwise drop +# JRuby's line coverage below 100%. +# +# pkg:gem/multi_json#lib/multi_json/options_cache.rb:80 +MultiJSON::OptionsCache::BACKENDS = T.let(T.unsafe(nil), Hash) + +# Default bound on the number of cached entries per store. Applications +# that dynamically generate many distinct option hashes can raise this +# via {.max_cache_size=}. +# +# pkg:gem/multi_json#lib/multi_json/options_cache.rb:18 +MultiJSON::OptionsCache::DEFAULT_MAX_CACHE_SIZE = T.let(T.unsafe(nil), Integer) + +# Thread-safe cache store backed by a Hash guarded by a Mutex +# +# Used on MRI and TruffleRuby, where a runtime dependency on +# concurrent-ruby would be overkill: the GVL on MRI makes single +# lookups atomic, and locking on both reads and writes keeps the +# small perf cost predictable across engines without adding a +# runtime dependency. +# +# @api private +# +# pkg:gem/multi_json#lib/multi_json/options_cache/mutex_store.rb:14 +class MultiJSON::OptionsCache::Store + # Create a new cache store + # + # @api private + # @return [Store] new store instance + # + # pkg:gem/multi_json#lib/multi_json/options_cache/mutex_store.rb:19 + def initialize; end + + # Fetch a value from cache or compute it + # + # When called with a block, returns the cached value or computes a + # new one. When called without a block, returns the cached value or + # the supplied default if the key is missing. Nil cached values are + # preserved because ``Hash#fetch`` only falls through to the default + # block when the key is truly missing. The ``block_given?`` check + # is hoisted out of the mutex so the no-block read path runs the + # check once per call instead of once inside the critical section. + # + # @api private + # @param key [Object] cache key + # @param default [Object] value to return when key is missing and no + # block is given + # @yield block to compute value if not cached + # @return [Object] cached, computed, or default value + # + # pkg:gem/multi_json#lib/multi_json/options_cache/mutex_store.rb:53 + def fetch(key, default = T.unsafe(nil)); end + + # Clear all cached entries + # + # Held under the mutex because TruffleRuby (which also uses this + # backend via the ruby-platform gem) has true parallelism: a + # concurrent ``fetch`` racing with ``Hash#clear`` could corrupt + # iteration in a way that MRI's GVL would otherwise prevent. + # + # @api private + # @return [void] + # + # pkg:gem/multi_json#lib/multi_json/options_cache/mutex_store.rb:33 + def reset; end +end + +# Raised when JSON parsing fails +# +# Wraps the underlying adapter's parse error with the original input +# data, plus best-effort line and column extraction from the adapter's +# error message. Line/column are populated for adapters that include +# them in their messages (Oj, the json gem) and remain nil for +# adapters that don't (Yajl, fast_jsonparser). +# +# @api public +# +# pkg:gem/multi_json#lib/multi_json/parse_error.rb:13 +class MultiJSON::ParseError < ::StandardError + # Create a new ParseError + # + # @api public + # @param message [String, nil] error message + # @param data [String, nil] the input that failed to parse + # @param cause [Exception, nil] the original exception + # @return [ParseError] new error instance + # @example + # ParseError.new("unexpected token at line 1 column 2", data: "{}") + # + # pkg:gem/multi_json#lib/multi_json/parse_error.rb:57 + def initialize(message = T.unsafe(nil), data: T.unsafe(nil), cause: T.unsafe(nil)); end + + # The 1-based column reported by the adapter + # + # @api public + # @return [Integer, nil] column number, or nil if the adapter's message + # did not include one + # @example + # error.column #=> 3 + # + # pkg:gem/multi_json#lib/multi_json/parse_error.rb:46 + def column; end + + # The input string that failed to parse + # + # @api public + # @return [String, nil] the original input data + # @example + # error.data #=> "{invalid json}" + # + # pkg:gem/multi_json#lib/multi_json/parse_error.rb:28 + def data; end + + # The 1-based line number reported by the adapter + # + # @api public + # @return [Integer, nil] line number, or nil if the adapter's message + # did not include one + # @example + # error.line #=> 1 + # + # pkg:gem/multi_json#lib/multi_json/parse_error.rb:37 + def line; end + + private + + # Match an adapter error message against the line/column pattern + # + # Adapter error messages sometimes embed bytes from the failing + # input (e.g., the json gem's ``"invalid byte sequence in UTF-8"`` + # error). The pattern is pure ASCII so it's compatible with any + # encoding, but a UTF-8 string with invalid bytes still trips the + # regex engine — ``String#scrub`` replaces those bytes so the + # match can proceed. Strings in binary (ASCII-8BIT) or any valid + # encoding pass through scrub untouched. + # + # @api private + # @param message [String, nil] the adapter's error message + # @return [MatchData, nil] the regex match, or nil if no message or + # no location fragment was found + # + # pkg:gem/multi_json#lib/multi_json/parse_error.rb:94 + def location_match(message); end + + class << self + # Build a ParseError from an original exception + # + # @api public + # @param original_exception [Exception] the adapter's parse error + # @param data [String] the input that failed to parse + # @return [ParseError] new error with formatted message + # @example + # ParseError.build(JSON::ParserError.new("..."), "{bad json}") + # + # pkg:gem/multi_json#lib/multi_json/parse_error.rb:74 + def build(original_exception, data); end + end +end + +# Regex that matches the "line N[, ]column M" fragment inside an +# adapter error message. The separator between line and column is +# permissive — Oj emits ``"line 1, column 3"`` while the json gem +# emits ``"line 1 column 2"`` — so ``[,\s]+`` covers both. Column +# is optional so messages like ``"at line 5"`` still yield a line. +# +# pkg:gem/multi_json#lib/multi_json/parse_error.rb:19 +MultiJSON::ParseError::LOCATION_PATTERN = T.let(T.unsafe(nil), Regexp) + +# Current version string in semver format +# +# pkg:gem/multi_json#lib/multi_json/version.rb:29 +MultiJSON::VERSION = T.let(T.unsafe(nil), String) + +# Version information for MultiJSON +# +# @api private +# +# pkg:gem/multi_json#lib/multi_json/version.rb:7 +class MultiJSON::Version + class << self + # Return the version string + # + # @api private + # @return [String] version in semver format + # + # pkg:gem/multi_json#lib/multi_json/version.rb:22 + def to_s; end + end +end + +# Major version number +# +# pkg:gem/multi_json#lib/multi_json/version.rb:9 +MultiJSON::Version::MAJOR = T.let(T.unsafe(nil), Integer) + +# Minor version number +# +# pkg:gem/multi_json#lib/multi_json/version.rb:11 +MultiJSON::Version::MINOR = T.let(T.unsafe(nil), Integer) + +# Patch version number +# +# pkg:gem/multi_json#lib/multi_json/version.rb:13 +MultiJSON::Version::PATCH = T.let(T.unsafe(nil), Integer) + +# Pre-release version suffix +# +# pkg:gem/multi_json#lib/multi_json/version.rb:15 +MultiJSON::Version::PRE = T.let(T.unsafe(nil), T.untyped) + +# Backward-compatible alias for the legacy ``MultiJson`` constant name +# +# Downstream code that still writes ``MultiJson.parse(...)`` or +# ``rescue MultiJson::ParseError`` continues to work, but emits a +# one-time deprecation warning pointing at ``MultiJSON``. Each public +# method on {MultiJSON} gets an explicit forwarder defined on this +# module, and constant access resolves via {.const_missing}, so both +# dotted calls and ``::`` constant lookups (including rescue clauses) +# route through the canonical module. +# +# @api public +# @deprecated Use {MultiJSON} (all-caps) instead. Will be removed in v2.0. +# +# pkg:gem/multi_json#lib/multi_json.rb:283 +module MultiJson + class << self + # pkg:gem/multi_json#lib/multi_json.rb:295 + def adapter(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def adapter=(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def append_features(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def cached_options(*args, **kwargs, &block); end + + # Resolve missing constants to their {MultiJSON} counterparts + # + # Enables ``rescue MultiJson::ParseError`` and + # ``MultiJson::Adapters::Oj`` to keep working during the + # deprecation cycle. + # + # @api public + # @param name [Symbol] constant name + # @return [Object] the resolved constant from {MultiJSON} + # @example + # MultiJson::ParseError # returns MultiJSON::ParseError + # + # pkg:gem/multi_json#lib/multi_json.rb:314 + def const_missing(name); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def current_adapter(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def decode(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def default_adapter(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def default_adapter_excluding(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def default_dump_options(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def default_engine(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def default_generate_options(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def default_load_options(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def default_options(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def default_options=(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def default_parse_options(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def dump(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def dump_options(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def dump_options=(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def encode(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def engine(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def engine=(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def extend_object(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def generate(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def generate_options(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def generate_options=(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def load(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def load_options(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def load_options=(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def parse(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def parse_error_class_for(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def parse_options(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def parse_options=(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def prepend_features(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def reset_cached_options!(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def use(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def warn_deprecation_once(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def with_adapter(*args, **kwargs, &block); end + + # pkg:gem/multi_json#lib/multi_json.rb:295 + def with_engine(*args, **kwargs, &block); end + end +end diff --git a/sorbet/rbi/gems/netrc@0.11.0.rbi b/sorbet/rbi/gems/netrc@0.11.0.rbi new file mode 100644 index 0000000..b1ad683 --- /dev/null +++ b/sorbet/rbi/gems/netrc@0.11.0.rbi @@ -0,0 +1,147 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `netrc` gem. +# Please instead update this file by running `bin/tapioca gem netrc`. + + +# pkg:gem/netrc#lib/netrc.rb:3 +class Netrc + # pkg:gem/netrc#lib/netrc.rb:166 + def initialize(path, data); end + + # pkg:gem/netrc#lib/netrc.rb:180 + def [](k); end + + # pkg:gem/netrc#lib/netrc.rb:188 + def []=(k, info); end + + # pkg:gem/netrc#lib/netrc.rb:200 + def delete(key); end + + # pkg:gem/netrc#lib/netrc.rb:211 + def each(&block); end + + # pkg:gem/netrc#lib/netrc.rb:196 + def length; end + + # pkg:gem/netrc#lib/netrc.rb:215 + def new_item(m, l, p); end + + # pkg:gem/netrc#lib/netrc.rb:178 + def new_item_prefix; end + + # pkg:gem/netrc#lib/netrc.rb:178 + def new_item_prefix=(_arg0); end + + # pkg:gem/netrc#lib/netrc.rb:219 + def save; end + + # pkg:gem/netrc#lib/netrc.rb:233 + def unparse; end + + class << self + # pkg:gem/netrc#lib/netrc.rb:42 + def check_permissions(path); end + + # pkg:gem/netrc#lib/netrc.rb:33 + def config; end + + # pkg:gem/netrc#lib/netrc.rb:37 + def configure; end + + # pkg:gem/netrc#lib/netrc.rb:10 + def default_path; end + + # pkg:gem/netrc#lib/netrc.rb:14 + def home_path; end + + # pkg:gem/netrc#lib/netrc.rb:85 + def lex(lines); end + + # pkg:gem/netrc#lib/netrc.rb:29 + def netrc_filename; end + + # Returns two values, a header and a list of items. + # Each item is a tuple, containing some or all of: + # - machine keyword (including trailing whitespace+comments) + # - machine name + # - login keyword (including surrounding whitespace+comments) + # - login + # - password keyword (including surrounding whitespace+comments) + # - password + # - trailing chars + # This lets us change individual fields, then write out the file + # with all its original formatting. + # + # pkg:gem/netrc#lib/netrc.rb:129 + def parse(ts); end + + # Reads path and parses it as a .netrc file. If path doesn't + # exist, returns an empty object. Decrypt paths ending in .gpg. + # + # pkg:gem/netrc#lib/netrc.rb:51 + def read(path = T.unsafe(nil)); end + + # pkg:gem/netrc#lib/netrc.rb:112 + def skip?(s); end + end +end + +# pkg:gem/netrc#lib/netrc.rb:8 +Netrc::CYGWIN = T.let(T.unsafe(nil), T.untyped) + +# pkg:gem/netrc#lib/netrc.rb:244 +class Netrc::Entry < ::Struct + # pkg:gem/netrc#lib/netrc.rb:244 + def login; end + + # pkg:gem/netrc#lib/netrc.rb:244 + def login=(_); end + + # pkg:gem/netrc#lib/netrc.rb:244 + def password; end + + # pkg:gem/netrc#lib/netrc.rb:244 + def password=(_); end + + # pkg:gem/netrc#lib/netrc.rb:245 + def to_ary; end + + class << self + # pkg:gem/netrc#lib/netrc.rb:244 + def [](*_arg0); end + + # pkg:gem/netrc#lib/netrc.rb:244 + def inspect; end + + # pkg:gem/netrc#lib/netrc.rb:244 + def keyword_init?; end + + # pkg:gem/netrc#lib/netrc.rb:244 + def members; end + + # pkg:gem/netrc#lib/netrc.rb:244 + def new(*_arg0); end + end +end + +# pkg:gem/netrc#lib/netrc.rb:250 +class Netrc::Error < ::StandardError; end + +# pkg:gem/netrc#lib/netrc.rb:68 +class Netrc::TokenArray < ::Array + # pkg:gem/netrc#lib/netrc.rb:76 + def readto; end + + # pkg:gem/netrc#lib/netrc.rb:69 + def take; end +end + +# pkg:gem/netrc#lib/netrc.rb:4 +Netrc::VERSION = T.let(T.unsafe(nil), String) + +# see http://stackoverflow.com/questions/4871309/what-is-the-correct-way-to-detect-if-ruby-is-running-on-windows +# +# pkg:gem/netrc#lib/netrc.rb:7 +Netrc::WINDOWS = T.let(T.unsafe(nil), T.untyped) diff --git a/sorbet/rbi/gems/nokogiri@1.19.4.rbi b/sorbet/rbi/gems/nokogiri@1.19.4.rbi new file mode 100644 index 0000000..7b99d0f --- /dev/null +++ b/sorbet/rbi/gems/nokogiri@1.19.4.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `nokogiri` gem. +# Please instead update this file by running `bin/tapioca gem nokogiri`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/packs-specification@0.0.11.rbi b/sorbet/rbi/gems/packs-specification@0.0.11.rbi new file mode 100644 index 0000000..bc2a1e4 --- /dev/null +++ b/sorbet/rbi/gems/packs-specification@0.0.11.rbi @@ -0,0 +1,160 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `packs-specification` gem. +# Please instead update this file by running `bin/tapioca gem packs-specification`. + + +# pkg:gem/packs-specification#lib/packs/rspec/fixture_helper.rb:4 +module FixtureHelper + # pkg:gem/packs-specification#lib/packs/rspec/fixture_helper.rb:30 + sig { params(path: ::String).void } + def delete_app_file(path); end + + # pkg:gem/packs-specification#lib/packs/rspec/fixture_helper.rb:8 + sig { params(path: ::String, content: ::String).returns(::String) } + def write_file(path, content = T.unsafe(nil)); end + + # pkg:gem/packs-specification#lib/packs/rspec/fixture_helper.rb:21 + sig { params(pack_name: ::String, config: T::Hash[T.untyped, T.untyped]).void } + def write_pack(pack_name, config = T.unsafe(nil)); end +end + +# We let `packs-specification` define some API methods such as all, find, and for_file, +# because this allows a production environment to require `packs-specification` only and get some simple functionality, without +# needing to load all of `packs`. +# +# pkg:gem/packs-specification#lib/packs/pack.rb:3 +module Packs + class << self + # pkg:gem/packs-specification#lib/packs-specification.rb:19 + sig { returns(T::Array[::Packs::Pack]) } + def all; end + + # pkg:gem/packs-specification#lib/packs-specification.rb:24 + sig { params(name: ::String).returns(T.nilable(::Packs::Pack)) } + def find(name); end + + # pkg:gem/packs-specification#lib/packs-specification.rb:29 + sig { params(file_path: T.any(::Pathname, ::String)).returns(T.nilable(::Packs::Pack)) } + def for_file(file_path); end + end +end + +# pkg:gem/packs-specification#lib/packs-specification.rb:13 +Packs::PACKAGE_FILE = T.let(T.unsafe(nil), String) + +# pkg:gem/packs-specification#lib/packs/pack.rb:4 +class Packs::Pack + # pkg:gem/packs-specification#lib/packs/pack.rb:17 + sig { params(name: ::String, path: ::Pathname, relative_path: ::Pathname).void } + def initialize(name:, path:, relative_path:); end + + # pkg:gem/packs-specification#lib/packs/pack.rb:69 + sig { returns(::String) } + def inspect; end + + # pkg:gem/packs-specification#lib/packs/pack.rb:55 + sig { returns(T::Boolean) } + def is_gem?; end + + # pkg:gem/packs-specification#lib/packs/pack.rb:50 + sig { returns(::String) } + def last_name; end + + # pkg:gem/packs-specification#lib/packs/pack.rb:60 + sig { returns(T::Hash[T.untyped, T.untyped]) } + def metadata; end + + # pkg:gem/packs-specification#lib/packs/pack.rb:8 + sig { returns(::String) } + def name; end + + # pkg:gem/packs-specification#lib/packs/pack.rb:11 + sig { returns(::Pathname) } + def path; end + + # pkg:gem/packs-specification#lib/packs/pack.rb:39 + sig { returns(T::Hash[T.untyped, T.untyped]) } + def raw_hash; end + + # pkg:gem/packs-specification#lib/packs/pack.rb:14 + sig { returns(::Pathname) } + def relative_path; end + + # pkg:gem/packs-specification#lib/packs/pack.rb:44 + sig { params(relative: T::Boolean).returns(::Pathname) } + def yml(relative: T.unsafe(nil)); end + + private + + # pkg:gem/packs-specification#lib/packs/pack.rb:65 + sig { returns(T::Array[::Symbol]) } + def instance_variables_to_inspect; end + + class << self + # pkg:gem/packs-specification#lib/packs/pack.rb:26 + sig { params(package_yml_absolute_path: ::Pathname).returns(::Packs::Pack) } + def from(package_yml_absolute_path); end + end +end + +# pkg:gem/packs-specification#lib/packs/specification/configuration.rb:4 +module Packs::Specification + class << self + # pkg:gem/packs-specification#lib/packs/specification.rb:31 + sig { returns(T::Array[::Packs::Pack]) } + def all; end + + # pkg:gem/packs-specification#lib/packs/specification.rb:24 + sig { void } + def bust_cache!; end + + # pkg:gem/packs-specification#lib/packs/specification.rb:18 + sig { returns(::Packs::Specification::Configuration) } + def config; end + + # pkg:gem/packs-specification#lib/packs/specification.rb:36 + sig { params(name: ::String).returns(T.nilable(::Packs::Pack)) } + def find(name); end + + # pkg:gem/packs-specification#lib/packs/specification.rb:41 + sig { params(file_path: T.any(::Pathname, ::String)).returns(T.nilable(::Packs::Pack)) } + def for_file(file_path); end + + # pkg:gem/packs-specification#lib/packs/specification.rb:13 + sig { returns(::Pathname) } + def root; end + + private + + # pkg:gem/packs-specification#lib/packs/specification.rb:65 + sig { returns(T::Array[::Pathname]) } + def package_glob_patterns; end + + # pkg:gem/packs-specification#lib/packs/specification.rb:51 + sig { returns(T::Hash[::String, ::Packs::Pack]) } + def packs_by_name; end + end +end + +# pkg:gem/packs-specification#lib/packs/specification/configuration.rb:5 +class Packs::Specification::Configuration < ::T::Struct + prop :pack_paths, T::Array[::String] + + class << self + # pkg:gem/packs-specification#lib/packs/specification/configuration.rb:17 + sig { returns(::Packs::Specification::Configuration) } + def fetch; end + + # pkg:gem/packs-specification#lib/packs/specification/configuration.rb:26 + sig { params(config_hash: T::Hash[T.untyped, T.untyped]).returns(T::Array[::String]) } + def pack_paths(config_hash); end + end +end + +# pkg:gem/packs-specification#lib/packs/specification/configuration.rb:7 +Packs::Specification::Configuration::CONFIGURATION_PATHNAME = T.let(T.unsafe(nil), Pathname) + +# pkg:gem/packs-specification#lib/packs/specification/configuration.rb:9 +Packs::Specification::Configuration::DEFAULT_PACK_PATHS = T.let(T.unsafe(nil), Array) diff --git a/sorbet/rbi/gems/packs@0.0.5.rbi b/sorbet/rbi/gems/packs@0.0.5.rbi deleted file mode 100644 index 71c2005..0000000 --- a/sorbet/rbi/gems/packs@0.0.5.rbi +++ /dev/null @@ -1,111 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `packs` gem. -# Please instead update this file by running `bin/tapioca gem packs`. - -# source://packs//lib/packs/pack.rb#3 -module Packs - class << self - # source://packs//lib/packs.rb#16 - sig { returns(T::Array[::Packs::Pack]) } - def all; end - - # source://packs//lib/packs.rb#34 - sig { void } - def bust_cache!; end - - # source://packs//lib/packs.rb#41 - sig { returns(::Packs::Private::Configuration) } - def config; end - - # @yield [config] - # - # source://packs//lib/packs.rb#47 - sig { params(blk: T.proc.params(arg0: ::Packs::Private::Configuration).void).void } - def configure(&blk); end - - # source://packs//lib/packs.rb#21 - sig { params(name: ::String).returns(T.nilable(::Packs::Pack)) } - def find(name); end - - # source://packs//lib/packs.rb#26 - sig { params(file_path: T.any(::Pathname, ::String)).returns(T.nilable(::Packs::Pack)) } - def for_file(file_path); end - - private - - # source://packs//lib/packs.rb#73 - sig { returns(T::Array[::Pathname]) } - def package_glob_patterns; end - - # source://packs//lib/packs.rb#59 - sig { returns(T::Hash[::String, ::Packs::Pack]) } - def packs_by_name; end - end -end - -# source://packs//lib/packs.rb#10 -Packs::PACKAGE_FILE = T.let(T.unsafe(nil), String) - -# source://packs//lib/packs/pack.rb#4 -class Packs::Pack < ::T::Struct - const :name, ::String - const :path, ::Pathname - const :raw_hash, T::Hash[T.untyped, T.untyped] - const :relative_path, ::Pathname - - # source://packs//lib/packs/pack.rb#34 - sig { returns(::String) } - def last_name; end - - # source://packs//lib/packs/pack.rb#39 - sig { returns(T::Hash[T.untyped, T.untyped]) } - def metadata; end - - # source://packs//lib/packs/pack.rb#28 - sig { params(relative: T::Boolean).returns(::Pathname) } - def yml(relative: T.unsafe(nil)); end - - class << self - # source://packs//lib/packs/pack.rb#13 - sig { params(package_yml_absolute_path: ::Pathname).returns(::Packs::Pack) } - def from(package_yml_absolute_path); end - - # source://sorbet-runtime/0.5.9924/lib/types/struct.rb#13 - def inherited(s); end - end -end - -# source://packs//lib/packs/private/configuration.rb#4 -module Packs::Private - class << self - # source://packs//lib/packs/private.rb#10 - sig { returns(::Pathname) } - def root; end - end -end - -# source://packs//lib/packs/private/configuration.rb#5 -class Packs::Private::Configuration < ::T::Struct - prop :pack_paths, T::Array[::String] - - class << self - # source://packs//lib/packs/private/configuration.rb#17 - sig { returns(::Packs::Private::Configuration) } - def fetch; end - - # source://sorbet-runtime/0.5.9924/lib/types/struct.rb#13 - def inherited(s); end - - # source://packs//lib/packs/private/configuration.rb#26 - sig { params(config_hash: T::Hash[T.untyped, T.untyped]).returns(T::Array[::String]) } - def pack_paths(config_hash); end - end -end - -# source://packs//lib/packs/private/configuration.rb#7 -Packs::Private::Configuration::CONFIGURATION_PATHNAME = T.let(T.unsafe(nil), Pathname) - -# source://packs//lib/packs/private/configuration.rb#9 -Packs::Private::Configuration::DEFAULT_PACK_PATHS = T.let(T.unsafe(nil), Array) diff --git a/sorbet/rbi/gems/packs@0.3.0.rbi b/sorbet/rbi/gems/packs@0.3.0.rbi new file mode 100644 index 0000000..098b1fd --- /dev/null +++ b/sorbet/rbi/gems/packs@0.3.0.rbi @@ -0,0 +1,886 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `packs` gem. +# Please instead update this file by running `bin/tapioca gem packs`. + + +# pkg:gem/packs#lib/packs/private/file_move_operation.rb:3 +module Packs + class << self + # pkg:gem/packs#lib/packs.rb:146 + sig { params(pack_name: ::String, dependency_name: ::String).void } + def add_dependency!(pack_name:, dependency_name:); end + + # pkg:gem/packs#lib/packs.rb:261 + sig { void } + def bust_cache!; end + + # pkg:gem/packs#lib/packs.rb:52 + sig { params(files: T::Array[::String]).returns(T::Boolean) } + def check(files); end + + # pkg:gem/packs#lib/packs/configuration.rb:69 + sig { returns(::Packs::Configuration) } + def config; end + + # pkg:gem/packs#lib/packs/configuration.rb:75 + sig { params(blk: T.proc.params(arg0: ::Packs::Configuration).void).void } + def configure(&blk); end + + # pkg:gem/packs#lib/packs.rb:69 + sig do + params( + pack_name: ::String, + enforce_privacy: T::Boolean, + enforce_layers: T::Boolean, + enforce_dependencies: T.nilable(T::Boolean), + team: T.nilable(::CodeTeams::Team) + ).void + end + def create_pack!(pack_name:, enforce_privacy: T.unsafe(nil), enforce_layers: T.unsafe(nil), enforce_dependencies: T.unsafe(nil), team: T.unsafe(nil)); end + + # pkg:gem/packs#lib/packs.rb:267 + sig { void } + def lint_package_todo_yml_files!; end + + # pkg:gem/packs#lib/packs.rb:272 + sig { params(packs: T::Array[::Packs::Pack]).void } + def lint_package_yml_files!(packs); end + + # pkg:gem/packs#lib/packs.rb:233 + sig { params(type: ::String, pack_name: T.nilable(::String), limit: ::Integer).void } + def list_top_violations(type:, pack_name:, limit:); end + + # pkg:gem/packs#lib/packs.rb:120 + sig do + params( + paths_relative_to_root: T::Array[::String], + per_file_processors: T::Array[::Packs::PerFileProcessorInterface] + ).void + end + def make_public!(paths_relative_to_root: T.unsafe(nil), per_file_processors: T.unsafe(nil)); end + + # pkg:gem/packs#lib/packs.rb:203 + sig do + params( + pack_name: ::String, + destination: ::String, + per_file_processors: T::Array[::Packs::PerFileProcessorInterface] + ).void + end + def move_to_folder!(pack_name:, destination:, per_file_processors: T.unsafe(nil)); end + + # pkg:gem/packs#lib/packs.rb:92 + sig do + params( + pack_name: ::String, + paths_relative_to_root: T::Array[::String], + per_file_processors: T::Array[::Packs::PerFileProcessorInterface] + ).void + end + def move_to_pack!(pack_name:, paths_relative_to_root: T.unsafe(nil), per_file_processors: T.unsafe(nil)); end + + # pkg:gem/packs#lib/packs.rb:173 + sig do + params( + pack_name: ::String, + parent_name: ::String, + per_file_processors: T::Array[::Packs::PerFileProcessorInterface] + ).void + end + def move_to_parent!(pack_name:, parent_name:, per_file_processors: T.unsafe(nil)); end + + # pkg:gem/packs#lib/packs.rb:252 + sig { params(file: ::String, find: ::Pathname, replace_with: ::Pathname).void } + def replace_in_file(file:, find:, replace_with:); end + + # pkg:gem/packs#lib/packs.rb:29 + sig { void } + def start_interactive_mode!; end + + # pkg:gem/packs#lib/packs.rb:34 + sig { returns(T::Boolean) } + def update; end + + # pkg:gem/packs#lib/packs.rb:43 + sig { returns(T::Boolean) } + def validate; end + end +end + +# pkg:gem/packs#lib/packs/cli.rb:6 +class Packs::CLI < ::Thor + # pkg:gem/packs#lib/packs/cli.rb:34 + sig { params(from_pack: ::String, to_pack: ::String).void } + def add_dependency(from_pack, to_pack); end + + # pkg:gem/packs#lib/packs/cli.rb:121 + sig { params(paths: ::String).void } + def check(*paths); end + + # pkg:gem/packs#lib/packs/cli.rb:14 + sig { params(pack_name: ::String).void } + def create(pack_name); end + + # pkg:gem/packs#lib/packs/cli.rb:136 + sig { params(pack_names: ::String).void } + def get_info(*pack_names); end + + # pkg:gem/packs#lib/packs/cli.rb:103 + sig { void } + def lint_package_todo_yml_files; end + + # pkg:gem/packs#lib/packs/cli.rb:109 + sig { params(pack_names: ::String).void } + def lint_package_yml_files(*pack_names); end + + # pkg:gem/packs#lib/packs/cli.rb:62 + sig { params(type: ::String, pack_name: T.nilable(::String)).void } + def list_top_violations(type, pack_name = T.unsafe(nil)); end + + # pkg:gem/packs#lib/packs/cli.rb:80 + sig { params(paths: ::String).void } + def make_public(*paths); end + + # pkg:gem/packs#lib/packs/cli.rb:93 + sig { params(pack_name: ::String, paths: ::String).void } + def move(pack_name, *paths); end + + # pkg:gem/packs#lib/packs/cli.rb:169 + sig { params(pack_name: ::String, destination: ::String).void } + def move_to_folder(pack_name, destination); end + + # pkg:gem/packs#lib/packs/cli.rb:159 + sig { params(child_pack_name: ::String, parent_pack_name: ::String).void } + def move_to_parent(child_pack_name, parent_pack_name); end + + # pkg:gem/packs#lib/packs/cli.rb:152 + sig { void } + def rename; end + + # pkg:gem/packs#lib/packs/cli.rb:127 + sig { void } + def update; end + + # pkg:gem/packs#lib/packs/cli.rb:115 + sig { void } + def validate; end + + private + + # pkg:gem/packs#lib/packs/cli.rb:185 + sig { void } + def exit_successfully; end + + # pkg:gem/packs#lib/packs/cli.rb:180 + sig { params(pack_names: T::Array[::String]).returns(T::Array[::Packs::Pack]) } + def parse_pack_names(pack_names); end +end + +# pkg:gem/packs#lib/packs/cli.rb:42 +Packs::CLI::POSSIBLE_TYPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/packs#lib/packs/code_ownership_post_processor.rb:4 +class Packs::CodeOwnershipPostProcessor + include ::Packs::PerFileProcessorInterface + + # pkg:gem/packs#lib/packs/code_ownership_post_processor.rb:9 + sig { void } + def initialize; end + + # pkg:gem/packs#lib/packs/code_ownership_post_processor.rb:44 + sig { override.params(file_move_operations: T::Array[::Packs::Private::FileMoveOperation]).void } + def after_move_files!(file_move_operations); end + + # pkg:gem/packs#lib/packs/code_ownership_post_processor.rb:15 + sig { override.params(file_move_operation: ::Packs::Private::FileMoveOperation).void } + def before_move_file!(file_move_operation); end +end + +# pkg:gem/packs#lib/packs/configuration.rb:7 +class Packs::Configuration + # pkg:gem/packs#lib/packs/configuration.rb:30 + sig { void } + def initialize; end + + # pkg:gem/packs#lib/packs/configuration.rb:43 + sig { void } + def bust_cache!; end + + # pkg:gem/packs#lib/packs/configuration.rb:48 + sig { returns(T::Boolean) } + def default_enforce_dependencies; end + + # pkg:gem/packs#lib/packs/configuration.rb:38 + sig { returns(T::Boolean) } + def enforce_dependencies; end + + # pkg:gem/packs#lib/packs/configuration.rb:14 + sig { params(enforce_dependencies: T::Boolean).void } + def enforce_dependencies=(enforce_dependencies); end + + # pkg:gem/packs#lib/packs/configuration.rb:27 + sig { returns(T.proc.params(output: ::String).void) } + def on_package_todo_lint_failure; end + + # pkg:gem/packs#lib/packs/configuration.rb:27 + def on_package_todo_lint_failure=(_arg0); end + + # pkg:gem/packs#lib/packs/configuration.rb:53 + sig { returns(::Pathname) } + def readme_template_pathname; end + + # pkg:gem/packs#lib/packs/configuration.rb:20 + sig { returns(T::Boolean) } + def use_pks; end + + # pkg:gem/packs#lib/packs/configuration.rb:20 + def use_pks=(_arg0); end + + # pkg:gem/packs#lib/packs/configuration.rb:17 + sig { returns(::Packs::UserEventLogger) } + def user_event_logger; end + + # pkg:gem/packs#lib/packs/configuration.rb:17 + def user_event_logger=(_arg0); end +end + +# pkg:gem/packs#lib/packs/configuration.rb:10 +Packs::Configuration::CONFIGURATION_PATHNAME = T.let(T.unsafe(nil), Pathname) + +# pkg:gem/packs#lib/packs/configuration.rb:11 +Packs::Configuration::DEFAULT_README_TEMPLATE_PATHNAME = T.let(T.unsafe(nil), Pathname) + +# pkg:gem/packs#lib/packs/configuration.rb:22 +Packs::Configuration::OnPackageTodoLintFailure = T.type_alias { T.proc.params(output: ::String).void } + +# pkg:gem/packs#lib/packs/default_user_event_logger.rb:4 +class Packs::DefaultUserEventLogger + include ::Packs::UserEventLogger +end + +# pkg:gem/packs#lib/packs/logging.rb:6 +module Packs::Logging + class << self + # pkg:gem/packs#lib/packs/logging.rb:33 + sig { params(str: ::String).void } + def out(str); end + + # pkg:gem/packs#lib/packs/logging.rb:23 + sig { params(text: ::String).void } + def print(text); end + + # pkg:gem/packs#lib/packs/logging.rb:18 + sig { params(text: ::String).void } + def print_bold_green(text); end + + # pkg:gem/packs#lib/packs/logging.rb:28 + sig { void } + def print_divider; end + + # pkg:gem/packs#lib/packs/logging.rb:10 + sig { params(title: ::String, block: T.proc.void).void } + def section(title, &block); end + end +end + +# pkg:gem/packs#lib/packs/per_file_processor_interface.rb:4 +module Packs::PerFileProcessorInterface + abstract! + + # pkg:gem/packs#lib/packs/per_file_processor_interface.rb:15 + sig { overridable.params(file_move_operations: T::Array[::Packs::Private::FileMoveOperation]).void } + def after_move_files!(file_move_operations); end + + # pkg:gem/packs#lib/packs/per_file_processor_interface.rb:11 + sig { abstract.params(file_move_operation: ::Packs::Private::FileMoveOperation).void } + def before_move_file!(file_move_operation); end +end + +# pkg:gem/packs#lib/packs/private/file_move_operation.rb:4 +module Packs::Private + class << self + # pkg:gem/packs#lib/packs/private.rb:384 + sig { params(pack_name: ::String, dependency_name: ::String).void } + def add_dependency!(pack_name:, dependency_name:); end + + # pkg:gem/packs#lib/packs/private.rb:446 + sig { params(package: ::ParsePackwerk::Package).void } + def add_public_directory(package); end + + # pkg:gem/packs#lib/packs/private.rb:457 + sig { params(package: ::ParsePackwerk::Package).void } + def add_readme(package); end + + # pkg:gem/packs#lib/packs/private.rb:532 + sig { void } + def bust_cache!; end + + # pkg:gem/packs#lib/packs/private.rb:20 + sig { params(pack_name: ::String).returns(::String) } + def clean_pack_name(pack_name); end + + # pkg:gem/packs#lib/packs/private.rb:58 + sig do + params( + pack_name: ::String, + enforce_dependencies: T.nilable(T::Boolean), + enforce_privacy: T::Boolean, + enforce_layers: T::Boolean, + team: T.nilable(::CodeTeams::Team) + ).void + end + def create_pack!(pack_name:, enforce_dependencies:, enforce_privacy:, enforce_layers:, team:); end + + # pkg:gem/packs#lib/packs/private.rb:479 + sig do + params( + pack_name: ::String, + enforce_dependencies: T.nilable(T::Boolean), + enforce_privacy: T::Boolean, + enforce_layers: T::Boolean, + team: T.nilable(::CodeTeams::Team) + ).returns(::ParsePackwerk::Package) + end + def create_pack_if_not_exists!(pack_name:, enforce_dependencies:, enforce_privacy:, enforce_layers:, team: T.unsafe(nil)); end + + # pkg:gem/packs#lib/packs/private.rb:557 + sig do + params( + before: T::Hash[::String, T.nilable(::String)], + after: T::Hash[::String, T.nilable(::String)] + ).returns(::String) + end + def diff_package_todo_yml(before, after); end + + # This function exists to give us something to stub in test + # + # pkg:gem/packs#lib/packs/private.rb:782 + sig { params(code: T::Boolean).void } + def exit_with(code); end + + # pkg:gem/packs#lib/packs/private.rb:609 + sig do + params( + packs: T::Array[::Packs::Pack], + format: ::Symbol, + types: T::Array[::Symbol], + include_date: T::Boolean + ).void + end + def get_info(packs: T.unsafe(nil), format: T.unsafe(nil), types: T.unsafe(nil), include_date: T.unsafe(nil)); end + + # pkg:gem/packs#lib/packs/private.rb:540 + sig { returns(T::Hash[::String, ::String]) } + def get_package_todo_contents; end + + # pkg:gem/packs#lib/packs/private.rb:427 + sig { params(origin: ::Pathname, destination: ::Pathname).void } + def idempotent_mv(origin, destination); end + + # pkg:gem/packs#lib/packs/private.rb:699 + sig { void } + def lint_package_todo_yml_files!; end + + # pkg:gem/packs#lib/packs/private.rb:734 + sig { params(packs: T::Array[::Packs::Pack]).void } + def lint_package_yml_files!(packs); end + + # pkg:gem/packs#lib/packs/private.rb:522 + sig { void } + def load_client_configuration; end + + # pkg:gem/packs#lib/packs/private.rb:337 + sig do + params( + paths_relative_to_root: T::Array[::String], + per_file_processors: T::Array[::Packs::PerFileProcessorInterface] + ).void + end + def make_public!(paths_relative_to_root:, per_file_processors:); end + + # pkg:gem/packs#lib/packs/private.rb:159 + sig do + params( + pack_name: ::String, + destination: ::String, + per_file_processors: T::Array[::Packs::PerFileProcessorInterface] + ).void + end + def move_to_folder!(pack_name:, destination:, per_file_processors: T.unsafe(nil)); end + + # pkg:gem/packs#lib/packs/private.rb:90 + sig do + params( + pack_name: ::String, + paths_relative_to_root: T::Array[::String], + per_file_processors: T::Array[::Packs::PerFileProcessorInterface] + ).void + end + def move_to_pack!(pack_name:, paths_relative_to_root:, per_file_processors: T.unsafe(nil)); end + + # pkg:gem/packs#lib/packs/private.rb:238 + sig do + params( + pack_name: ::String, + parent_name: ::String, + per_file_processors: T::Array[::Packs::PerFileProcessorInterface] + ).void + end + def move_to_parent!(pack_name:, parent_name:, per_file_processors: T.unsafe(nil)); end + + # pkg:gem/packs#lib/packs/private.rb:414 + sig do + params( + file_move_operation: ::Packs::Private::FileMoveOperation, + per_file_processors: T::Array[::Packs::PerFileProcessorInterface] + ).void + end + def package_filepath(file_move_operation, per_file_processors); end + + # pkg:gem/packs#lib/packs/private.rb:597 + sig { params(package: ::ParsePackwerk::Package).returns(T.nilable(::Packs::Pack)) } + def packwerk_package_to_pack(package); end + + # pkg:gem/packs#lib/packs/private.rb:586 + sig { params(packages: T::Array[::ParsePackwerk::Package]).returns(T::Array[::Packs::Pack]) } + def packwerk_packages_to_packs(packages); end + + # pkg:gem/packs#lib/packs/private.rb:767 + sig { returns(::String) } + def rename_pack; end + + # pkg:gem/packs#lib/packs/private.rb:35 + sig { params(file: ::String, find: ::Pathname, replace_with: ::Pathname).void } + def replace_in_file(file:, find:, replace_with:); end + + # pkg:gem/packs#lib/packs/private.rb:761 + sig { params(config: T::Hash[T.anything, T.anything]).returns(T::Hash[T.anything, T.anything]) } + def sort_keys(config); end + + # This function exists to give us something to stub in test + # + # pkg:gem/packs#lib/packs/private.rb:788 + sig { params(command: ::String).returns(T::Boolean) } + def system_with(command); end + + # pkg:gem/packs#lib/packs/private.rb:574 + sig { params(package_todo_files: T::Hash[::String, T.nilable(::String)], tmp_folder: ::String).void } + def write_package_todo_to_tmp_folder(package_todo_files, tmp_folder); end + end +end + +# pkg:gem/packs#lib/packs/private/file_move_operation.rb:5 +class Packs::Private::FileMoveOperation < ::T::Struct + const :origin_pathname, ::Pathname + const :destination_pathname, ::Pathname + const :destination_pack, ::ParsePackwerk::Package + + # pkg:gem/packs#lib/packs/private/file_move_operation.rb:13 + sig { returns(T.nilable(::Packs::Pack)) } + def origin_pack; end + + # pkg:gem/packs#lib/packs/private/file_move_operation.rb:55 + sig { returns(T::Array[::Packs::Private::FileMoveOperation]) } + def spec_file_move_operations; end + + private + + # pkg:gem/packs#lib/packs/private/file_move_operation.rb:98 + sig { returns(::String) } + def filepath_without_pack_name; end + + # Maps app/controllers/*_controller.rb to spec/requests/*_spec.rb. + # Returns nil if the path is not a controller path. + # + # pkg:gem/packs#lib/packs/private/file_move_operation.rb:121 + sig { params(pathname: ::Pathname).returns(T.nilable(::Pathname)) } + def pathname_to_request_spec(pathname); end + + # pkg:gem/packs#lib/packs/private/file_move_operation.rb:148 + sig { params(path: ::Pathname).returns(::Packs::Private::FileMoveOperation) } + def relative_to(path); end + + # pkg:gem/packs#lib/packs/private/file_move_operation.rb:133 + sig { returns(T.nilable(::Packs::Private::FileMoveOperation)) } + def request_spec_file_move_operation; end + + # pkg:gem/packs#lib/packs/private/file_move_operation.rb:103 + sig { params(pathname: ::Pathname, file_extension: ::String).returns(::Pathname) } + def spec_pathname_for_app(pathname, file_extension); end + + # pkg:gem/packs#lib/packs/private/file_move_operation.rb:111 + sig { params(pathname: ::Pathname, file_extension: ::String, folder: ::String).returns(::Pathname) } + def spec_pathname_for_non_app(pathname, file_extension, folder); end + + class << self + # pkg:gem/packs#lib/packs/private/file_move_operation.rb:33 + sig { params(origin_pathname: ::Pathname).returns(::Pathname) } + def destination_pathname_for_new_public_api(origin_pathname); end + + # pkg:gem/packs#lib/packs/private/file_move_operation.rb:23 + sig { params(origin_pathname: ::Pathname, new_package_root: ::Pathname).returns(::Pathname) } + def destination_pathname_for_package_move(origin_pathname, new_package_root); end + + # pkg:gem/packs#lib/packs/private/file_move_operation.rb:87 + sig { params(filepath: ::Pathname, pack: T.nilable(::Packs::Pack)).returns(::String) } + def get_filepath_without_pack_name(filepath, pack); end + + # pkg:gem/packs#lib/packs/private/file_move_operation.rb:18 + sig { params(origin_pathname: ::Pathname).returns(T.nilable(::Packs::Pack)) } + def get_origin_pack(origin_pathname); end + end +end + +# pkg:gem/packs#lib/packs/private/interactive_cli/team_selector.rb:5 +module Packs::Private::InteractiveCli + class << self + # pkg:gem/packs#lib/packs/private/interactive_cli.rb:30 + sig { params(prompt: T.nilable(::TTY::Prompt)).void } + def start!(prompt: T.unsafe(nil)); end + end +end + +# pkg:gem/packs#lib/packs/private/interactive_cli/file_selector.rb:6 +class Packs::Private::InteractiveCli::FileSelector + class << self + # pkg:gem/packs#lib/packs/private/interactive_cli/file_selector.rb:10 + sig { params(prompt: ::TTY::Prompt).returns(T::Array[::String]) } + def select(prompt); end + end +end + +# pkg:gem/packs#lib/packs/private/interactive_cli/pack_directory_selector.rb:6 +class Packs::Private::InteractiveCli::PackDirectorySelector + class << self + # pkg:gem/packs#lib/packs/private/interactive_cli/pack_directory_selector.rb:10 + sig { params(prompt: ::TTY::Prompt, question_text: ::String).returns(::String) } + def select(prompt, question_text: T.unsafe(nil)); end + end +end + +# pkg:gem/packs#lib/packs/private/interactive_cli/pack_selector.rb:6 +class Packs::Private::InteractiveCli::PackSelector + class << self + # pkg:gem/packs#lib/packs/private/interactive_cli/pack_selector.rb:35 + sig { params(prompt: ::TTY::Prompt, question_text: ::String).returns(T::Array[::Packs::Pack]) } + def single_or_all_pack_multi_select(prompt, question_text: T.unsafe(nil)); end + + # pkg:gem/packs#lib/packs/private/interactive_cli/pack_selector.rb:10 + sig { params(prompt: ::TTY::Prompt, question_text: ::String).returns(::Packs::Pack) } + def single_pack_select(prompt, question_text: T.unsafe(nil)); end + end +end + +# pkg:gem/packs#lib/packs/private/interactive_cli/team_selector.rb:6 +class Packs::Private::InteractiveCli::TeamSelector + class << self + # pkg:gem/packs#lib/packs/private/interactive_cli/team_selector.rb:36 + sig { params(prompt: ::TTY::Prompt, question_text: ::String).returns(T::Array[::CodeTeams::Team]) } + def multi_select(prompt, question_text: T.unsafe(nil)); end + + # pkg:gem/packs#lib/packs/private/interactive_cli/team_selector.rb:10 + sig { params(prompt: ::TTY::Prompt, question_text: ::String).returns(T.nilable(::CodeTeams::Team)) } + def single_select(prompt, question_text: T.unsafe(nil)); end + end +end + +# pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/interface.rb:6 +module Packs::Private::InteractiveCli::UseCases; end + +# pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/add_dependency.rb:7 +class Packs::Private::InteractiveCli::UseCases::AddDependency + include ::Packs::Private::InteractiveCli::UseCases::Interface + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/add_dependency.rb:13 + sig { override.params(prompt: ::TTY::Prompt).void } + def perform!(prompt); end + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/add_dependency.rb:23 + sig { override.returns(::String) } + def user_facing_name; end +end + +# pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/check.rb:7 +class Packs::Private::InteractiveCli::UseCases::Check + include ::Packs::Private::InteractiveCli::UseCases::Interface + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/check.rb:18 + sig { override.params(prompt: ::TTY::Prompt).void } + def perform!(prompt); end + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/check.rb:13 + sig { override.returns(::String) } + def user_facing_name; end +end + +# pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/create.rb:7 +class Packs::Private::InteractiveCli::UseCases::Create + include ::Packs::Private::InteractiveCli::UseCases::Interface + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/create.rb:13 + sig { override.params(prompt: ::TTY::Prompt).void } + def perform!(prompt); end + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/create.rb:20 + sig { override.returns(::String) } + def user_facing_name; end +end + +# pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/get_info.rb:7 +class Packs::Private::InteractiveCli::UseCases::GetInfo + include ::Packs::Private::InteractiveCli::UseCases::Interface + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/get_info.rb:18 + sig { override.params(prompt: ::TTY::Prompt).void } + def perform!(prompt); end + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/get_info.rb:13 + sig { override.returns(::String) } + def user_facing_name; end +end + +# pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/interface.rb:7 +module Packs::Private::InteractiveCli::UseCases::Interface + interface! + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/interface.rb:26 + sig { abstract.params(prompt: ::TTY::Prompt).void } + def perform!(prompt); end + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/interface.rb:30 + sig { abstract.returns(::String) } + def user_facing_name; end + + class << self + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/interface.rb:21 + sig { returns(T::Array[::Packs::Private::InteractiveCli::UseCases::Interface]) } + def all; end + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/interface.rb:14 + sig { params(base: T::Class[T.anything]).void } + def included(base); end + end +end + +# pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/lint_package_yml_files.rb:7 +class Packs::Private::InteractiveCli::UseCases::LintPackageYmlFiles + include ::Packs::Private::InteractiveCli::UseCases::Interface + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/lint_package_yml_files.rb:13 + sig { override.params(prompt: ::TTY::Prompt).void } + def perform!(prompt); end + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/lint_package_yml_files.rb:19 + sig { override.returns(::String) } + def user_facing_name; end +end + +# pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/make_public.rb:7 +class Packs::Private::InteractiveCli::UseCases::MakePublic + include ::Packs::Private::InteractiveCli::UseCases::Interface + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/make_public.rb:18 + sig { override.params(prompt: ::TTY::Prompt).void } + def perform!(prompt); end + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/make_public.rb:13 + sig { override.returns(::String) } + def user_facing_name; end +end + +# pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/move.rb:7 +class Packs::Private::InteractiveCli::UseCases::Move + include ::Packs::Private::InteractiveCli::UseCases::Interface + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/move.rb:13 + sig { override.params(prompt: ::TTY::Prompt).void } + def perform!(prompt); end + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/move.rb:25 + sig { override.returns(::String) } + def user_facing_name; end +end + +# pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/move_pack.rb:7 +class Packs::Private::InteractiveCli::UseCases::MovePack + include ::Packs::Private::InteractiveCli::UseCases::Interface + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/move_pack.rb:13 + sig { override.params(prompt: ::TTY::Prompt).void } + def perform!(prompt); end + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/move_pack.rb:63 + sig { override.returns(::String) } + def user_facing_name; end +end + +# We have not yet pulled QueryPackwerk into open source, so we cannot include it in this CLI yet +# +# pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/query.rb:10 +class Packs::Private::InteractiveCli::UseCases::Query + include ::Packs::Private::InteractiveCli::UseCases::Interface + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/query.rb:21 + sig { override.params(prompt: ::TTY::Prompt).void } + def perform!(prompt); end + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/query.rb:16 + sig { override.returns(::String) } + def user_facing_name; end +end + +# pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/rename.rb:7 +class Packs::Private::InteractiveCli::UseCases::Rename + include ::Packs::Private::InteractiveCli::UseCases::Interface + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/rename.rb:18 + sig { override.params(prompt: ::TTY::Prompt).void } + def perform!(prompt); end + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/rename.rb:13 + sig { override.returns(::String) } + def user_facing_name; end +end + +# pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/update.rb:7 +class Packs::Private::InteractiveCli::UseCases::Update + include ::Packs::Private::InteractiveCli::UseCases::Interface + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/update.rb:18 + sig { override.params(prompt: ::TTY::Prompt).void } + def perform!(prompt); end + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/update.rb:13 + sig { override.returns(::String) } + def user_facing_name; end +end + +# pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/validate.rb:7 +class Packs::Private::InteractiveCli::UseCases::Validate + include ::Packs::Private::InteractiveCli::UseCases::Interface + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/validate.rb:18 + sig { override.params(prompt: ::TTY::Prompt).void } + def perform!(prompt); end + + # pkg:gem/packs#lib/packs/private/interactive_cli/use_cases/validate.rb:13 + sig { override.returns(::String) } + def user_facing_name; end +end + +# pkg:gem/packs#lib/packs/private/pack_relationship_analyzer.rb:5 +module Packs::Private::PackRelationshipAnalyzer + class << self + # pkg:gem/packs#lib/packs/private/pack_relationship_analyzer.rb:15 + sig { params(type: ::String, pack_name: T.nilable(::String), limit: ::Integer).void } + def list_top_violations(type, pack_name, limit); end + end +end + +# pkg:gem/packs#lib/packs/private.rb:552 +Packs::Private::PackageTodoFiles = T.type_alias { T::Hash[::String, T.nilable(::String)] } + +# pkg:gem/packs#lib/packs/rubocop_post_processor.rb:4 +class Packs::RubocopPostProcessor + include ::Packs::PerFileProcessorInterface + + # pkg:gem/packs#lib/packs/rubocop_post_processor.rb:9 + sig { override.params(file_move_operation: ::Packs::Private::FileMoveOperation).void } + def before_move_file!(file_move_operation); end + + # pkg:gem/packs#lib/packs/rubocop_post_processor.rb:26 + sig { returns(T::Boolean) } + def rubocop_enabled?; end +end + +# pkg:gem/packs#lib/packs/update_references_post_processor.rb:4 +class Packs::UpdateReferencesPostProcessor + include ::Packs::PerFileProcessorInterface + + # pkg:gem/packs#lib/packs/update_references_post_processor.rb:15 + sig { override.params(file_move_operations: T::Array[::Packs::Private::FileMoveOperation]).void } + def after_move_files!(file_move_operations); end + + # pkg:gem/packs#lib/packs/update_references_post_processor.rb:10 + sig { override.params(file_move_operation: ::Packs::Private::FileMoveOperation).void } + def before_move_file!(file_move_operation); end + + private + + # pkg:gem/packs#lib/packs/update_references_post_processor.rb:44 + sig { params(file_name: ::String, origin_pack: ::String, destination_pack: ::String).void } + def substitute_references!(file_name, origin_pack, destination_pack); end + + class << self + # pkg:gem/packs#lib/packs/update_references_post_processor.rb:37 + sig { returns(T::Boolean) } + def ripgrep_enabled?; end + end +end + +# pkg:gem/packs#lib/packs/user_event_logger.rb:4 +module Packs::UserEventLogger + abstract! + + # pkg:gem/packs#lib/packs/user_event_logger.rb:82 + sig { params(pack_name: ::String).returns(::String) } + def after_add_dependency(pack_name); end + + # pkg:gem/packs#lib/packs/user_event_logger.rb:18 + sig { params(pack_name: ::String).returns(::String) } + def after_create_pack(pack_name); end + + # pkg:gem/packs#lib/packs/user_event_logger.rb:62 + sig { returns(::String) } + def after_make_public; end + + # pkg:gem/packs#lib/packs/user_event_logger.rb:116 + sig { params(pack_name: ::String).returns(::String) } + def after_move_to_folder(pack_name); end + + # pkg:gem/packs#lib/packs/user_event_logger.rb:40 + sig { params(pack_name: ::String).returns(::String) } + def after_move_to_pack(pack_name); end + + # pkg:gem/packs#lib/packs/user_event_logger.rb:98 + sig { params(pack_name: ::String).returns(::String) } + def after_move_to_parent(pack_name); end + + # pkg:gem/packs#lib/packs/user_event_logger.rb:75 + sig { params(pack_name: ::String).returns(::String) } + def before_add_dependency(pack_name); end + + # pkg:gem/packs#lib/packs/user_event_logger.rb:11 + sig { params(pack_name: ::String).returns(::String) } + def before_create_pack(pack_name); end + + # pkg:gem/packs#lib/packs/user_event_logger.rb:153 + sig { params(type: ::String, pack_name: T.nilable(::String), limit: ::Integer).returns(::String) } + def before_list_top_violations(type, pack_name, limit); end + + # pkg:gem/packs#lib/packs/user_event_logger.rb:55 + sig { returns(::String) } + def before_make_public; end + + # pkg:gem/packs#lib/packs/user_event_logger.rb:109 + sig { params(pack_name: ::String).returns(::String) } + def before_move_to_folder(pack_name); end + + # pkg:gem/packs#lib/packs/user_event_logger.rb:33 + sig { params(pack_name: ::String).returns(::String) } + def before_move_to_pack(pack_name); end + + # pkg:gem/packs#lib/packs/user_event_logger.rb:91 + sig { params(pack_name: ::String).returns(::String) } + def before_move_to_parent(pack_name); end + + # pkg:gem/packs#lib/packs/user_event_logger.rb:174 + sig { returns(::String) } + def documentation_link; end + + # pkg:gem/packs#lib/packs/user_event_logger.rb:127 + sig { params(pack_name: ::String).returns(::String) } + def on_create_readme(pack_name); end +end diff --git a/sorbet/rbi/gems/packwerk@3.3.0.rbi b/sorbet/rbi/gems/packwerk@3.3.0.rbi new file mode 100644 index 0000000..3850680 --- /dev/null +++ b/sorbet/rbi/gems/packwerk@3.3.0.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `packwerk` gem. +# Please instead update this file by running `bin/tapioca gem packwerk`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/parallel@1.28.0.rbi b/sorbet/rbi/gems/parallel@1.28.0.rbi new file mode 100644 index 0000000..a8a6571 --- /dev/null +++ b/sorbet/rbi/gems/parallel@1.28.0.rbi @@ -0,0 +1,270 @@ +# 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:254 + def all?(*args, &block); end + + # pkg:gem/parallel#lib/parallel.rb:249 + def any?(*args, &block); end + + # pkg:gem/parallel#lib/parallel.rb:245 + def each(array, options = T.unsafe(nil), &block); end + + # pkg:gem/parallel#lib/parallel.rb:259 + def each_with_index(array, options = T.unsafe(nil), &block); end + + # pkg:gem/parallel#lib/parallel.rb:318 + def filter_map(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/parallel#lib/parallel.rb:314 + def flat_map(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/parallel#lib/parallel.rb:239 + def in_processes(options = T.unsafe(nil), &block); end + + # pkg:gem/parallel#lib/parallel.rb:223 + def in_threads(options = T.unsafe(nil)); end + + # pkg:gem/parallel#lib/parallel.rb:263 + def map(source, options = T.unsafe(nil), &block); end + + # pkg:gem/parallel#lib/parallel.rb:310 + 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:323 + 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:353 + def processor_count; end + + # pkg:gem/parallel#lib/parallel.rb:357 + 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:362 + def worker_number=(worker_num); end + + private + + # pkg:gem/parallel#lib/parallel.rb:395 + def add_progress_bar!(job_factory, options); end + + # pkg:gem/parallel#lib/parallel.rb:710 + def available_processor_count; end + + # pkg:gem/parallel#lib/parallel.rb:658 + def call_with_index(item, index, options, &block); end + + # pkg:gem/parallel#lib/parallel.rb:590 + def create_workers(job_factory, options, &block); end + + # options is either a Integer or a Hash with :count + # + # pkg:gem/parallel#lib/parallel.rb:648 + def extract_count_from_options(options); end + + # pkg:gem/parallel#lib/parallel.rb:676 + 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:685 + def instrument_finish_in_order(item, index, result, options); end + + # pkg:gem/parallel#lib/parallel.rb:705 + def instrument_start(item, index, options); end + + # pkg:gem/parallel#lib/parallel.rb:368 + def physical_processor_count_windows; end + + # pkg:gem/parallel#lib/parallel.rb:624 + def process_incoming_jobs(read, write, job_factory, options, &block); end + + # pkg:gem/parallel#lib/parallel.rb:578 + def replace_worker(job_factory, workers, index, options, blk); end + + # pkg:gem/parallel#lib/parallel.rb:389 + def run(command); end + + # pkg:gem/parallel#lib/parallel.rb:669 + def with_instrumentation(item, index, options); end + + # pkg:gem/parallel#lib/parallel.rb:420 + def work_direct(job_factory, options, &block); end + + # pkg:gem/parallel#lib/parallel.rb:530 + def work_in_processes(job_factory, options, &blk); end + + # pkg:gem/parallel#lib/parallel.rb:464 + def work_in_ractors(job_factory, options); end + + # pkg:gem/parallel#lib/parallel.rb:439 + def work_in_threads(job_factory, options, &block); end + + # pkg:gem/parallel#lib/parallel.rb:598 + def worker(job_factory, options, &block); end + end +end + +# pkg:gem/parallel#lib/parallel.rb:11 +class Parallel::Break < ::StandardError + # pkg:gem/parallel#lib/parallel.rb:14 + 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:21 + def _dump(_depth); end + + # pkg:gem/parallel#lib/parallel.rb:12 + def value; end + + class << self + # marshal_load that is used for ruby exceptions + # + # pkg:gem/parallel#lib/parallel.rb:26 + def _load(data); end + end +end + +# pkg:gem/parallel#lib/parallel.rb:8 +class Parallel::DeadWorker < ::StandardError; end + +# pkg:gem/parallel#lib/parallel.rb:43 +class Parallel::ExceptionWrapper + # pkg:gem/parallel#lib/parallel.rb:46 + def initialize(exception); end + + # pkg:gem/parallel#lib/parallel.rb:44 + def exception; end +end + +# pkg:gem/parallel#lib/parallel.rb:109 +class Parallel::JobFactory + # pkg:gem/parallel#lib/parallel.rb:110 + def initialize(source, mutex); end + + # pkg:gem/parallel#lib/parallel.rb:118 + 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:147 + def pack(item, index); end + + # pkg:gem/parallel#lib/parallel.rb:137 + def size; end + + # unpack item that is sent to workers + # + # pkg:gem/parallel#lib/parallel.rb:152 + def unpack(data); end + + private + + # pkg:gem/parallel#lib/parallel.rb:158 + def producer?; end + + # pkg:gem/parallel#lib/parallel.rb:162 + def queue_wrapper(array); end +end + +# pkg:gem/parallel#lib/parallel.rb:31 +class Parallel::Kill < ::Parallel::Break; end + +# pkg:gem/parallel#lib/parallel.rb:6 +Parallel::Stop = T.let(T.unsafe(nil), Object) + +# pkg:gem/parallel#lib/parallel.rb:34 +class Parallel::UndumpableException < ::StandardError + # pkg:gem/parallel#lib/parallel.rb:37 + def initialize(original); end + + # pkg:gem/parallel#lib/parallel.rb:35 + def backtrace; end +end + +# pkg:gem/parallel#lib/parallel.rb:167 +class Parallel::UserInterruptHandler + class << self + # pkg:gem/parallel#lib/parallel.rb:192 + def kill(thing); end + + # kill all these pids or threads if user presses Ctrl+c + # + # pkg:gem/parallel#lib/parallel.rb:172 + def kill_on_ctrl_c(pids, options); end + + private + + # pkg:gem/parallel#lib/parallel.rb:216 + def restore_interrupt(old, signal); end + + # pkg:gem/parallel#lib/parallel.rb:201 + def trap_interrupt(signal); end + end +end + +# pkg:gem/parallel#lib/parallel.rb:168 +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:62 +class Parallel::Worker + # pkg:gem/parallel#lib/parallel.rb:66 + def initialize(read, write, pid); 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:79 + def close_pipes; end + + # pkg:gem/parallel#lib/parallel.rb:63 + def pid; end + + # pkg:gem/parallel#lib/parallel.rb:63 + def read; end + + # pkg:gem/parallel#lib/parallel.rb:72 + def stop; end + + # pkg:gem/parallel#lib/parallel.rb:64 + def thread; end + + # pkg:gem/parallel#lib/parallel.rb:64 + def thread=(_arg0); end + + # pkg:gem/parallel#lib/parallel.rb:84 + def work(data); end + + # pkg:gem/parallel#lib/parallel.rb:63 + def write; end + + private + + # pkg:gem/parallel#lib/parallel.rb:102 + def wait; end +end diff --git a/sorbet/rbi/gems/parse_packwerk@0.19.1.rbi b/sorbet/rbi/gems/parse_packwerk@0.27.0.rbi similarity index 52% rename from sorbet/rbi/gems/parse_packwerk@0.19.1.rbi rename to sorbet/rbi/gems/parse_packwerk@0.27.0.rbi index 6264b83..b46526f 100644 --- a/sorbet/rbi/gems/parse_packwerk@0.19.1.rbi +++ b/sorbet/rbi/gems/parse_packwerk@0.27.0.rbi @@ -4,30 +4,51 @@ # This is an autogenerated file for types exported from the `parse_packwerk` gem. # Please instead update this file by running `bin/tapioca gem parse_packwerk`. -# source://parse_packwerk//lib/parse_packwerk/constants.rb#3 + +# pkg:gem/parse_packwerk#lib/parse_packwerk/constants.rb:3 module ParsePackwerk class << self - # source://parse_packwerk//lib/parse_packwerk.rb#32 + # pkg:gem/parse_packwerk#lib/parse_packwerk.rb:50 sig { returns(T::Array[::ParsePackwerk::Package]) } def all; end - # source://parse_packwerk//lib/parse_packwerk.rb#117 + # pkg:gem/parse_packwerk#lib/parse_packwerk.rb:163 sig { void } def bust_cache!; end - # source://parse_packwerk//lib/parse_packwerk.rb#37 + # pkg:gem/parse_packwerk#lib/parse_packwerk.rb:55 sig { params(name: ::String).returns(T.nilable(::ParsePackwerk::Package)) } def find(name); end - # source://parse_packwerk//lib/parse_packwerk.rb#47 + # pkg:gem/parse_packwerk#lib/parse_packwerk.rb:132 + sig { returns(T::Array[::String]) } + def key_sort_order; end + + # pkg:gem/parse_packwerk#lib/parse_packwerk.rb:65 sig { params(file_path: T.any(::Pathname, ::String)).returns(::ParsePackwerk::Package) } def package_from_path(file_path); end - # source://parse_packwerk//lib/parse_packwerk.rb#58 + # pkg:gem/parse_packwerk#lib/parse_packwerk.rb:44 + sig { returns(T::Boolean) } + def preserve_key_order; end + + # pkg:gem/parse_packwerk#lib/parse_packwerk.rb:44 + def preserve_key_order=(_arg0); end + + # pkg:gem/parse_packwerk#lib/parse_packwerk.rb:115 + sig do + params( + config: T::Hash[T.untyped, T.untyped], + original_key_order: T::Array[::String] + ).returns(T::Hash[T.untyped, T.untyped]) + end + def sort_keys(config, original_key_order); end + + # pkg:gem/parse_packwerk#lib/parse_packwerk.rb:76 sig { params(package: ::ParsePackwerk::Package).void } def write_package_yml!(package); end - # source://parse_packwerk//lib/parse_packwerk.rb#42 + # pkg:gem/parse_packwerk#lib/parse_packwerk.rb:60 sig { returns(::ParsePackwerk::Configuration) } def yml; end @@ -36,152 +57,161 @@ module ParsePackwerk # We memoize packages_by_name for fast lookup. # Since Graph is an immutable value object, we can create indexes and general caching mechanisms safely. # - # source://parse_packwerk//lib/parse_packwerk.rb#105 + # pkg:gem/parse_packwerk#lib/parse_packwerk.rb:151 sig { returns(T::Hash[::String, ::ParsePackwerk::Package]) } def packages_by_name; end end end -# source://parse_packwerk//lib/parse_packwerk/configuration.rb#4 +# pkg:gem/parse_packwerk#lib/parse_packwerk/configuration.rb:4 class ParsePackwerk::Configuration < ::T::Struct const :exclude, T::Array[::String] const :package_paths, T::Array[::String] const :requires, T::Array[::String] + const :raw, T::Hash[::String, T.untyped] class << self - # source://parse_packwerk//lib/parse_packwerk/configuration.rb#30 + # pkg:gem/parse_packwerk#lib/parse_packwerk/configuration.rb:32 sig { params(config_hash: T::Hash[T.untyped, T.untyped]).returns(T::Array[::String]) } def excludes(config_hash); end - # source://parse_packwerk//lib/parse_packwerk/configuration.rb#12 + # pkg:gem/parse_packwerk#lib/parse_packwerk/configuration.rb:13 sig { returns(::ParsePackwerk::Configuration) } def fetch; end - # source://sorbet-runtime/0.5.10796/lib/types/struct.rb#13 - def inherited(s); end - - # source://parse_packwerk//lib/parse_packwerk/configuration.rb#42 + # pkg:gem/parse_packwerk#lib/parse_packwerk/configuration.rb:50 sig { params(config_hash: T::Hash[T.untyped, T.untyped]).returns(T::Array[::String]) } def package_paths(config_hash); end end end -# source://parse_packwerk//lib/parse_packwerk/constants.rb#22 +# pkg:gem/parse_packwerk#lib/parse_packwerk/constants.rb:23 ParsePackwerk::DEFAULT_EXCLUDE_GLOBS = T.let(T.unsafe(nil), Array) -# source://parse_packwerk//lib/parse_packwerk/constants.rb#23 +# pkg:gem/parse_packwerk#lib/parse_packwerk/constants.rb:24 ParsePackwerk::DEFAULT_PACKAGE_PATHS = T.let(T.unsafe(nil), Array) -# source://parse_packwerk//lib/parse_packwerk/constants.rb#24 +# pkg:gem/parse_packwerk#lib/parse_packwerk/constants.rb:25 ParsePackwerk::DEFAULT_PUBLIC_PATH = T.let(T.unsafe(nil), String) -# source://parse_packwerk//lib/parse_packwerk/constants.rb#14 +# pkg:gem/parse_packwerk#lib/parse_packwerk/constants.rb:15 ParsePackwerk::DEPENDENCIES = T.let(T.unsafe(nil), String) -# source://parse_packwerk//lib/parse_packwerk/constants.rb#10 +# pkg:gem/parse_packwerk#lib/parse_packwerk/constants.rb:11 ParsePackwerk::DEPENDENCY_VIOLATION_TYPE = T.let(T.unsafe(nil), String) -# source://parse_packwerk//lib/parse_packwerk/constants.rb#8 +# pkg:gem/parse_packwerk#lib/parse_packwerk/constants.rb:8 ParsePackwerk::ENFORCE_DEPENDENCIES = T.let(T.unsafe(nil), String) -# source://parse_packwerk//lib/parse_packwerk/constants.rb#9 +# pkg:gem/parse_packwerk#lib/parse_packwerk/constants.rb:10 +ParsePackwerk::ENFORCE_LAYERS = T.let(T.unsafe(nil), String) + +# pkg:gem/parse_packwerk#lib/parse_packwerk/constants.rb:9 ParsePackwerk::ENFORCE_PRIVACY = T.let(T.unsafe(nil), String) -# source://parse_packwerk//lib/parse_packwerk/extensions.rb#4 +# pkg:gem/parse_packwerk#lib/parse_packwerk/extensions.rb:4 module ParsePackwerk::Extensions class << self - # source://parse_packwerk//lib/parse_packwerk/extensions.rb#8 + # pkg:gem/parse_packwerk#lib/parse_packwerk/extensions.rb:8 sig { returns(T::Boolean) } def all_extensions_installed?; end - # source://parse_packwerk//lib/parse_packwerk/extensions.rb#13 + # pkg:gem/parse_packwerk#lib/parse_packwerk/extensions.rb:18 + sig { returns(T::Boolean) } + def layer_extension_installed?; end + + # pkg:gem/parse_packwerk#lib/parse_packwerk/extensions.rb:13 sig { returns(T::Boolean) } def privacy_extension_installed?; end end end -# source://parse_packwerk//lib/parse_packwerk/constants.rb#13 +# pkg:gem/parse_packwerk#lib/parse_packwerk/constants.rb:14 ParsePackwerk::METADATA = T.let(T.unsafe(nil), String) # Since this metadata is unstructured YAML, it could be any type. We leave it to clients of `ParsePackwerk::Package` # to add types based on their known usage of metadata. # -# source://parse_packwerk//lib/parse_packwerk/constants.rb#18 +# pkg:gem/parse_packwerk#lib/parse_packwerk/constants.rb:19 ParsePackwerk::MetadataYmlType = T.type_alias { T::Hash[T.untyped, T.untyped] } -# source://parse_packwerk//lib/parse_packwerk.rb#18 +# pkg:gem/parse_packwerk#lib/parse_packwerk.rb:23 class ParsePackwerk::MissingConfiguration < ::StandardError - # source://parse_packwerk//lib/parse_packwerk.rb#22 + # pkg:gem/parse_packwerk#lib/parse_packwerk.rb:27 sig { params(packwerk_file_name: ::Pathname).void } def initialize(packwerk_file_name); end end -# source://parse_packwerk//lib/parse_packwerk/constants.rb#7 +# pkg:gem/parse_packwerk#lib/parse_packwerk/constants.rb:7 ParsePackwerk::PACKAGE_TODO_YML_NAME = T.let(T.unsafe(nil), String) -# source://parse_packwerk//lib/parse_packwerk/constants.rb#5 +# pkg:gem/parse_packwerk#lib/parse_packwerk/constants.rb:5 ParsePackwerk::PACKAGE_YML_NAME = T.let(T.unsafe(nil), String) -# source://parse_packwerk//lib/parse_packwerk/constants.rb#6 +# pkg:gem/parse_packwerk#lib/parse_packwerk/constants.rb:6 ParsePackwerk::PACKWERK_YML_NAME = T.let(T.unsafe(nil), String) -# source://parse_packwerk//lib/parse_packwerk/constants.rb#11 +# pkg:gem/parse_packwerk#lib/parse_packwerk/constants.rb:12 ParsePackwerk::PRIVACY_VIOLATION_TYPE = T.let(T.unsafe(nil), String) -# source://parse_packwerk//lib/parse_packwerk/constants.rb#12 +# pkg:gem/parse_packwerk#lib/parse_packwerk/constants.rb:13 ParsePackwerk::PUBLIC_PATH = T.let(T.unsafe(nil), String) -# source://parse_packwerk//lib/parse_packwerk/package.rb#4 +# pkg:gem/parse_packwerk#lib/parse_packwerk/package.rb:4 class ParsePackwerk::Package < ::T::Struct const :name, ::String - const :enforce_dependencies, T.any(::String, T::Boolean) + const :enforce_dependencies, T.nilable(T.any(::String, T::Boolean)) const :enforce_privacy, T.any(::String, T::Boolean), default: T.unsafe(nil) + const :enforce_layers, T.any(::String, T::Boolean), default: T.unsafe(nil) const :public_path, ::String, default: T.unsafe(nil) const :metadata, T::Hash[T.untyped, T.untyped] const :dependencies, T::Array[::String] const :config, T::Hash[T.untyped, T.untyped] + const :violations, T::Array[::ParsePackwerk::Violation] + const :original_key_order, T::Array[::String], default: T.unsafe(nil) - # source://parse_packwerk//lib/parse_packwerk/package.rb#41 + # pkg:gem/parse_packwerk#lib/parse_packwerk/package.rb:51 sig { returns(::Pathname) } def directory; end - # source://parse_packwerk//lib/parse_packwerk/package.rb#51 - sig { returns(T.any(::String, T::Boolean)) } + # pkg:gem/parse_packwerk#lib/parse_packwerk/package.rb:61 + sig { returns(T.nilable(T.any(::String, T::Boolean))) } def enforces_dependencies?; end - # source://parse_packwerk//lib/parse_packwerk/package.rb#56 + # pkg:gem/parse_packwerk#lib/parse_packwerk/package.rb:71 + sig { returns(T.any(::String, T::Boolean)) } + def enforces_layers?; end + + # pkg:gem/parse_packwerk#lib/parse_packwerk/package.rb:66 sig { returns(T.any(::String, T::Boolean)) } def enforces_privacy?; end - # source://parse_packwerk//lib/parse_packwerk/package.rb#46 + # pkg:gem/parse_packwerk#lib/parse_packwerk/package.rb:56 sig { returns(::Pathname) } def public_directory; end - # source://parse_packwerk//lib/parse_packwerk/package.rb#61 - sig { returns(T::Array[::ParsePackwerk::Violation]) } - def violations; end - - # source://parse_packwerk//lib/parse_packwerk/package.rb#36 + # pkg:gem/parse_packwerk#lib/parse_packwerk/package.rb:46 sig { returns(::Pathname) } def yml; end class << self - # source://parse_packwerk//lib/parse_packwerk/package.rb#16 + # pkg:gem/parse_packwerk#lib/parse_packwerk/package.rb:41 + sig { params(package_name: ::String).returns(::Pathname) } + def directory(package_name); end + + # pkg:gem/parse_packwerk#lib/parse_packwerk/package.rb:20 sig { params(pathname: ::Pathname).returns(::ParsePackwerk::Package) } def from(pathname); end - - # source://sorbet-runtime/0.5.10796/lib/types/struct.rb#13 - def inherited(s); end end end -# source://parse_packwerk//lib/parse_packwerk.rb#15 +# pkg:gem/parse_packwerk#lib/parse_packwerk.rb:20 class ParsePackwerk::PackageParseError < ::StandardError; end -# source://parse_packwerk//lib/parse_packwerk/package_set.rb#8 +# pkg:gem/parse_packwerk#lib/parse_packwerk/package_set.rb:8 class ParsePackwerk::PackageSet class << self - # source://parse_packwerk//lib/parse_packwerk/package_set.rb#12 + # pkg:gem/parse_packwerk#lib/parse_packwerk/package_set.rb:12 sig do params( package_pathspec: T::Array[::String], @@ -192,51 +222,47 @@ class ParsePackwerk::PackageSet private - # source://parse_packwerk//lib/parse_packwerk/package_set.rb#28 + # pkg:gem/parse_packwerk#lib/parse_packwerk/package_set.rb:28 sig { params(globs: T::Array[::String], path: ::Pathname).returns(T::Boolean) } def exclude_path?(globs, path); end end end -# source://parse_packwerk//lib/parse_packwerk/package_todo.rb#4 +# pkg:gem/parse_packwerk#lib/parse_packwerk/package_todo.rb:4 class ParsePackwerk::PackageTodo < ::T::Struct const :pathname, ::Pathname const :violations, T::Array[::ParsePackwerk::Violation] class << self - # source://parse_packwerk//lib/parse_packwerk/package_todo.rb#11 + # pkg:gem/parse_packwerk#lib/parse_packwerk/package_todo.rb:11 sig { params(package: ::ParsePackwerk::Package).returns(::ParsePackwerk::PackageTodo) } def for(package); end - # source://parse_packwerk//lib/parse_packwerk/package_todo.rb#17 + # pkg:gem/parse_packwerk#lib/parse_packwerk/package_todo.rb:16 sig { params(pathname: ::Pathname).returns(::ParsePackwerk::PackageTodo) } def from(pathname); end - # source://sorbet-runtime/0.5.10796/lib/types/struct.rb#13 - def inherited(s); end + # pkg:gem/parse_packwerk#lib/parse_packwerk/package_todo.rb:46 + sig { params(dirname: ::Pathname).returns(::Pathname) } + def yml(dirname); end end end -# source://parse_packwerk//lib/parse_packwerk/constants.rb#4 +# pkg:gem/parse_packwerk#lib/parse_packwerk/constants.rb:4 ParsePackwerk::ROOT_PACKAGE_NAME = T.let(T.unsafe(nil), String) -# source://parse_packwerk//lib/parse_packwerk/violation.rb#4 +# pkg:gem/parse_packwerk#lib/parse_packwerk/violation.rb:4 class ParsePackwerk::Violation < ::T::Struct const :type, ::String const :to_package_name, ::String const :class_name, ::String const :files, T::Array[::String] - # source://parse_packwerk//lib/parse_packwerk/violation.rb#13 + # pkg:gem/parse_packwerk#lib/parse_packwerk/violation.rb:13 sig { returns(T::Boolean) } def dependency?; end - # source://parse_packwerk//lib/parse_packwerk/violation.rb#18 + # pkg:gem/parse_packwerk#lib/parse_packwerk/violation.rb:18 sig { returns(T::Boolean) } def privacy?; end - - class << self - # source://sorbet-runtime/0.5.10796/lib/types/struct.rb#13 - def inherited(s); end - 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..1d30064 --- /dev/null +++ b/sorbet/rbi/gems/parser@3.3.12.0.rbi @@ -0,0 +1,5229 @@ +# 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 + # @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 + # @private + # + # pkg:gem/parser#lib/parser/ast/processor.rb:58 + def process_var_asgn_node(node); end + + # @private + # @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 +# +# 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]. + # 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" + # % + # 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. +# 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(*_arg0); 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/pastel@0.8.0.rbi b/sorbet/rbi/gems/pastel@0.8.0.rbi new file mode 100644 index 0000000..bdffc13 --- /dev/null +++ b/sorbet/rbi/gems/pastel@0.8.0.rbi @@ -0,0 +1,760 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `pastel` gem. +# Please instead update this file by running `bin/tapioca gem pastel`. + + +# pkg:gem/pastel#lib/pastel/alias_importer.rb:3 +module Pastel + private + + # Create Pastel chainable API + # + # @example + # pastel = Pastel.new enabled: true + # + # @param [Boolean] :enabled + # whether or not to disable coloring + # @param [Boolean] :eachline + # whether or not to wrap eachline with separate coloring + # + # @return [Delegator] + # + # @api public + # + # pkg:gem/pastel#lib/pastel.rb:31 + def new(enabled: T.unsafe(nil), eachline: T.unsafe(nil)); end + + class << self + # pkg:gem/pastel#lib/pastel.rb:41 + def new(enabled: T.unsafe(nil), eachline: T.unsafe(nil)); end + end +end + +# Mixin that provides ANSI codes +# +# pkg:gem/pastel#lib/pastel/ansi.rb:5 +module Pastel::ANSI + private + + # pkg:gem/pastel#lib/pastel/ansi.rb:62 + def background?(code); end + + # pkg:gem/pastel#lib/pastel/ansi.rb:58 + def foreground?(code); end + + # pkg:gem/pastel#lib/pastel/ansi.rb:66 + def style?(code); end + + class << self + # pkg:gem/pastel#lib/pastel/ansi.rb:62 + def background?(code); end + + # pkg:gem/pastel#lib/pastel/ansi.rb:58 + def foreground?(code); end + + # pkg:gem/pastel#lib/pastel/ansi.rb:66 + def style?(code); end + end +end + +# pkg:gem/pastel#lib/pastel/ansi.rb:6 +Pastel::ANSI::ATTRIBUTES = T.let(T.unsafe(nil), Hash) + +# A class responsible for importing color aliases +# +# pkg:gem/pastel#lib/pastel/alias_importer.rb:5 +class Pastel::AliasImporter + # Create alias importer + # + # @example + # importer = Pastel::AliasImporter.new(Pastel::Color.new, {}) + # + # @api public + # + # pkg:gem/pastel#lib/pastel/alias_importer.rb:12 + def initialize(color, env, output = T.unsafe(nil)); end + + # Import aliases from the environment + # + # @example + # importer = Pastel::AliasImporter.new(Pastel::Color.new, {}) + # importer.import + # + # @return [nil] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/alias_importer.rb:27 + def import; end + + protected + + # pkg:gem/pastel#lib/pastel/alias_importer.rb:44 + def color; end + + # pkg:gem/pastel#lib/pastel/alias_importer.rb:44 + def env; end + + # pkg:gem/pastel#lib/pastel/alias_importer.rb:44 + def output; end +end + +# A class responsible for coloring strings. +# +# pkg:gem/pastel#lib/pastel/color.rb:7 +class Pastel::Color + include ::Pastel::ANSI + + # Initialize a Terminal Color + # + # @api public + # + # pkg:gem/pastel#lib/pastel/color.rb:24 + def initialize(enabled: T.unsafe(nil), eachline: T.unsafe(nil)); end + + # Compare colors for equivalence of attributes + # + # @return [Boolean] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/color.rb:235 + def ==(other); end + + # Define a new colors alias + # + # @param [String] alias_name + # the colors alias to define + # @param [Array[Symbol,String]] color + # the colors the alias will correspond to + # + # @return [Array[String]] + # the standard color values of the alias + # + # @api public + # + # pkg:gem/pastel#lib/pastel/color.rb:206 + def alias_color(alias_name, *colors); end + + # Apply escape codes to the string + # + # @param [String] string + # the string to apply escapes to + # @param [Strin] ansi_colors + # the ansi colors to apply + # + # @return [String] + # return the string surrounded by escape codes + # + # @api private + # + # pkg:gem/pastel#lib/pastel/color.rb:78 + def apply_codes(string, ansi_colors); end + + # Reset sequence + # + # @api public + # + # pkg:gem/pastel#lib/pastel/color.rb:85 + def clear; end + + # Return raw color code without embeding it into a string. + # + # @return [Array[String]] + # ANSI escape codes + # + # @api public + # + # pkg:gem/pastel#lib/pastel/color.rb:148 + def code(*colors); end + + # Check if string has color escape codes + # + # @param [String] string + # the string to check for color strings + # + # @return [Boolean] + # true when string contains color codes, false otherwise + # + # @api public + # + # pkg:gem/pastel#lib/pastel/color.rb:117 + def colored?(string); end + + # Apply ANSI color to the given string. + # + # Wraps eachline with clear escape. + # + # @param [String] string + # text to add ANSI strings + # + # @param [Array[Symbol]] colors + # the color names + # + # @example + # color.decorate "text", :yellow, :on_green, :underline + # + # @return [String] + # the colored string + # + # @api public + # + # pkg:gem/pastel#lib/pastel/color.rb:54 + def decorate(string, *colors); end + + # Disable coloring of this terminal session + # + # @api public + # + # pkg:gem/pastel#lib/pastel/color.rb:33 + def disable!; end + + # pkg:gem/pastel#lib/pastel/color.rb:19 + def eachline; end + + # pkg:gem/pastel#lib/pastel/color.rb:16 + def enabled; end + + # pkg:gem/pastel#lib/pastel/color.rb:17 + def enabled?; end + + # Compare colors for equality of attributes + # + # @return [Boolean] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/color.rb:225 + def eql?(other); end + + # Hash for this instance and its attributes + # + # @return [Numeric] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/color.rb:254 + def hash; end + + # Inspect this instance attributes + # + # @return [String] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/color.rb:245 + def inspect; end + + # Find the escape code for a given set of color attributes + # + # @example + # color.lookup(:red, :on_green) # => "\e[31;42m" + # + # @param [Array[Symbol]] colors + # the list of color name(s) to lookup + # + # @return [String] + # the ANSI code(s) + # + # @raise [InvalidAttributeNameError] + # exception raised for any invalid color name + # + # @api private + # + # pkg:gem/pastel#lib/pastel/color.rb:136 + def lookup(*colors); end + + # Strip ANSI color codes from a string. + # + # Only ANSI color codes are removed, not movement codes or + # other escapes sequences are stripped. + # + # @param [Array[String]] strings + # a string or array of strings to sanitize + # + # @example + # strip("foo\e[1mbar\e[0m") # => "foobar" + # + # @return [String] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/color.rb:103 + def strip(*strings); end + + # List all available style names + # + # @return [Array[Symbol]] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/color.rb:175 + def style_names; end + + # Expose all ANSI color names and their codes + # + # @return [Hash[Symbol]] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/color.rb:166 + def styles; end + + # Check if provided colors are known colors + # + # @param [Array[Symbol,String]] + # the list of colors to check + # + # @example + # valid?(:red) # => true + # + # @return [Boolean] + # true if all colors are valid, false otherwise + # + # @api public + # + # pkg:gem/pastel#lib/pastel/color.rb:191 + def valid?(*colors); end + + private + + # Check if value contains anything to style + # + # @return [Boolean] + # + # @api private + # + # pkg:gem/pastel#lib/pastel/color.rb:265 + def blank?(value); end + + # @api private + # + # pkg:gem/pastel#lib/pastel/color.rb:270 + def validate(*colors); end +end + +# All color aliases +# +# pkg:gem/pastel#lib/pastel/color.rb:11 +Pastel::Color::ALIASES = T.let(T.unsafe(nil), Hash) + +# Match all color escape sequences +# +# pkg:gem/pastel#lib/pastel/color.rb:14 +Pastel::Color::ANSI_COLOR_REGEXP = T.let(T.unsafe(nil), Regexp) + +# Responsible for parsing color symbols out of text with color escapes +# +# Used internally by {Color}. +# +# @api private +# +# pkg:gem/pastel#lib/pastel/color_parser.rb:13 +class Pastel::ColorParser + include ::Pastel::ANSI + + class << self + # Decide attribute name for ansi + # + # @param [Integer] ansi + # the ansi escape code + # + # @return [Symbol] + # + # @api private + # + # pkg:gem/pastel#lib/pastel/color_parser.rb:104 + def attribute_name(ansi); end + + # Convert ANSI code to color name + # + # @return [String] + # + # @api private + # + # pkg:gem/pastel#lib/pastel/color_parser.rb:119 + def color_name(ansi_code); end + + # Parse color escape sequences into a list of hashes + # corresponding to the color attributes being set by these + # sequences + # + # @example + # parse("\e[32mfoo\e[0m") + # # => [{foreground: :green, text: "foo"} + # + # @param [String] text + # the text to parse for presence of color ansi codes + # + # @return [Array[Hash[Symbol,String]]] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/color_parser.rb:33 + def parse(text); end + + # Remove from current stack all ansi codes + # + # @param [Array[Integer]] ansi_stack + # the stack with all the ansi codes + # + # @yield [Symbol, Symbol] attr, name + # + # @api private + # + # pkg:gem/pastel#lib/pastel/color_parser.rb:90 + def unpack_ansi(ansi_stack); end + end +end + +# pkg:gem/pastel#lib/pastel/color_parser.rb:17 +Pastel::ColorParser::CSI = T.let(T.unsafe(nil), String) + +# pkg:gem/pastel#lib/pastel/color_parser.rb:16 +Pastel::ColorParser::ESC = T.let(T.unsafe(nil), String) + +# Contains logic for resolving styles applied to component +# +# Used internally by {Delegator}. +# +# @api private +# +# pkg:gem/pastel#lib/pastel/color_resolver.rb:11 +class Pastel::ColorResolver + # Initialize ColorResolver + # + # @param [Color] color + # + # @api private + # + # pkg:gem/pastel#lib/pastel/color_resolver.rb:21 + def initialize(color); end + + # The color instance + # @api public + # + # pkg:gem/pastel#lib/pastel/color_resolver.rb:14 + def color; end + + # Resolve uncolored string + # + # @api private + # + # pkg:gem/pastel#lib/pastel/color_resolver.rb:28 + def resolve(base, unprocessed_string); end +end + +# Collects a list of decorators for styling a string +# +# @api private +# +# pkg:gem/pastel#lib/pastel/decorator_chain.rb:7 +class Pastel::DecoratorChain + include ::Enumerable + + # Create a decorator chain + # + # @api public + # + # pkg:gem/pastel#lib/pastel/decorator_chain.rb:22 + def initialize(decorators = T.unsafe(nil)); end + + # Compare colors for equivalence of attributes + # + # @return [Boolean] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/decorator_chain.rb:60 + def ==(other); end + + # Add decorator + # + # @param [String] decorator + # + # @api public + # + # pkg:gem/pastel#lib/pastel/decorator_chain.rb:31 + def add(decorator); end + + # Iterate over list of decorators + # + # @api public + # + # pkg:gem/pastel#lib/pastel/decorator_chain.rb:42 + def each(&block); end + + # Compare colors for equality of attributes + # + # @return [Boolean] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/decorator_chain.rb:51 + def eql?(other); end + + # Hash for this instance and its attributes + # + # @return [Numeric] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/decorator_chain.rb:78 + def hash; end + + # Inspect this instance attributes + # + # @return [String] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/decorator_chain.rb:69 + def inspect; end + + protected + + # pkg:gem/pastel#lib/pastel/decorator_chain.rb:84 + def decorators; end + + class << self + # Create an empty decorator chain + # + # @return [DecoratorChain] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/decorator_chain.rb:15 + def empty; end + end +end + +# Wrapes the {DecoratorChain} to allow for easy resolution +# of string coloring. +# +# @api private +# +# pkg:gem/pastel#lib/pastel/delegator.rb:13 +class Pastel::Delegator + extend ::Forwardable + + # Create Delegator + # + # Used internally by {Pastel} + # + # @param [ColorResolver] resolver + # + # @param [DecoratorChain] chain + # + # @api private + # + # pkg:gem/pastel#lib/pastel/delegator.rb:38 + def initialize(resolver, chain); end + + # Compare delegated objects for equivalence of attributes + # + # @return [Boolean] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/delegator.rb:57 + def ==(other); end + + # pkg:gem/pastel#lib/pastel/delegator.rb:16 + def alias_color(*args, **_arg1, &block); end + + # pkg:gem/pastel#lib/pastel/delegator.rb:16 + def colored?(*args, **_arg1, &block); end + + # pkg:gem/pastel#lib/pastel/delegator.rb:16 + def decorate(*args, **_arg1, &block); end + + # pkg:gem/pastel#lib/pastel/delegator.rb:16 + def enabled?(*args, **_arg1, &block); end + + # Compare delegated objects for equality of attributes + # + # @return [Boolean] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/delegator.rb:48 + def eql?(other); end + + # Hash for this instance and its attributes + # + # @return [Numeric] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/delegator.rb:76 + def hash; end + + # Object string representation + # + # @return [String] + # + # @api + # + # pkg:gem/pastel#lib/pastel/delegator.rb:66 + def inspect; end + + # pkg:gem/pastel#lib/pastel/delegator.rb:16 + def lookup(*args, **_arg1, &block); end + + # pkg:gem/pastel#lib/pastel/delegator.rb:19 + def parse(*args, **_arg1, &block); end + + # pkg:gem/pastel#lib/pastel/delegator.rb:16 + def strip(*args, **_arg1, &block); end + + # pkg:gem/pastel#lib/pastel/delegator.rb:16 + def styles(*args, **_arg1, &block); end + + # pkg:gem/pastel#lib/pastel/delegator.rb:69 + def to_s; end + + # pkg:gem/pastel#lib/pastel/delegator.rb:20 + def undecorate(*args, **_arg1, &block); end + + # pkg:gem/pastel#lib/pastel/delegator.rb:16 + def valid?(*args, **_arg1, &block); end + + protected + + # pkg:gem/pastel#lib/pastel/delegator.rb:82 + def chain; end + + # Evaluate color block + # + # @api private + # + # pkg:gem/pastel#lib/pastel/delegator.rb:112 + def evaluate_block(&block); end + + # Handles color method calls + # + # @api private + # + # pkg:gem/pastel#lib/pastel/delegator.rb:89 + def method_missing(method_name, *args, &block); end + + # pkg:gem/pastel#lib/pastel/delegator.rb:84 + def resolver; end + + private + + # Check if color is valid + # + # @api private + # + # pkg:gem/pastel#lib/pastel/delegator.rb:104 + def respond_to_missing?(name, include_all = T.unsafe(nil)); end + + class << self + # Wrap resolver and chain + # + # @api public + # + # pkg:gem/pastel#lib/pastel/delegator.rb:25 + def wrap(resolver, chain = T.unsafe(nil)); end + end +end + +# A class representing detached color +# +# pkg:gem/pastel#lib/pastel/detached.rb:5 +class Pastel::Detached + # Initialize a detached object + # + # @param [Pastel::Color] color + # the color instance + # @param [Array[Symbol]] styles + # the styles to be applied + # + # @api private + # + # pkg:gem/pastel#lib/pastel/detached.rb:14 + def initialize(color, *styles); end + + # Compare detached objects for equivalence of attributes + # + # @return [Boolean] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/detached.rb:57 + def ==(other); end + + # pkg:gem/pastel#lib/pastel/detached.rb:36 + def [](*args); end + + # Decorate the values corresponding to styles + # + # @example + # Detached(Color.new, :red, :bold).call("hello") + # # => "\e[31mhello\e[0m" + # + # @param [String] value + # the stirng to decorate with styles + # + # @return [String] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/detached.rb:32 + def call(*args); end + + # Compare detached objects for equality of attributes + # + # @return [Boolean] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/detached.rb:48 + def eql?(other); end + + # Hash for this instance and its attributes + # + # @return [Numeric] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/detached.rb:75 + def hash; end + + # Inspect this instance attributes + # + # @return [String] + # + # @api public + # + # pkg:gem/pastel#lib/pastel/detached.rb:66 + def inspect; end + + # @api public + # + # pkg:gem/pastel#lib/pastel/detached.rb:39 + def to_proc; end + + protected + + # @api private + # + # pkg:gem/pastel#lib/pastel/detached.rb:82 + def styles; end +end + +# Raised when the color alias is not supported +# +# pkg:gem/pastel#lib/pastel.rb:16 +class Pastel::InvalidAliasNameError < ::ArgumentError; end + +# Raised when the style attribute is not supported +# +# pkg:gem/pastel#lib/pastel.rb:13 +class Pastel::InvalidAttributeNameError < ::ArgumentError; end + +# pkg:gem/pastel#lib/pastel/version.rb:4 +Pastel::VERSION = T.let(T.unsafe(nil), String) 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..5a9940e --- /dev/null +++ b/sorbet/rbi/gems/prism@1.9.0.rbi @@ -0,0 +1,42226 @@ +# 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 +# :markup: markdown +# =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. +# ++ +# +# :markup: markdown +# :markup: markdown +# :markup: markdown +# :markup: markdown +# =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 +# :markup: markdown +# :markup: markdown +# :markup: markdown +# :markup: markdown +# :markup: markdown +# +# :markup: markdown +# :markup: markdown +# =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, *_arg1, **_arg2, &_arg3); 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:12 +Prism::Translation::ParserCurrent = Prism::Translation::Parser34 + +# 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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/pry@0.16.0.rbi b/sorbet/rbi/gems/pry@0.16.0.rbi new file mode 100644 index 0000000..7df2dc8 --- /dev/null +++ b/sorbet/rbi/gems/pry@0.16.0.rbi @@ -0,0 +1,9091 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `pry` gem. +# Please instead update this file by running `bin/tapioca gem pry`. + + +# pkg:gem/pry#lib/pry/core_extensions.rb:115 +class BasicObject + # Return a binding object for the receiver. + # + # The `self` of the binding is set to the current object, and it contains no + # local variables. + # + # The default definee (http://yugui.jp/articles/846) is set such that new + # methods defined will be added to the singleton class of the BasicObject. + # + # @return [Binding] + # + # pkg:gem/pry#lib/pry/core_extensions.rb:125 + def __binding__; end +end + +# pkg:gem/pry#lib/pry/core_extensions.rb:24 +class Object < ::BasicObject + include ::Kernel + include ::PP::ObjectMixin + + # Return a binding object for the receiver. + # + # The `self` of the binding is set to the current object, and it contains no + # local variables. + # + # The default definee (http://yugui.jp/articles/846) is set such that: + # + # * If `self` is a class or module, then new methods created in the binding + # will be defined in that class or module (as in `class Foo; end`). + # * If `self` is a normal object, then new methods created in the binding will + # be defined on its singleton class (as in `class << self; end`). + # * If `self` doesn't have a real singleton class (i.e. it is a Fixnum, Float, + # Symbol, nil, true, or false), then new methods will be created on the + # object's class (as in `self.class.class_eval{ }`) + # + # Newly created constants, including classes and modules, will also be added + # to the default definee. + # + # @return [Binding] + # + # pkg:gem/pry#lib/pry/core_extensions.rb:70 + def __binding__; end + + # Start a Pry REPL on self. + # + # If `self` is a Binding then that will be used to evaluate expressions; + # otherwise a new binding will be created. + # + # @param [Object] object the object or binding to pry + # (__deprecated__, use `object.pry`) + # @param [Hash] hash the options hash + # @example With a binding + # binding.pry + # @example On any object + # "dummy".pry + # @example With options + # def my_method + # binding.pry :quiet => true + # end + # my_method() + # @see Pry.start + # + # pkg:gem/pry#lib/pry/core_extensions.rb:43 + def pry(object = T.unsafe(nil), hash = T.unsafe(nil)); end +end + +# taken from irb +# Implements tab completion for Readline in Pry +# +# {Pry::LastException} is a proxy class who wraps an Exception object for +# {Pry#last_exception}. it extends the exception object with methods that +# help pry commands be useful. +# +# the original exception object is not modified and method calls are forwarded +# to the wrapped exception object. +# +# A pager is an `IO`-like object that accepts text and either prints it +# immediately, prints it one page at a time, or streams it to an external +# program to print one page at a time. +# +# pkg:gem/pry#lib/pry/version.rb:3 +class Pry + extend ::Forwardable + extend ::Pry::Forwardable + + # Create a new {Pry} instance. + # @param [Hash] options + # @option options [#readline] :input + # The object to use for input. + # @option options [#puts] :output + # The object to use for output. + # @option options [Pry::CommandBase] :commands + # The object to use for commands. + # @option options [Hash] :hooks + # The defined hook Procs. + # @option options [Pry::Prompt] :prompt + # The array of Procs to use for prompts. + # @option options [Proc] :print + # The Proc to use for printing return values. + # @option options [Boolean] :quiet + # Omit the `whereami` banner when starting. + # @option options [Array] :backtrace + # The backtrace of the session's `binding.pry` line, if applicable. + # @option options [Object] :target + # The initial context for this session. + # + # pkg:gem/pry#lib/pry/pry_instance.rb:80 + def initialize(options = T.unsafe(nil)); end + + # Add a sticky local to this Pry instance. + # A sticky local is a local that persists between all bindings in a session. + # @param [Symbol] name The name of the sticky local. + # @yield The block that defines the content of the local. The local + # will be refreshed at each tick of the repl loop. + # + # pkg:gem/pry#lib/pry/pry_instance.rb:210 + def add_sticky_local(name, &block); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:34 + def backtrace; end + + # pkg:gem/pry#lib/pry/pry_instance.rb:34 + def backtrace=(_arg0); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:31 + def binding_stack; end + + # pkg:gem/pry#lib/pry/pry_instance.rb:31 + def binding_stack=(_arg0); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def color(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def color=(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def commands(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def commands=(*args, **_arg1, &block); end + + # Generate completions. + # + # @param [String] str + # What the user has typed so far + # + # @return [Array] + # Possible completions + # + # pkg:gem/pry#lib/pry/pry_instance.rb:143 + def complete(str); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:49 + def config; end + + # The currently active `Binding`. + # @return [Binding] The currently active `Binding` for the session. + # + # pkg:gem/pry#lib/pry/pry_instance.rb:122 + def current_binding; end + + # pkg:gem/pry#lib/pry/pry_instance.rb:125 + def current_context; end + + # pkg:gem/pry#lib/pry/pry_instance.rb:32 + def custom_completions; end + + # pkg:gem/pry#lib/pry/pry_instance.rb:32 + def custom_completions=(_arg0); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def editor(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def editor=(*args, **_arg1, &block); end + + # Pass a line of input to Pry. + # + # This is the equivalent of `Binding#eval` but with extra Pry! + # + # In particular: + # 1. Pry commands will be executed immediately if the line matches. + # 2. Partial lines of input will be queued up until a complete expression has + # been accepted. + # 3. Output is written to `#output` in pretty colours, not returned. + # + # Once this method has raised an exception or returned false, this instance + # is no longer usable. {#exit_value} will return the session's breakout + # value if applicable. + # + # @param [String?] line The line of input; `nil` if the user types `` + # @option options [Boolean] :generated Whether this line was generated automatically. + # Generated lines are not stored in history. + # @return [Boolean] Is Pry ready to accept more input? + # @raise [Exception] If the user uses the `raise-up` command, this method + # will raise that exception. + # + # pkg:gem/pry#lib/pry/pry_instance.rb:253 + def eval(line, options = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:33 + def eval_string; end + + # pkg:gem/pry#lib/pry/pry_instance.rb:33 + def eval_string=(_arg0); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:284 + def evaluate_ruby(code); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def exception_handler(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def exception_handler=(*args, **_arg1, &block); end + + # Execute the specified hook. + # @param [Symbol] name The hook name to execute + # @param [*Object] args The arguments to pass to the hook + # @return [Object, Exception] The return value of the hook or the exception raised + # + # If executing a hook raises an exception, we log that and then continue successfully. + # To debug such errors, use the global variable $pry_hook_error, which is set as a + # result. + # + # pkg:gem/pry#lib/pry/pry_instance.rb:392 + def exec_hook(name, *args, &block); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:41 + def exit_value; end + + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def extra_sticky_locals(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def extra_sticky_locals=(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def hooks(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def hooks=(*args, **_arg1, &block); end + + # Injects a local variable into the provided binding. + # + # @param [String] name + # The name of the local to inject. + # + # @param [Object] value + # The value to set the local to. + # + # @param [Binding] binding + # The binding to set the local on. + # + # @return [Object] + # The value the local was set to. + # + # pkg:gem/pry#lib/pry/pry_instance.rb:171 + def inject_local(name, value, binding); end + + # Inject all the sticky locals into the current binding. + # + # pkg:gem/pry#lib/pry/pry_instance.rb:199 + def inject_sticky_locals!; end + + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def input(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def input=(*args, **_arg1, &block); end + + # @since v0.12.0 + # + # pkg:gem/pry#lib/pry/pry_instance.rb:44 + def input_ring; end + + # pkg:gem/pry#lib/pry/pry_instance.rb:38 + def last_dir; end + + # pkg:gem/pry#lib/pry/pry_instance.rb:38 + def last_dir=(_arg0); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:40 + def last_exception; end + + # Set the last exception for a session. + # @param [Exception] exception The last exception. + # + # pkg:gem/pry#lib/pry/pry_instance.rb:416 + def last_exception=(exception); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:37 + def last_file; end + + # pkg:gem/pry#lib/pry/pry_instance.rb:37 + def last_file=(_arg0); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:36 + def last_result; end + + # pkg:gem/pry#lib/pry/pry_instance.rb:36 + def last_result=(_arg0); end + + # @return [Boolean] True if the last result is an exception that was raised, + # as opposed to simply an instance of Exception (like the result of + # Exception.new) + # + # pkg:gem/pry#lib/pry/pry_instance.rb:438 + def last_result_is_exception?; end + + # @return [Integer] The maximum amount of objects remembered by the inp and + # out arrays. Defaults to 100. + # + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def memory_size; end + + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def memory_size=(size); end + + # Returns an output device + # @example + # pry_instance.output.puts "ohai!" + # + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def output; end + + # Returns an output device + # @example + # pry_instance.output.puts "ohai!" + # + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def output=(*args, **_arg1, &block); end + + # @since v0.12.0 + # + # pkg:gem/pry#lib/pry/pry_instance.rb:47 + def output_ring; end + + # Returns the currently configured pager + # @example + # pry_instance.pager.page text + # + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def pager; end + + # Returns the currently configured pager + # @example + # pry_instance.pager.page text + # + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def pager=(*args, **_arg1, &block); end + + # Pops the current prompt off of the prompt stack. If the prompt you are + # popping is the last prompt, it will not be popped. Use this to restore the + # previous prompt. + # + # @example + # pry = Pry.new(prompt: Pry::Prompt[:my_prompt1]) + # pry.push_prompt(Pry::Prompt[:my_prompt2]) + # pry.pop_prompt # => prompt2 + # pry.pop_prompt # => prompt1 + # pry.pop_prompt # => prompt1 + # + # @return [Pry::Prompt] the prompt being popped + # + # pkg:gem/pry#lib/pry/pry_instance.rb:492 + def pop_prompt; end + + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def print(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:51 + def print=(*args, **_arg1, &block); end + + # If the given line is a valid command, process it in the context of the + # current `eval_string` and binding. + # @param [String] val The line to process. + # @return [Boolean] `true` if `val` is a command, `false` otherwise + # + # pkg:gem/pry#lib/pry/pry_instance.rb:323 + def process_command(val); end + + # Same as process_command, but outputs exceptions to `#output` instead of + # raising. + # @param [String] val The line to process. + # @return [Boolean] `true` if `val` is a command, `false` otherwise + # + # pkg:gem/pry#lib/pry/pry_instance.rb:358 + def process_command_safely(val); end + + # This is the prompt at the top of the prompt stack. + # @return [Pry::Prompt] the current prompt + # + # pkg:gem/pry#lib/pry/pry_instance.rb:99 + def prompt; end + + # Sets the Pry prompt. + # @param [Pry::Prompt] new_prompt + # @return [void] + # + # pkg:gem/pry#lib/pry/pry_instance.rb:106 + def prompt=(new_prompt); end + + # Push a binding for the given object onto the stack. If this instance is + # currently stopped, mark it as usable again. + # + # pkg:gem/pry#lib/pry/pry_instance.rb:129 + def push_binding(object); end + + # Initialize this instance by pushing its initial context into the binding + # stack. If no target is given, start at the top level. + # + # pkg:gem/pry#lib/pry/pry_instance.rb:116 + def push_initial_binding(target = T.unsafe(nil)); end + + # Pushes the current prompt onto a stack that it can be restored from later. + # Use this if you wish to temporarily change the prompt. + # + # @example + # push_prompt(Pry::Prompt[:my_prompt]) + # + # @param [Pry::Prompt] new_prompt + # @return [Pry::Prompt] new_prompt + # + # pkg:gem/pry#lib/pry/pry_instance.rb:476 + def push_prompt(new_prompt); end + + # Convenience accessor for the `quiet` config key. + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/pry_instance.rb:562 + def quiet?; end + + # pkg:gem/pry#lib/pry/pry_instance.rb:552 + def raise_up(*args); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:556 + def raise_up!(*args); end + + # Raise an exception out of Pry. + # + # See Kernel#raise for documentation of parameters. + # See rb_make_exception for the inbuilt implementation. + # + # This is necessary so that the raise-up command can tell the + # difference between an exception the user has decided to raise, + # and a mistake in specifying that exception. + # + # (i.e. raise-up RunThymeError.new should not be the same as + # raise-up NameError, "uninitialized constant RunThymeError") + # + # pkg:gem/pry#lib/pry/pry_instance.rb:524 + def raise_up_common(force, *args); end + + # Potentially deprecated. Use `Pry::REPL.new(pry, :target => target).start` + # (If nested sessions are going to exist, this method is fine, but a goal is + # to come up with an alternative to nested sessions altogether.) + # + # pkg:gem/pry#lib/pry/pry_instance.rb:280 + def repl(target = T.unsafe(nil)); end + + # Reset the current eval string. If the user has entered part of a multiline + # expression, this discards that input. + # + # pkg:gem/pry#lib/pry/pry_instance.rb:229 + def reset_eval_string; end + + # Run the specified command. + # @param [String] val The command (and its params) to execute. + # @return [Pry::Command::VOID_VALUE] + # @example + # pry_instance.run_command("ls -m") + # + # pkg:gem/pry#lib/pry/pry_instance.rb:373 + def run_command(val); end + + # Returns the appropriate prompt to use. + # @return [String] The prompt. + # + # pkg:gem/pry#lib/pry/pry_instance.rb:451 + def select_prompt; end + + # Set the last result of an eval. + # This method should not need to be invoked directly. + # @param [Object] result The result. + # @param [String] code The code that was run. + # + # pkg:gem/pry#lib/pry/pry_instance.rb:407 + def set_last_result(result, code = T.unsafe(nil)); end + + # Whether the print proc should be invoked. + # Currently only invoked if the output is not suppressed. + # @return [Boolean] Whether the print proc should be invoked. + # + # pkg:gem/pry#lib/pry/pry_instance.rb:445 + def should_print?; end + + # Output the result or pass to an exception handler (if result is an exception). + # + # pkg:gem/pry#lib/pry/pry_instance.rb:296 + def show_result(result); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:214 + def sticky_locals; end + + # pkg:gem/pry#lib/pry/pry_instance.rb:35 + def suppress_output; end + + # pkg:gem/pry#lib/pry/pry_instance.rb:35 + def suppress_output=(_arg0); end + + # Update Pry's internal state after evalling code. + # This method should not need to be invoked directly. + # @param [String] code The code we just eval'd + # + # pkg:gem/pry#lib/pry/pry_instance.rb:426 + def update_input_history(code); end + + private + + # Force `eval_string` into the encoding of `val`. [Issue #284] + # + # pkg:gem/pry#lib/pry/pry_instance.rb:650 + def ensure_correct_encoding!(val); end + + # pkg:gem/pry#lib/pry/pry_instance.rb:568 + def handle_line(line, options); end + + # the array that the prompt stack is stored in + # + # pkg:gem/pry#lib/pry/pry_instance.rb:659 + def prompt_stack; end + + class << self + # Convert the given object into an instance of `Pry::Code`, if it isn't + # already one. + # + # @param [Code, Method, UnboundMethod, Proc, Pry::Method, String, Array, + # IO] obj + # + # pkg:gem/pry#lib/pry/code.rb:12 + def Code(obj); end + + # If the given object is a `Pry::Method`, return it unaltered. If it's + # anything else, return it wrapped in a `Pry::Method` instance. + # + # pkg:gem/pry#lib/pry/method.rb:9 + def Method(obj); end + + # If the given object is a `Pry::WrappedModule`, return it unaltered. If it's + # anything else, return it wrapped in a `Pry::WrappedModule` instance. + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:7 + def WrappedModule(obj); end + + # pkg:gem/pry#lib/pry/pry_class.rb:296 + def auto_resize!; end + + # Return a `Binding` object for `target` or return `target` if it is + # already a `Binding`. + # In the case where `target` is top-level then return `TOPLEVEL_BINDING` + # @param [Object] target The object to get a `Binding` object for. + # @return [Binding] The `Binding` object. + # + # pkg:gem/pry#lib/pry/pry_class.rb:322 + def binding_for(target); end + + # pkg:gem/pry#lib/pry/pry_class.rb:22 + def cli; end + + # pkg:gem/pry#lib/pry/pry_class.rb:22 + def cli=(_arg0); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def color(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def color=(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def commands(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def commands=(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:25 + def config; end + + # pkg:gem/pry#lib/pry/pry_class.rb:25 + def config=(_arg0); end + + # @example + # Pry.configure do |config| + # config.eager_load! # optional + # config.input = # .. + # config.foo = 2 + # end + # + # @yield [config] + # Yields a block with {Pry.config} as its argument. + # + # pkg:gem/pry#lib/pry/pry_class.rb:46 + def configure; end + + # pkg:gem/pry#lib/pry/pry_class.rb:355 + def critical_section; end + + # @return [Pry::Config] + # Returns a value store for an instance of Pry running on the current thread. + # + # pkg:gem/pry#lib/pry/pry_class.rb:63 + def current; end + + # pkg:gem/pry#lib/pry/pry_class.rb:19 + def current_line; end + + # pkg:gem/pry#lib/pry/pry_class.rb:19 + def current_line=(_arg0); end + + # pkg:gem/pry#lib/pry/pry_class.rb:18 + def custom_completions; end + + # pkg:gem/pry#lib/pry/pry_class.rb:18 + def custom_completions=(_arg0); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def editor(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def editor=(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:21 + def eval_path; end + + # pkg:gem/pry#lib/pry/pry_class.rb:21 + def eval_path=(_arg0); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def exception_handler(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def exception_handler=(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def extra_sticky_locals(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def extra_sticky_locals=(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:139 + def final_session_setup; end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def history(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def history=(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def hooks(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def hooks=(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:350 + def in_critical_section?; end + + # Basic initialization. + # + # pkg:gem/pry#lib/pry/pry_class.rb:313 + def init; end + + # @return [Boolean] Whether this is the first time a Pry session has + # been started since loading the Pry class. + # + # pkg:gem/pry#lib/pry/pry_class.rb:259 + def initial_session?; end + + # Do basic setup for initial session including: loading pryrc, plugins, + # requires, and history. + # + # pkg:gem/pry#lib/pry/pry_class.rb:129 + def initial_session_setup; end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def input(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def input=(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:24 + def last_internal_error; end + + # pkg:gem/pry#lib/pry/pry_class.rb:24 + def last_internal_error=(_arg0); end + + # pkg:gem/pry#lib/pry/pry_class.rb:20 + def line_buffer; end + + # pkg:gem/pry#lib/pry/pry_class.rb:20 + def line_buffer=(_arg0); end + + # Load the given file in the context of `Pry.toplevel_binding` + # @param [String] file The unexpanded file path. + # + # pkg:gem/pry#lib/pry/pry_class.rb:69 + def load_file_at_toplevel(file); end + + # Execute the file through the REPL loop, non-interactively. + # @param [String] file_name File name to load through the REPL. + # + # pkg:gem/pry#lib/pry/pry_class.rb:204 + def load_file_through_repl(file_name); end + + # Load Readline history if required. + # + # pkg:gem/pry#lib/pry/pry_class.rb:253 + def load_history; end + + # Load RC files if appropriate This method can also be used to reload the + # files if they have changed. + # + # pkg:gem/pry#lib/pry/pry_class.rb:77 + def load_rc_files; end + + # Load any Ruby files specified with the -r flag on the command line. + # + # pkg:gem/pry#lib/pry/pry_class.rb:101 + def load_requires; end + + # Trap interrupts on jruby, and make them behave like MRI so we can + # catch them. + # + # pkg:gem/pry#lib/pry/pry_class.rb:109 + def load_traps; end + + # pkg:gem/pry#lib/pry/pry_class.rb:113 + def load_win32console; end + + # @return [main] + # returns the special instance of Object, "main". + # + # pkg:gem/pry#lib/pry/pry_class.rb:55 + def main; end + + # @return [Integer] The maximum amount of objects remembered by the inp and + # out arrays. Defaults to 100. + # + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def memory_size(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def memory_size=(*args, **_arg1, &block); end + + # Returns an output device + # @example + # pry_instance.output.puts "ohai!" + # + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def output(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def output=(*args, **_arg1, &block); end + + # Returns the currently configured pager + # @example + # pry_instance.pager.page text + # + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def pager(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def pager=(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def print(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def print=(*args, **_arg1, &block); end + + # This is the prompt at the top of the prompt stack. + # @return [Pry::Prompt] the current prompt + # + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def prompt(*args, **_arg1, &block); end + + # Sets the Pry prompt. + # @param [Pry::Prompt] new_prompt + # @return [void] + # + # pkg:gem/pry#lib/pry/pry_class.rb:27 + def prompt=(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/pry_class.rb:23 + def quiet; end + + # pkg:gem/pry#lib/pry/pry_class.rb:23 + def quiet=(_arg0); end + + # Load the local RC file (./.pryrc) + # + # pkg:gem/pry#lib/pry/pry_class.rb:86 + def rc_files_to_load; end + + # Expand a file to its canonical name (following symlinks as appropriate) + # + # pkg:gem/pry#lib/pry/pry_class.rb:94 + def real_path_to(file); end + + # Set all the configurable options back to their default values + # + # pkg:gem/pry#lib/pry/pry_class.rb:301 + def reset_defaults; end + + # Run a Pry command from outside a session. The commands available are + # those referenced by `Pry.config.commands` (the default command set). + # @param [String] command_string The Pry command (including arguments, + # if any). + # @param [Hash] options Optional named parameters. + # @return [nil] + # @option options [Object, Binding] :target The object to run the + # command under. Defaults to `TOPLEVEL_BINDING` (main). + # @option options [Boolean] :show_output Whether to show command + # output. Defaults to true. + # @example Run at top-level with no output. + # Pry.run_command "ls" + # @example Run under Pry class, returning only public methods. + # Pry.run_command "ls -m", :target => Pry + # @example Display command output. + # Pry.run_command "ls -av", :show_output => true + # + # pkg:gem/pry#lib/pry/pry_class.rb:279 + def run_command(command_string, options = T.unsafe(nil)); end + + # Start a Pry REPL. + # This method also loads `pryrc` as necessary the first time it is invoked. + # @param [Object, Binding] target The receiver of the Pry session + # @param [Hash] options + # @option options (see Pry#initialize) + # @example + # Pry.start(Object.new, :input => MyInput.new) + # + # pkg:gem/pry#lib/pry/pry_class.rb:156 + def start(target = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/pry_class.rb:329 + def toplevel_binding; end + + # pkg:gem/pry#lib/pry/pry_class.rb:347 + def toplevel_binding=(_arg0); end + + # An inspector that clips the output to `max_length` chars. + # In case of > `max_length` chars the `# notation is used. + # + # @param [Object] obj + # The object to view. + # + # @param [Hash] options + # @option options [Integer] :max_length (60) + # The maximum number of chars before clipping occurs. + # + # @option options [Boolean] :id (false) + # Boolean to indicate whether or not a hex representation of the object ID + # is attached to the return value when the length of inspect is greater than + # value of `:max_length`. + # + # @return [String] + # The string representation of `obj`. + # + # pkg:gem/pry#lib/pry/pry_class.rb:227 + def view_clip(obj, options = T.unsafe(nil)); end + + private + + # pkg:gem/pry#lib/pry/pry_class.rb:363 + def mutex_available?; end + end +end + +# @return [Array] Code of the method used when implementing Pry's +# __binding__, along with line indication to be used with instance_eval (and +# friends). +# +# @see Object#__binding__ +# +# pkg:gem/pry#lib/pry/core_extensions.rb:9 +Pry::BINDING_METHOD_IMPL = T.let(T.unsafe(nil), Array) + +# pkg:gem/pry#lib/pry/basic_object.rb:4 +class Pry::BasicObject < ::BasicObject + include ::Kernel +end + +# pkg:gem/pry#lib/pry/basic_object.rb:6 +Pry::BasicObject::Dir = Dir + +# pkg:gem/pry#lib/pry/basic_object.rb:6 +Pry::BasicObject::ENV = T.let(T.unsafe(nil), Object) + +# pkg:gem/pry#lib/pry/basic_object.rb:6 +Pry::BasicObject::File = File + +# pkg:gem/pry#lib/pry/basic_object.rb:6 +Pry::BasicObject::Kernel = Kernel + +# pkg:gem/pry#lib/pry/basic_object.rb:6 +Pry::BasicObject::LoadError = LoadError + +# pkg:gem/pry#lib/pry/basic_object.rb:6 +Pry::BasicObject::Pry = Pry + +# A super-class for Commands that are created with a single block. +# +# This class ensures that the block is called with the correct number of +# arguments and the right context. +# +# Create subclasses using {Pry::CommandSet#command}. +# +# pkg:gem/pry#lib/pry/block_command.rb:10 +class Pry::BlockCommand < ::Pry::Command + # Call the block that was registered with this command. + # @param [Array] args The arguments passed + # @return [Object] The return value of the block + # + # pkg:gem/pry#lib/pry/block_command.rb:14 + def call(*args); end + + # pkg:gem/pry#lib/pry/block_command.rb:18 + def help; end +end + +# Manage the processing of command line options +# +# pkg:gem/pry#lib/pry/cli.rb:7 +class Pry::CLI + class << self + # Add a block responsible for processing parsed options. + # + # pkg:gem/pry#lib/pry/cli.rb:39 + def add_option_processor(&block); end + + # Add another set of CLI options (a Pry::Slop block) + # + # pkg:gem/pry#lib/pry/cli.rb:24 + def add_options(&block); end + + # @return [Array] The input array of strings to process + # as CLI options. + # + # pkg:gem/pry#lib/pry/cli.rb:21 + def input_args; end + + # @return [Array] The input array of strings to process + # as CLI options. + # + # pkg:gem/pry#lib/pry/cli.rb:21 + def input_args=(_arg0); end + + # @return [Array] The Procs that process the parsed options. Plugins can + # utilize this facility in order to add and process their own Pry + # options. + # + # pkg:gem/pry#lib/pry/cli.rb:17 + def option_processors; end + + # @return [Array] The Procs that process the parsed options. Plugins can + # utilize this facility in order to add and process their own Pry + # options. + # + # pkg:gem/pry#lib/pry/cli.rb:17 + def option_processors=(_arg0); end + + # @return [Proc] The Proc defining the valid command line options. + # + # pkg:gem/pry#lib/pry/cli.rb:12 + def options; end + + # @return [Proc] The Proc defining the valid command line options. + # + # pkg:gem/pry#lib/pry/cli.rb:12 + def options=(_arg0); end + + # pkg:gem/pry#lib/pry/cli.rb:52 + def parse_options(args = T.unsafe(nil)); end + + # Clear `options` and `option_processors` + # + # pkg:gem/pry#lib/pry/cli.rb:47 + def reset; end + + # pkg:gem/pry#lib/pry/cli.rb:90 + def start(opts); end + end +end + +# pkg:gem/pry#lib/pry/cli.rb:8 +class Pry::CLI::NoOptionsError < ::StandardError; end + +# A super-class of Commands with structure. +# +# This class implements the bare-minimum functionality that a command should +# have, namely a --help switch, and then delegates actual processing to its +# subclasses. +# +# Create subclasses using {Pry::CommandSet#create_command}, and override the +# `options(opt)` method to set up an instance of Pry::Slop, and the `process` +# method to actually run the command. If necessary, you can also override +# `setup` which will be called before `options`, for example to require any +# gems your command needs to run, or to set up state. +# +# pkg:gem/pry#lib/pry/class_command.rb:15 +class Pry::ClassCommand < ::Pry::Command + # pkg:gem/pry#lib/pry/class_command.rb:64 + def args; end + + # pkg:gem/pry#lib/pry/class_command.rb:64 + def args=(_arg0); end + + # Set up `opts` and `args`, and then call `process`. + # + # This method will display help if necessary. + # + # @param [Array] args The arguments passed + # @return [Object] The return value of `process` or VOID_VALUE + # + # pkg:gem/pry#lib/pry/class_command.rb:72 + def call(*args); end + + # Generate shell completions + # @param [String] search The line typed so far + # @return [Array] the words to complete + # + # pkg:gem/pry#lib/pry/class_command.rb:105 + def complete(search); end + + # Return the help generated by Pry::Slop for this command. + # + # pkg:gem/pry#lib/pry/class_command.rb:87 + def help; end + + # A method to setup Pry::Slop so it can parse the options your command expects. + # + # @note Please don't do anything side-effecty in the main part of this + # method, as it may be called by Pry at any time for introspection reasons. + # If you need to set up default values, use `setup` instead. + # + # @example + # def options(opt) + # opt.banner "Gists methods or classes" + # opt.on(:c, :class, "gist a class") do + # @action = :class + # end + # end + # + # pkg:gem/pry#lib/pry/class_command.rb:171 + def options(opt); end + + # pkg:gem/pry#lib/pry/class_command.rb:63 + def opts; end + + # pkg:gem/pry#lib/pry/class_command.rb:63 + def opts=(_arg0); end + + # The actual body of your command should go here. + # + # The `opts` method can be called to get the options that Pry::Slop has passed, + # and `args` gives the remaining, unparsed arguments. + # + # The return value of this method is discarded unless the command was + # created with `:keep_retval => true`, in which case it is returned to the + # repl. + # + # @example + # def process + # if opts.present?(:class) + # gist_class + # else + # gist_method + # end + # end + # + # pkg:gem/pry#lib/pry/class_command.rb:190 + def process; end + + # A method called just before `options(opt)` as part of `call`. + # + # This method can be used to set up any context your command needs to run, + # for example requiring gems, or setting default values for options. + # + # @example + # def setup + # require 'gist' + # @action = :method + # end + # + # pkg:gem/pry#lib/pry/class_command.rb:121 + def setup; end + + # Return an instance of Pry::Slop that can parse either subcommands or the + # options that this command accepts. + # + # pkg:gem/pry#lib/pry/class_command.rb:93 + def slop; end + + # A method to setup Pry::Slop commands so it can parse the subcommands your + # command expects. If you need to set up default values, use `setup` + # instead. + # + # @example A minimal example + # def subcommands(cmd) + # cmd.command :download do |opt| + # description 'Downloads a content from a server' + # + # opt.on :verbose, 'Use verbose output' + # + # run do |options, arguments| + # ContentDownloader.download(options, arguments) + # end + # end + # end + # + # @example Define the invocation block anywhere you want + # def subcommands(cmd) + # cmd.command :download do |opt| + # description 'Downloads a content from a server' + # + # opt.on :verbose, 'Use verbose output' + # end + # end + # + # def process + # # Perform calculations... + # opts.fetch_command(:download).run do |options, arguments| + # ContentDownloader.download(options, arguments) + # end + # # More calculations... + # end + # + # pkg:gem/pry#lib/pry/class_command.rb:156 + def subcommands(cmd); end + + class << self + # pkg:gem/pry#lib/pry/class_command.rb:29 + def doc; end + + # pkg:gem/pry#lib/pry/class_command.rb:40 + def file; end + + # Ensure that subclasses inherit the options, description and + # match from a ClassCommand super class. + # + # pkg:gem/pry#lib/pry/class_command.rb:19 + def inherited(klass); end + + # pkg:gem/pry#lib/pry/class_command.rb:45 + def line; end + + # pkg:gem/pry#lib/pry/class_command.rb:25 + def source; end + + # pkg:gem/pry#lib/pry/class_command.rb:37 + def source_file; end + + # pkg:gem/pry#lib/pry/class_command.rb:42 + def source_line; end + + # pkg:gem/pry#lib/pry/class_command.rb:33 + def source_location; end + + private + + # The object used to extract the source for the command. + # + # This should be a `Pry::Method(block)` for a command made with `create_command` + # and a `Pry::WrappedModule(self)` for a command that's a standard class. + # @return [Pry::WrappedModule, Pry::Method] + # + # pkg:gem/pry#lib/pry/class_command.rb:54 + def source_object; end + end +end + +# `Pry::Code` is a class that encapsulates lines of source code and their +# line numbers and formats them for terminal output. It can read from a file +# or method definition or be instantiated with a `String` or an `Array`. +# +# In general, the formatting methods in `Code` return a new `Code` object +# which will format the text as specified when `#to_s` is called. This allows +# arbitrary chaining of formatting methods without mutating the original +# object. +# +# pkg:gem/pry#lib/pry/code.rb:32 +class Pry::Code + extend ::MethodSource::CodeHelpers + + # Instantiate a `Code` object containing code from the given `Array`, + # `String`, or `IO`. The first line will be line 1 unless specified + # otherwise. If you need non-contiguous line numbers, you can create an + # empty `Code` object and then use `#push` to insert the lines. + # + # @param [Array, String, IO] lines + # @param [Integer?] start_line + # @param [Symbol?] code_type + # + # pkg:gem/pry#lib/pry/code.rb:87 + def initialize(lines = T.unsafe(nil), start_line = T.unsafe(nil), code_type = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/code.rb:106 + def <<(line); end + + # Two `Code` objects are equal if they contain the same lines with the same + # numbers. Otherwise, call `to_s` and `chomp` and compare as Strings. + # + # @param [Code, Object] other + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/code.rb:325 + def ==(other); end + + # Remove all lines except for the +lines+ after and excluding +lineno+. + # + # @param [Integer] lineno + # @param [Integer] lines + # @return [Code] + # + # pkg:gem/pry#lib/pry/code.rb:195 + def after(lineno, lines = T.unsafe(nil)); end + + # Remove all lines except for the +lines+ on either side of and including + # +lineno+. + # + # @param [Integer] lineno + # @param [Integer] lines + # @return [Code] + # + # pkg:gem/pry#lib/pry/code.rb:182 + def around(lineno, lines = T.unsafe(nil)); end + + # Remove all lines except for the +lines+ up to and excluding +lineno+. + # + # @param [Integer] lineno + # @param [Integer] lines + # @return [Code] + # + # pkg:gem/pry#lib/pry/code.rb:168 + def before(lineno, lines = T.unsafe(nil)); end + + # Remove all lines that aren't in the given range, expressed either as a + # `Range` object or a first and last line number (inclusive). Negative + # indices count from the end of the array of lines. + # + # @param [Range, Integer] start_line + # @param [Integer?] end_line + # @return [Code] + # + # pkg:gem/pry#lib/pry/code.rb:135 + def between(start_line, end_line = T.unsafe(nil)); end + + # @return [Symbol] The type of code stored in this wrapper. + # + # pkg:gem/pry#lib/pry/code.rb:77 + def code_type; end + + # @return [Symbol] The type of code stored in this wrapper. + # + # pkg:gem/pry#lib/pry/code.rb:77 + def code_type=(_arg0); end + + # Get the comment that describes the expression on the given line number. + # + # @param [Integer] line_number (1-based) + # @return [String] the code. + # + # pkg:gem/pry#lib/pry/code.rb:286 + def comment_describing(line_number); end + + # Get the multiline expression that starts on the given line number. + # + # @param [Integer] line_number (1-based) + # @return [String] the code. + # + # pkg:gem/pry#lib/pry/code.rb:294 + def expression_at(line_number, consume = T.unsafe(nil)); end + + # Remove all lines that don't match the given `pattern`. + # + # @param [Regexp] pattern + # @return [Code] + # + # pkg:gem/pry#lib/pry/code.rb:207 + def grep(pattern); end + + # @return [String] a (possibly highlighted) copy of the source code. + # + # pkg:gem/pry#lib/pry/code.rb:263 + def highlighted; end + + # Return the number of lines stored. + # + # @return [Integer] + # + # pkg:gem/pry#lib/pry/code.rb:316 + def length; end + + # @return [Integer] the number of digits in the last line. + # + # pkg:gem/pry#lib/pry/code.rb:252 + def max_lineno_width; end + + # Forward any missing methods to the output of `#to_s`. + # + # pkg:gem/pry#lib/pry/code.rb:335 + def method_missing(method_name, *args, &block); end + + # Get the (approximate) Module.nesting at the give line number. + # + # @param [Integer] line_number line number starting from 1 + # @return [Array] a list of open modules. + # + # pkg:gem/pry#lib/pry/code.rb:302 + def nesting_at(line_number); end + + # Writes a formatted representation (based on the configuration of the + # object) to the given output, which must respond to `#<<`. + # + # pkg:gem/pry#lib/pry/code.rb:269 + def print_to_output(output, color = T.unsafe(nil)); end + + # Append the given line. +lineno+ is one more than the last existing + # line, unless specified otherwise. + # + # @param [String] line + # @return [void] + # + # pkg:gem/pry#lib/pry/code.rb:102 + def push(line); end + + # Return an unformatted String of the code. + # + # @return [String] + # + # pkg:gem/pry#lib/pry/code.rb:309 + def raw; end + + # Filter the lines using the given block. + # + # @yield [LOC] + # @return [Code] + # + # pkg:gem/pry#lib/pry/code.rb:122 + def reject(&block); end + + # Filter the lines using the given block. + # + # @yield [LOC] + # @return [Code] + # + # pkg:gem/pry#lib/pry/code.rb:112 + def select(&block); end + + # Take `num_lines` from `start_line`, forward or backwards. + # + # @param [Integer] start_line + # @param [Integer] num_lines + # @return [Code] + # + # pkg:gem/pry#lib/pry/code.rb:150 + def take_lines(start_line, num_lines); end + + # @return [String] a formatted representation (based on the configuration of + # the object). + # + # pkg:gem/pry#lib/pry/code.rb:258 + def to_s; end + + # Format output with the specified number of spaces in front of every line, + # unless `spaces` is falsy. + # + # @param [Integer?] spaces + # @return [Code] + # + # pkg:gem/pry#lib/pry/code.rb:244 + def with_indentation(spaces = T.unsafe(nil)); end + + # Format output with line numbers next to it, unless `y_n` is falsy. + # + # @param [Boolean?] y_n + # @return [Code] + # + # pkg:gem/pry#lib/pry/code.rb:221 + def with_line_numbers(y_n = T.unsafe(nil)); end + + # Format output with a marker next to the given +lineno+, unless +lineno+ is + # falsy. + # + # @param [Integer?] lineno + # @return [Code] + # + # pkg:gem/pry#lib/pry/code.rb:232 + def with_marker(lineno = T.unsafe(nil)); end + + protected + + # An abstraction of the `dup.instance_eval` pattern used throughout this + # class. + # + # pkg:gem/pry#lib/pry/code.rb:353 + def alter(&block); end + + private + + # Check whether String responds to missing methods. + # + # pkg:gem/pry#lib/pry/code.rb:345 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end + + class << self + # Instantiate a `Code` object containing code loaded from a file or + # Pry's line buffer. + # + # @param [String] filename The name of a file, or "(pry)". + # @param [Symbol] code_type The type of code the file contains. + # @return [Code] + # + # pkg:gem/pry#lib/pry/code.rb:42 + def from_file(filename, code_type = T.unsafe(nil)); end + + # Instantiate a `Code` object containing code extracted from a + # `::Method`, `UnboundMethod`, `Proc`, or `Pry::Method` object. + # + # @param [::Method, UnboundMethod, Proc, Pry::Method] meth The method + # object. + # @param [Integer, nil] start_line The line number to start on, or nil to + # use the method's original line numbers. + # @return [Code] + # + # pkg:gem/pry#lib/pry/code.rb:55 + def from_method(meth, start_line = T.unsafe(nil)); end + + # Attempt to extract the source code for module (or class) `mod`. + # + # @param [Module, Class] mod The module (or class) of interest. + # @param [Integer] candidate_rank The module candidate (by rank) + # to use (see `Pry::WrappedModule::Candidate` for more information). + # @param [Integer, nil] start_line The line number to start on, or nil to + # use the method's original line numbers. + # @return [Code] + # + # pkg:gem/pry#lib/pry/code.rb:69 + def from_module(mod, candidate_rank = T.unsafe(nil), start_line = T.unsafe(nil)); end + end +end + +# Represents a range of lines in a code listing. +# +# @api private +# +# pkg:gem/pry#lib/pry/code/code_range.rb:8 +class Pry::Code::CodeRange + # @param [Integer] start_line + # @param [Integer?] end_line + # + # pkg:gem/pry#lib/pry/code/code_range.rb:11 + def initialize(start_line, end_line = T.unsafe(nil)); end + + # @param [Array] lines + # @return [Range] + # + # pkg:gem/pry#lib/pry/code/code_range.rb:19 + def indices_range(lines); end + + private + + # pkg:gem/pry#lib/pry/code/code_range.rb:27 + def end_line; end + + # @return [Integer] + # + # pkg:gem/pry#lib/pry/code/code_range.rb:57 + def find_end_index(lines); end + + # @return [Integer] + # + # pkg:gem/pry#lib/pry/code/code_range.rb:50 + def find_start_index(lines); end + + # If `end_line` is equal to `nil`, then calculate it from the first + # parameter, `start_line`. Otherwise, leave it as it is. + # @return [void] + # + # pkg:gem/pry#lib/pry/code/code_range.rb:32 + def force_set_end_line; end + + # Finds indices of `start_line` and `end_line` in the given Array of + # +lines+. + # + # @param [Array] lines + # @return [Array] + # + # pkg:gem/pry#lib/pry/code/code_range.rb:45 + def indices(lines); end + + # For example, if the range is 4..10, then `start_line` would be equal to + # 4 and `end_line` to 10. + # @return [void] + # + # pkg:gem/pry#lib/pry/code/code_range.rb:66 + def set_end_line_from_range; end + + # pkg:gem/pry#lib/pry/code/code_range.rb:25 + def start_line; end +end + +# Represents a line of code (which may, in fact, contain multiple lines if +# the entirety was eval'd as a single unit following the `edit` command). +# +# A line of code is a tuple, which consists of a line and a line number. A +# `LOC` object's state (namely, the line parameter) can be changed via +# instance methods. `Pry::Code` heavily uses this class. +# +# @api private +# @example +# loc = LOC.new("def example\n :example\nend", 1) +# puts loc.line +# def example +# :example +# end +# #=> nil +# +# loc.indent(3) +# loc.line #=> " def example\n :example\nend" +# +# pkg:gem/pry#lib/pry/code/loc.rb:23 +class Pry::Code::LOC + # @param [String] line The line of code. + # @param [Integer] lineno The position of the +line+. + # + # pkg:gem/pry#lib/pry/code/loc.rb:29 + def initialize(line, lineno); end + + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/code/loc.rb:34 + def ==(other); end + + # Prepends the line number `lineno` to the `line`. + # + # @param [Integer] max_width + # @return [void] + # + # pkg:gem/pry#lib/pry/code/loc.rb:64 + def add_line_number(max_width = T.unsafe(nil), color = T.unsafe(nil)); end + + # Prepends a marker "=>" or an empty marker to the +line+. + # + # @param [Integer] marker_lineno If it is equal to the `lineno`, then + # prepend a hashrocket. Otherwise, an empty marker. + # @return [void] + # + # pkg:gem/pry#lib/pry/code/loc.rb:81 + def add_marker(marker_lineno); end + + # Paints the `line` of code. + # + # @param [Symbol] code_type + # @return [void] + # + # pkg:gem/pry#lib/pry/code/loc.rb:56 + def colorize(code_type); end + + # pkg:gem/pry#lib/pry/code/loc.rb:38 + def dup; end + + # pkg:gem/pry#lib/pry/code/loc.rb:98 + def handle_multiline_entries_from_edit_command(line, max_width); end + + # Indents the `line` with +distance+ spaces. + # + # @param [Integer] distance + # @return [void] + # + # pkg:gem/pry#lib/pry/code/loc.rb:94 + def indent(distance); end + + # @return [String] + # + # pkg:gem/pry#lib/pry/code/loc.rb:43 + def line; end + + # @return [Integer] + # + # pkg:gem/pry#lib/pry/code/loc.rb:48 + def lineno; end + + # @return [Array] + # + # pkg:gem/pry#lib/pry/code/loc.rb:25 + def tuple; end +end + +# pkg:gem/pry#lib/pry/code/code_file.rb:6 +class Pry::CodeFile + # @param [String] filename The name of a file with code to be detected + # @param [Symbol] code_type The type of code the `filename` contains + # + # pkg:gem/pry#lib/pry/code/code_file.rb:41 + def initialize(filename, code_type = T.unsafe(nil)); end + + # @return [String] The code contained in the current `@filename`. + # + # pkg:gem/pry#lib/pry/code/code_file.rb:47 + def code; end + + # @return [Symbol] The type of code stored in this wrapper. + # + # pkg:gem/pry#lib/pry/code/code_file.rb:37 + def code_type; end + + private + + # @raise [MethodSource::SourceNotFoundError] if the `filename` is not + # readable for some reason. + # @return [String] absolute path for the given `filename`. + # + # pkg:gem/pry#lib/pry/code/code_file.rb:64 + def abs_path; end + + # @return [Array] All the paths that contain code that Pry can use for its + # API's. Skips directories. + # + # pkg:gem/pry#lib/pry/code/code_file.rb:80 + def code_path; end + + # @return [String] + # + # pkg:gem/pry#lib/pry/code/code_file.rb:110 + def from_load_path; end + + # @return [String] + # + # pkg:gem/pry#lib/pry/code/code_file.rb:105 + def from_pry_init_pwd; end + + # @return [String] + # + # pkg:gem/pry#lib/pry/code/code_file.rb:100 + def from_pwd; end + + # @param [String] path + # @return [Boolean] if the path, with or without the default ext, + # is a readable file then `true`, otherwise `false`. + # + # pkg:gem/pry#lib/pry/code/code_file.rb:73 + def readable?(path); end + + # @param [String] filename + # @param [Symbol] default (:unknown) the file type to assume if none could be + # detected. + # @return [Symbol, nil] The SyntaxHighlighter type of a file from its + # extension, or `nil` if `:unknown`. + # + # pkg:gem/pry#lib/pry/code/code_file.rb:89 + def type_from_filename(filename, default = T.unsafe(nil)); end +end + +# pkg:gem/pry#lib/pry/code/code_file.rb:7 +Pry::CodeFile::DEFAULT_EXT = T.let(T.unsafe(nil), String) + +# List of all supported languages. +# @return [Hash] +# +# pkg:gem/pry#lib/pry/code/code_file.rb:11 +Pry::CodeFile::EXTENSIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/pry#lib/pry/code/code_file.rb:28 +Pry::CodeFile::FILES = T.let(T.unsafe(nil), Hash) + +# Store the current working directory. This allows show-source etc. to work if +# your process has changed directory since boot. [Issue #675] +# +# pkg:gem/pry#lib/pry/code/code_file.rb:34 +Pry::CodeFile::INITIAL_PWD = T.let(T.unsafe(nil), String) + +# This class is responsible for taking a string (identifying a +# command/class/method/etc) and returning the relevant type of object. +# For example, if the user looks up "show-source" then a +# `Pry::Command` will be returned. Alternatively, if the user passes in "Pry#repl" then +# a `Pry::Method` object will be returned. +# +# The `CodeObject.lookup` method is responsible for 1. figuring out what kind of +# object the user wants (applying precedence rules in doing so -- i.e methods +# get precedence over commands with the same name) and 2. Returning +# the appropriate object. If the user fails to provide a string +# identifier for the object (i.e they pass in `nil` or "") then the +# object looked up will be the 'current method' or 'current class' +# associated with the Binding. +# +# TODO: This class is a clusterfuck. We need a much more robust +# concept of what a "Code Object" really is. Currently +# commands/classes/candidates/methods and so on just share a very +# ill-defined interface. +# +# pkg:gem/pry#lib/pry/code_object.rb:22 +class Pry::CodeObject + include ::Pry::Helpers::OptionsHelpers + include ::Pry::Helpers::CommandHelpers + + # pkg:gem/pry#lib/pry/code_object.rb:82 + def initialize(str, pry_instance, options = T.unsafe(nil)); end + + # TODO: just make it so find_command_by_match_or_listing doesn't raise? + # + # pkg:gem/pry#lib/pry/code_object.rb:94 + def command_lookup; end + + # lookup variables and constants and `self` that are not modules + # + # pkg:gem/pry#lib/pry/code_object.rb:118 + def default_lookup; end + + # when no parameter is given (i.e CodeObject.lookup(nil)), then we + # lookup the 'current object' from the binding. + # + # pkg:gem/pry#lib/pry/code_object.rb:102 + def empty_lookup; end + + # pkg:gem/pry#lib/pry/code_object.rb:136 + def method_or_class_lookup; end + + # pkg:gem/pry#lib/pry/code_object.rb:79 + def pry_instance; end + + # pkg:gem/pry#lib/pry/code_object.rb:79 + def pry_instance=(_arg0); end + + # pkg:gem/pry#lib/pry/code_object.rb:77 + def str; end + + # pkg:gem/pry#lib/pry/code_object.rb:77 + def str=(_arg0); end + + # pkg:gem/pry#lib/pry/code_object.rb:80 + def super_level; end + + # pkg:gem/pry#lib/pry/code_object.rb:80 + def super_level=(_arg0); end + + # pkg:gem/pry#lib/pry/code_object.rb:78 + def target; end + + # pkg:gem/pry#lib/pry/code_object.rb:78 + def target=(_arg0); end + + private + + # Returns true if `str` looks like a method, i.e Klass#method + # We need to consider this case because method lookups should fall + # through to the `method_or_class_lookup()` method but a + # defined?() on a "Klass#method` string will see the `#` as a + # comment and only evaluate the `Klass` part. + # @param [String] str + # @return [Boolean] Whether the string looks like an instance method. + # + # pkg:gem/pry#lib/pry/code_object.rb:163 + def looks_like_an_instance_method?(str); end + + # grab the nth (`super_level`) super of `obj + # @param [Object] obj + # @param [Fixnum] super_level How far up the super chain to ascend. + # + # pkg:gem/pry#lib/pry/code_object.rb:188 + def lookup_super(obj, super_level); end + + # We use this method to decide whether code is safe to eval. Method's are + # generally not, but everything else is. + # TODO: is just checking != "method" enough?? + # TODO: see duplication of this method in Pry::WrappedModule + # @param [String] str The string to lookup + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/code_object.rb:173 + def safe_to_evaluate?(str); end + + # pkg:gem/pry#lib/pry/code_object.rb:152 + def sourcable_object?(obj); end + + # pkg:gem/pry#lib/pry/code_object.rb:181 + def target_self; end + + class << self + # pkg:gem/pry#lib/pry/code_object.rb:69 + def lookup(str, pry_instance, options = T.unsafe(nil)); end + end +end + +# pkg:gem/pry#lib/pry/code_object.rb:23 +module Pry::CodeObject::Helpers + # pkg:gem/pry#lib/pry/code_object.rb:30 + def c_method?; end + + # @return [Boolean] `true` if this module was defined by means of the C API, + # `false` if it's a Ruby module. + # @note If a module defined by C was extended with a lot of methods written + # in Ruby, this method would fail. + # + # pkg:gem/pry#lib/pry/code_object.rb:46 + def c_module?; end + + # pkg:gem/pry#lib/pry/code_object.rb:38 + def command?; end + + # pkg:gem/pry#lib/pry/code_object.rb:34 + def module_with_yard_docs?; end + + # we need this helper as some Pry::Method objects can wrap Procs + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/code_object.rb:26 + def real_method_object?; end +end + +# PP subclass for streaming inspect output in color. +# +# pkg:gem/pry#lib/pry/color_printer.rb:8 +class Pry::ColorPrinter < ::PP + # pkg:gem/pry#lib/pry/color_printer.rb:25 + def pp(object); end + + # pkg:gem/pry#lib/pry/color_printer.rb:37 + def text(str, max_width = T.unsafe(nil)); end + + private + + # pkg:gem/pry#lib/pry/color_printer.rb:49 + def highlight_object_literal(object_literal); end + + # pkg:gem/pry#lib/pry/color_printer.rb:55 + def inspect_object(object); end + + class << self + # pkg:gem/pry#lib/pry/color_printer.rb:11 + def default(_output, value, pry_instance); end + + # pkg:gem/pry#lib/pry/color_printer.rb:18 + def pp(obj, output = T.unsafe(nil), max_width = T.unsafe(nil)); end + end +end + +# The super-class of all commands, new commands should be created by calling +# {Pry::CommandSet#command} which creates a BlockCommand or +# {Pry::CommandSet#create_command} which creates a ClassCommand. Please don't +# use this class directly. +# N.B. using a regular expression here so that "raise-up 'foo'" does the right thing. +# +# pkg:gem/pry#lib/pry/command.rb:11 +class Pry::Command + include ::Pry::Helpers::BaseHelpers + include ::Pry::Helpers::OptionsHelpers + include ::Pry::Helpers::CommandHelpers + include ::Pry::Helpers::Text + extend ::Pry::Helpers::DocumentationHelpers + extend ::Pry::CodeObject::Helpers + + # Instantiate a command, in preparation for calling it. + # @param [Hash] context The runtime context to use with this command. + # + # pkg:gem/pry#lib/pry/command.rb:230 + def initialize(context = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/command.rb:292 + def _pry_; end + + # pkg:gem/pry#lib/pry/command.rb:218 + def _pry_=(_arg0); end + + # pkg:gem/pry#lib/pry/command.rb:213 + def arg_string; end + + # pkg:gem/pry#lib/pry/command.rb:213 + def arg_string=(_arg0); end + + # pkg:gem/pry#lib/pry/command.rb:253 + def block; end + + # pkg:gem/pry#lib/pry/command.rb:211 + def captures; end + + # pkg:gem/pry#lib/pry/command.rb:211 + def captures=(_arg0); end + + # Display a warning if a command collides with a local/method in + # the current scope. + # + # pkg:gem/pry#lib/pry/command.rb:329 + def check_for_command_collision(command_match, arg_string); end + + # The block we pass *into* a command so long as `:takes_block` is + # not equal to `false` + # @example + # my-command | do + # puts "block content" + # end + # + # pkg:gem/pry#lib/pry/command.rb:226 + def command_block; end + + # The block we pass *into* a command so long as `:takes_block` is + # not equal to `false` + # @example + # my-command | do + # puts "block content" + # end + # + # pkg:gem/pry#lib/pry/command.rb:226 + def command_block=(_arg0); end + + # pkg:gem/pry#lib/pry/command.rb:261 + def command_name; end + + # pkg:gem/pry#lib/pry/command.rb:257 + def command_options; end + + # pkg:gem/pry#lib/pry/command.rb:215 + def command_set; end + + # pkg:gem/pry#lib/pry/command.rb:215 + def command_set=(_arg0); end + + # pkg:gem/pry#lib/pry/command.rb:284 + def commands; end + + # Generate completions for this command + # + # @param [String] _search The line typed so far + # @return [Array] Completion words + # + # pkg:gem/pry#lib/pry/command.rb:411 + def complete(_search); end + + # pkg:gem/pry#lib/pry/command.rb:214 + def context; end + + # pkg:gem/pry#lib/pry/command.rb:214 + def context=(_arg0); end + + # pkg:gem/pry#lib/pry/command.rb:249 + def description; end + + # pkg:gem/pry#lib/pry/command.rb:212 + def eval_string; end + + # pkg:gem/pry#lib/pry/command.rb:212 + def eval_string=(_arg0); end + + # pkg:gem/pry#lib/pry/command.rb:216 + def hooks; end + + # pkg:gem/pry#lib/pry/command.rb:216 + def hooks=(_arg0); end + + # Revaluate the string (str) and perform interpolation. + # @param [String] str The string to reevaluate with interpolation. + # + # @return [String] The reevaluated string with interpolations + # applied (if any). + # + # pkg:gem/pry#lib/pry/command.rb:318 + def interpolate_string(str); end + + # pkg:gem/pry#lib/pry/command.rb:245 + def match; end + + # Make those properties accessible to instances + # + # pkg:gem/pry#lib/pry/command.rb:241 + def name; end + + # Properties of one execution of a command (passed by {Pry#run_command} as a hash of + # context and expanded in `#initialize` + # + # pkg:gem/pry#lib/pry/command.rb:209 + def output; end + + # Properties of one execution of a command (passed by {Pry#run_command} as a hash of + # context and expanded in `#initialize` + # + # pkg:gem/pry#lib/pry/command.rb:209 + def output=(_arg0); end + + # Process a line that Command.matches? this command. + # @param [String] line The line to process + # @return [Object, Command::VOID_VALUE] + # + # pkg:gem/pry#lib/pry/command.rb:394 + def process_line(line); end + + # pkg:gem/pry#lib/pry/command.rb:217 + def pry_instance; end + + # pkg:gem/pry#lib/pry/command.rb:217 + def pry_instance=(_arg0); end + + # Run a command from another command. + # @param [String] command_string The string that invokes the command + # @param [Array] args Further arguments to pass to the command + # @example + # run "show-input" + # @example + # run ".ls" + # @example + # run "amend-line", "5", 'puts "hello world"' + # + # pkg:gem/pry#lib/pry/command.rb:278 + def run(command_string, *args); end + + # pkg:gem/pry#lib/pry/command.rb:265 + def source; end + + # @return [Hash] Pry commands can store arbitrary state + # here. This state persists between subsequent command invocations. + # All state saved here is unique to the command, it does not + # need to be namespaced. + # @example + # state.my_state = "my state" # this will not conflict with any + # # `state.my_state` used in another command. + # + # pkg:gem/pry#lib/pry/command.rb:309 + def state; end + + # pkg:gem/pry#lib/pry/command.rb:210 + def target; end + + # pkg:gem/pry#lib/pry/command.rb:210 + def target=(_arg0); end + + # @return [Object] The value of `self` inside the `target` binding. + # + # pkg:gem/pry#lib/pry/command.rb:298 + def target_self; end + + # Extract necessary information from a line that Command.matches? this + # command. + # + # Returns an array of four elements: + # + # ``` + # [String] the portion of the line that matched with the Command match + # [String] a string of all the arguments (i.e. everything but the match) + # [Array] the captures caught by the command_regex + # [Array] the arguments obtained by splitting the arg_string + # ``` + # + # @param [String] val The line of input + # @return [Array] + # + # pkg:gem/pry#lib/pry/command.rb:356 + def tokenize(val); end + + # pkg:gem/pry#lib/pry/command.rb:288 + def void; end + + private + + # pkg:gem/pry#lib/pry/command.rb:485 + def after_hooks; end + + # pkg:gem/pry#lib/pry/command.rb:481 + def before_hooks; end + + # Run the command with the given `args`. + # + # This is a public wrapper around `#call` which ensures all preconditions + # are met. + # + # @param [Array] args The arguments to pass to this command. + # @return [Object] The return value of the `#call` method, or + # {Command::VOID_VALUE}. + # + # pkg:gem/pry#lib/pry/command.rb:425 + def call_safely(*args); end + + # Run the `#call` method and all the registered hooks. + # @param [Array] args The arguments to `#call` + # @return [Object] The return value from `#call` + # + # pkg:gem/pry#lib/pry/command.rb:492 + def call_with_hooks(*args); end + + # pkg:gem/pry#lib/pry/command.rb:476 + def find_hooks(event); end + + # Normalize method arguments according to its arity. + # + # @param [Integer] method + # @param [Array] args + # @return [Array] a (possibly shorter) array of the arguments to pass + # + # pkg:gem/pry#lib/pry/command.rb:509 + def normalize_method_args(method, args); end + + # Pass a block argument to a command. + # @param [String] arg_string The arguments (as a string) passed to the command. + # We inspect these for a '| do' or a '| {' and if we find it we use it + # to start a block input sequence. Once we have a complete + # block, we save it to an accessor that can be retrieved from the command context. + # Note that if we find the '| do' or '| {' we delete this and the + # elements following it from `arg_string`. + # + # pkg:gem/pry#lib/pry/command.rb:451 + def pass_block(arg_string); end + + # pkg:gem/pry#lib/pry/command.rb:436 + def use_unpatched_symbol; end + + class << self + # Define or get the command's banner + # + # pkg:gem/pry#lib/pry/command.rb:61 + def banner(arg = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/command.rb:66 + def block; end + + # pkg:gem/pry#lib/pry/command.rb:30 + def block=(_arg0); end + + # pkg:gem/pry#lib/pry/command.rb:109 + def command_name; end + + # Define or get the command's options + # + # pkg:gem/pry#lib/pry/command.rb:51 + def command_options(arg = T.unsafe(nil)); end + + # Define or get the command's options + # + # pkg:gem/pry#lib/pry/command.rb:32 + def command_options=(_arg0); end + + # pkg:gem/pry#lib/pry/command.rb:165 + def command_regex; end + + # pkg:gem/pry#lib/pry/command.rb:172 + def convert_to_regex(obj); end + + # pkg:gem/pry#lib/pry/command.rb:89 + def default_options(match); end + + # Define or get the command's description + # + # pkg:gem/pry#lib/pry/command.rb:45 + def description(arg = T.unsafe(nil)); end + + # Define or get the command's description + # + # pkg:gem/pry#lib/pry/command.rb:31 + def description=(_arg0); end + + # pkg:gem/pry#lib/pry/command.rb:75 + def doc; end + + # pkg:gem/pry#lib/pry/command.rb:82 + def file; end + + # The group in which the command should be displayed in "help" output. + # This is usually auto-generated from directory naming, but it can be + # manually overridden if necessary. + # Group should not be changed once it is initialized. + # + # pkg:gem/pry#lib/pry/command.rb:185 + def group(name = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/command.rb:105 + def inspect; end + + # pkg:gem/pry#lib/pry/command.rb:87 + def line; end + + # pkg:gem/pry#lib/pry/command.rb:35 + def match(arg = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/command.rb:33 + def match=(_arg0); end + + # How well does this command match the given line? + # + # Higher scores are better because they imply that this command matches + # the line more closely. + # + # The score is calculated by taking the number of characters at the start + # of the string that are used only to identify the command, not as part of + # the arguments. + # + # @example + # /\.(.*)/.match_score(".foo") #=> 1 + # /\.*(.*)/.match_score("...foo") #=> 3 + # 'hi'.match_score("hi there") #=> 2 + # + # @param [String] val A line input at the REPL + # @return [Fixnum] + # + # pkg:gem/pry#lib/pry/command.rb:153 + def match_score(val); end + + # Should this command be called for the given line? + # @param [String] val A line input at the REPL + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/command.rb:133 + def matches?(val); end + + # pkg:gem/pry#lib/pry/command.rb:101 + def name; end + + # backward compatibility + # + # pkg:gem/pry#lib/pry/command.rb:57 + def options(arg = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/command.rb:58 + def options=(_arg0); end + + # pkg:gem/pry#lib/pry/command.rb:70 + def source; end + + # pkg:gem/pry#lib/pry/command.rb:79 + def source_file; end + + # pkg:gem/pry#lib/pry/command.rb:84 + def source_line; end + + # pkg:gem/pry#lib/pry/command.rb:202 + def state; end + + # Create a new command with the given properties. + # @param [String, Regex] match The thing that triggers this command + # @param [String] description The description to appear in `help` + # @param [Hash] options Behavioral options (see {Pry::CommandSet#command}) + # @param [Module] helpers A module of helper functions to be included. + # @yield optional, used for BlockCommands + # @return [Class] (a subclass of {Pry::Command}) + # + # pkg:gem/pry#lib/pry/command.rb:120 + def subclass(match, description, options, helpers, &block); end + end +end + +# pkg:gem/pry#lib/pry/commands/amend_line.rb:5 +class Pry::Command::AmendLine < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/amend_line.rb:22 + def process; end + + private + + # @return [String] A new string with the amendments applied to it. + # + # pkg:gem/pry#lib/pry/commands/amend_line.rb:33 + def amend_input; end + + # pkg:gem/pry#lib/pry/commands/amend_line.rb:47 + def delete_from_array(array, range); end + + # pkg:gem/pry#lib/pry/commands/amend_line.rb:51 + def insert_into_array(array, range); end + + # @return [Fixnum] The number of lines currently in `eval_string` (the + # input buffer) + # + # pkg:gem/pry#lib/pry/commands/amend_line.rb:62 + def line_count; end + + # The lines (or line) that will be modified by the `amend-line`. + # @return [Range, Fixnum] The lines or line. + # + # pkg:gem/pry#lib/pry/commands/amend_line.rb:90 + def line_range; end + + # pkg:gem/pry#lib/pry/commands/amend_line.rb:56 + def replace_in_array(array, range); end + + # Returns the (one-indexed) start and end lines given by the user. + # The lines in this range will be affected by the `amend-line`. + # Returns `nil` if no lines were specified by the user. + # @return [Array, nil] + # + # pkg:gem/pry#lib/pry/commands/amend_line.rb:70 + def start_and_end_line_number; end + + # Takes two numbers that are 1-indexed, and returns a range (or + # number) that is 0-indexed. 1-indexed means the first element is + # identified by 1 rather than by 0 (as is the case for Ruby arrays). + # @param [Fixnum] start_line_number One-indexed number. + # @param [Fixnum] end_line_number One-indexed number. + # @return [Range] The zero-indexed range. + # + # pkg:gem/pry#lib/pry/commands/amend_line.rb:83 + def zero_indexed_range_from_one_indexed_numbers(start_line_number, end_line_number); end +end + +# pkg:gem/pry#lib/pry/commands/bang.rb:5 +class Pry::Command::Bang < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/bang.rb:16 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/bang_pry.rb:5 +class Pry::Command::BangPry < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/bang_pry.rb:14 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/cat.rb:5 +class Pry::Command::Cat < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/cat.rb:53 + def complete(search); end + + # pkg:gem/pry#lib/pry/commands/cat.rb:57 + def load_path_completions; end + + # pkg:gem/pry#lib/pry/commands/cat.rb:23 + def options(opt); end + + # pkg:gem/pry#lib/pry/commands/cat.rb:38 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/cat/abstract_formatter.rb:6 +class Pry::Command::Cat::AbstractFormatter + include ::Pry::Helpers::OptionsHelpers + include ::Pry::Helpers::CommandHelpers + include ::Pry::Helpers::BaseHelpers + + private + + # pkg:gem/pry#lib/pry/commands/cat/abstract_formatter.rb:26 + def between_lines; end + + # pkg:gem/pry#lib/pry/commands/cat/abstract_formatter.rb:18 + def code_type; end + + # pkg:gem/pry#lib/pry/commands/cat/abstract_formatter.rb:12 + def decorate(content); end + + # pkg:gem/pry#lib/pry/commands/cat/abstract_formatter.rb:22 + def use_line_numbers?; end +end + +# pkg:gem/pry#lib/pry/commands/cat/exception_formatter.rb:6 +class Pry::Command::Cat::ExceptionFormatter < ::Pry::Command::Cat::AbstractFormatter + include ::Pry::Helpers::Text + + # pkg:gem/pry#lib/pry/commands/cat/exception_formatter.rb:12 + def initialize(exception, pry_instance, opts); end + + # pkg:gem/pry#lib/pry/commands/cat/exception_formatter.rb:7 + def ex; end + + # pkg:gem/pry#lib/pry/commands/cat/exception_formatter.rb:18 + def format; end + + # pkg:gem/pry#lib/pry/commands/cat/exception_formatter.rb:8 + def opts; end + + # pkg:gem/pry#lib/pry/commands/cat/exception_formatter.rb:9 + def pry_instance; end + + private + + # pkg:gem/pry#lib/pry/commands/cat/exception_formatter.rb:56 + def backtrace_file; end + + # pkg:gem/pry#lib/pry/commands/cat/exception_formatter.rb:37 + def backtrace_level; end + + # pkg:gem/pry#lib/pry/commands/cat/exception_formatter.rb:60 + def backtrace_line; end + + # pkg:gem/pry#lib/pry/commands/cat/exception_formatter.rb:64 + def check_for_errors; end + + # pkg:gem/pry#lib/pry/commands/cat/exception_formatter.rb:33 + def code_window_size; end + + # pkg:gem/pry#lib/pry/commands/cat/exception_formatter.rb:78 + def header; end + + # pkg:gem/pry#lib/pry/commands/cat/exception_formatter.rb:52 + def increment_backtrace_level; end + + # pkg:gem/pry#lib/pry/commands/cat/exception_formatter.rb:71 + def start_and_end_line_for_code_window; end +end + +# pkg:gem/pry#lib/pry/commands/cat/file_formatter.rb:6 +class Pry::Command::Cat::FileFormatter < ::Pry::Command::Cat::AbstractFormatter + # pkg:gem/pry#lib/pry/commands/cat/file_formatter.rb:11 + def initialize(file_with_embedded_line, pry_instance, opts); end + + # pkg:gem/pry#lib/pry/commands/cat/file_formatter.rb:27 + def file_and_line; end + + # pkg:gem/pry#lib/pry/commands/cat/file_formatter.rb:7 + def file_with_embedded_line; end + + # pkg:gem/pry#lib/pry/commands/cat/file_formatter.rb:22 + def format; end + + # pkg:gem/pry#lib/pry/commands/cat/file_formatter.rb:8 + def opts; end + + # pkg:gem/pry#lib/pry/commands/cat/file_formatter.rb:9 + def pry_instance; end + + private + + # pkg:gem/pry#lib/pry/commands/cat/file_formatter.rb:55 + def code_type; end + + # pkg:gem/pry#lib/pry/commands/cat/file_formatter.rb:43 + def code_window_size; end + + # pkg:gem/pry#lib/pry/commands/cat/file_formatter.rb:47 + def decorate(content); end + + # pkg:gem/pry#lib/pry/commands/cat/file_formatter.rb:59 + def detect_code_type_from_file(file_name); end + + # pkg:gem/pry#lib/pry/commands/cat/file_formatter.rb:35 + def file_name; end + + # pkg:gem/pry#lib/pry/commands/cat/file_formatter.rb:39 + def line_number; end +end + +# pkg:gem/pry#lib/pry/commands/cat/input_expression_formatter.rb:6 +class Pry::Command::Cat::InputExpressionFormatter < ::Pry::Command::Cat::AbstractFormatter + # pkg:gem/pry#lib/pry/commands/cat/input_expression_formatter.rb:10 + def initialize(input_expressions, opts); end + + # pkg:gem/pry#lib/pry/commands/cat/input_expression_formatter.rb:15 + def format; end + + # pkg:gem/pry#lib/pry/commands/cat/input_expression_formatter.rb:7 + def input_expressions; end + + # pkg:gem/pry#lib/pry/commands/cat/input_expression_formatter.rb:7 + def input_expressions=(_arg0); end + + # pkg:gem/pry#lib/pry/commands/cat/input_expression_formatter.rb:8 + def opts; end + + # pkg:gem/pry#lib/pry/commands/cat/input_expression_formatter.rb:8 + def opts=(_arg0); end + + private + + # pkg:gem/pry#lib/pry/commands/cat/input_expression_formatter.rb:42 + def normalized_expression_range; end + + # pkg:gem/pry#lib/pry/commands/cat/input_expression_formatter.rb:37 + def numbered_input_items; end + + # pkg:gem/pry#lib/pry/commands/cat/input_expression_formatter.rb:33 + def selected_input_items; end +end + +# pkg:gem/pry#lib/pry/commands/cd.rb:5 +class Pry::Command::Cd < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/cd.rb:27 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/change_inspector.rb:5 +class Pry::Command::ChangeInspector < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/change_inspector.rb:17 + def process(inspector); end + + private + + # pkg:gem/pry#lib/pry/commands/change_inspector.rb:28 + def inspector_map; end +end + +# pkg:gem/pry#lib/pry/commands/change_prompt.rb:5 +class Pry::Command::ChangePrompt < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/change_prompt.rb:16 + def options(opt); end + + # pkg:gem/pry#lib/pry/commands/change_prompt.rb:20 + def process(prompt); end + + private + + # pkg:gem/pry#lib/pry/commands/change_prompt.rb:38 + def change_prompt(prompt); end + + # pkg:gem/pry#lib/pry/commands/change_prompt.rb:30 + def list_prompts; end +end + +# pkg:gem/pry#lib/pry/commands/clear_screen.rb:5 +class Pry::Command::ClearScreen < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/clear_screen.rb:10 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/code_collector.rb:5 +class Pry::Command::CodeCollector + include ::Pry::Helpers::OptionsHelpers + include ::Pry::Helpers::CommandHelpers + + # pkg:gem/pry#lib/pry/commands/code_collector.rb:23 + def initialize(args, opts, pry_instance); end + + # pkg:gem/pry#lib/pry/commands/code_collector.rb:8 + def args; end + + # The code object + # + # @return [Pry::WrappedModule, Pry::Method, Pry::Command] + # + # pkg:gem/pry#lib/pry/commands/code_collector.rb:86 + def code_object; end + + # The content (i.e code/docs) for the selected object. + # If the user provided a bare code object, it returns the source. + # If the user provided the `-i` or `-o` switches, it returns the + # selected input/output lines joined as a string. If the user used + # `-d CODE_OBJECT` it returns the docs for that code object. + # + # @return [String] + # + # pkg:gem/pry#lib/pry/commands/code_collector.rb:60 + def content; end + + # The name of the explicitly given file (if any). + # + # pkg:gem/pry#lib/pry/commands/code_collector.rb:13 + def file; end + + # The name of the explicitly given file (if any). + # + # pkg:gem/pry#lib/pry/commands/code_collector.rb:13 + def file=(_arg0); end + + # The line range passed to `--lines`, converted to a 0-indexed range. + # + # pkg:gem/pry#lib/pry/commands/code_collector.rb:123 + def line_range; end + + # Name of the object argument + # + # pkg:gem/pry#lib/pry/commands/code_collector.rb:128 + def obj_name; end + + # pkg:gem/pry#lib/pry/commands/code_collector.rb:9 + def opts; end + + # The selected `pry_instance.input_ring` as a string, as specified by + # the `-i` switch. + # + # @return [String] + # + # pkg:gem/pry#lib/pry/commands/code_collector.rb:116 + def pry_input_content; end + + # pkg:gem/pry#lib/pry/commands/code_collector.rb:10 + def pry_instance; end + + # The selected `pry_instance.output_ring` as a string, as specified by + # the `-o` switch. + # + # @return [String] + # + # pkg:gem/pry#lib/pry/commands/code_collector.rb:104 + def pry_output_content; end + + # Given a string and a range, return the `range` lines of that + # string. + # + # @param [String] content + # @param [Range, Fixnum] range + # @return [String] The string restricted to the given range + # + # pkg:gem/pry#lib/pry/commands/code_collector.rb:96 + def restrict_to_lines(content, range); end + + private + + # pkg:gem/pry#lib/pry/commands/code_collector.rb:134 + def bad_option_combination?; end + + # pkg:gem/pry#lib/pry/commands/code_collector.rb:153 + def code_object_doc; end + + # pkg:gem/pry#lib/pry/commands/code_collector.rb:157 + def code_object_source_or_file; end + + # pkg:gem/pry#lib/pry/commands/code_collector.rb:175 + def convert_to_range(range); end + + # pkg:gem/pry#lib/pry/commands/code_collector.rb:171 + def could_not_locate(name); end + + # pkg:gem/pry#lib/pry/commands/code_collector.rb:161 + def file_content; end + + # pkg:gem/pry#lib/pry/commands/code_collector.rb:139 + def pry_array_content_as_string(array, ranges); end + + class << self + # Add the `--lines`, `-o`, `-i`, `-s`, `-d` options. + # + # pkg:gem/pry#lib/pry/commands/code_collector.rb:30 + def inject_options(opt); end + + # pkg:gem/pry#lib/pry/commands/code_collector.rb:16 + def input_expression_ranges; end + + # pkg:gem/pry#lib/pry/commands/code_collector.rb:16 + def input_expression_ranges=(_arg0); end + + # pkg:gem/pry#lib/pry/commands/code_collector.rb:17 + def output_result_ranges; end + + # pkg:gem/pry#lib/pry/commands/code_collector.rb:17 + def output_result_ranges=(_arg0); end + end +end + +# pkg:gem/pry#lib/pry/commands/disable_pry.rb:5 +class Pry::Command::DisablePry < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/disable_pry.rb:23 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/edit.rb:5 +class Pry::Command::Edit < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/edit.rb:91 + def apply_runtime_patch; end + + # pkg:gem/pry#lib/pry/commands/edit.rb:174 + def bad_option_combination?; end + + # pkg:gem/pry#lib/pry/commands/edit.rb:154 + def code_object; end + + # pkg:gem/pry#lib/pry/commands/edit.rb:107 + def ensure_file_name_is_valid(file_name); end + + # pkg:gem/pry#lib/pry/commands/edit.rb:121 + def file_and_line; end + + # pkg:gem/pry#lib/pry/commands/edit.rb:117 + def file_and_line_for_current_exception; end + + # pkg:gem/pry#lib/pry/commands/edit.rb:80 + def file_based_exception?; end + + # pkg:gem/pry#lib/pry/commands/edit.rb:137 + def file_edit; end + + # pkg:gem/pry#lib/pry/commands/edit.rb:150 + def filename_argument; end + + # pkg:gem/pry#lib/pry/commands/edit.rb:205 + def initial_temp_file_content; end + + # pkg:gem/pry#lib/pry/commands/edit.rb:182 + def input_expression; end + + # pkg:gem/pry#lib/pry/commands/edit.rb:197 + def never_reload?; end + + # pkg:gem/pry#lib/pry/commands/edit.rb:27 + def options(opt); end + + # pkg:gem/pry#lib/pry/commands/edit.rb:170 + def patch_exception?; end + + # pkg:gem/pry#lib/pry/commands/edit.rb:165 + def previously_patched?(code_object); end + + # pkg:gem/pry#lib/pry/commands/edit.rb:217 + def probably_a_file?(str); end + + # pkg:gem/pry#lib/pry/commands/edit.rb:48 + def process; end + + # pkg:gem/pry#lib/pry/commands/edit.rb:160 + def pry_method?(code_object); end + + # pkg:gem/pry#lib/pry/commands/edit.rb:201 + def reload?(file_name = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/commands/edit.rb:193 + def reloadable?; end + + # pkg:gem/pry#lib/pry/commands/edit.rb:71 + def repl_edit; end + + # pkg:gem/pry#lib/pry/commands/edit.rb:66 + def repl_edit?; end + + # pkg:gem/pry#lib/pry/commands/edit.rb:84 + def runtime_patch?; end +end + +# pkg:gem/pry#lib/pry/commands/edit/exception_patcher.rb:6 +class Pry::Command::Edit::ExceptionPatcher + # pkg:gem/pry#lib/pry/commands/edit/exception_patcher.rb:11 + def initialize(pry_instance, state, exception_file_and_line); end + + # pkg:gem/pry#lib/pry/commands/edit/exception_patcher.rb:9 + def file_and_line; end + + # pkg:gem/pry#lib/pry/commands/edit/exception_patcher.rb:9 + def file_and_line=(_arg0); end + + # perform the patch + # + # pkg:gem/pry#lib/pry/commands/edit/exception_patcher.rb:18 + def perform_patch; end + + # pkg:gem/pry#lib/pry/commands/edit/exception_patcher.rb:7 + def pry_instance; end + + # pkg:gem/pry#lib/pry/commands/edit/exception_patcher.rb:7 + def pry_instance=(_arg0); end + + # pkg:gem/pry#lib/pry/commands/edit/exception_patcher.rb:8 + def state; end + + # pkg:gem/pry#lib/pry/commands/edit/exception_patcher.rb:8 + def state=(_arg0); end +end + +# pkg:gem/pry#lib/pry/commands/edit/file_and_line_locator.rb:6 +module Pry::Command::Edit::FileAndLineLocator + class << self + # pkg:gem/pry#lib/pry/commands/edit/file_and_line_locator.rb:8 + def from_binding(target); end + + # pkg:gem/pry#lib/pry/commands/edit/file_and_line_locator.rb:16 + def from_code_object(code_object, filename_argument); end + + # pkg:gem/pry#lib/pry/commands/edit/file_and_line_locator.rb:24 + def from_exception(exception, backtrace_level); end + + # when file and line are passed as a single arg, e.g my_file.rb:30 + # + # pkg:gem/pry#lib/pry/commands/edit/file_and_line_locator.rb:38 + def from_filename_argument(filename_argument); end + end +end + +# pkg:gem/pry#lib/pry/commands/exit.rb:5 +class Pry::Command::Exit < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/exit.rb:25 + def process; end + + # pkg:gem/pry#lib/pry/commands/exit.rb:34 + def process_pop_and_return; end +end + +# pkg:gem/pry#lib/pry/commands/exit_all.rb:5 +class Pry::Command::ExitAll < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/exit_all.rb:18 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/exit_program.rb:5 +class Pry::Command::ExitProgram < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/exit_program.rb:18 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/find_method.rb:5 +class Pry::Command::FindMethod < ::Pry::ClassCommand + extend ::Pry::Helpers::BaseHelpers + + # pkg:gem/pry#lib/pry/commands/find_method.rb:31 + def options(opt); end + + # pkg:gem/pry#lib/pry/commands/find_method.rb:36 + def process; end + + private + + # Return the matched lines of method source if `-c` is given or "" + # if `-c` was not given + # + # pkg:gem/pry#lib/pry/commands/find_method.rb:100 + def additional_info(header, method); end + + # Search for all methods who's implementation matches the given regex + # within a namespace. + # + # @param [Module] namespace The namespace to search + # @return [Array] + # + # pkg:gem/pry#lib/pry/commands/find_method.rb:186 + def content_search(namespace); end + + # pkg:gem/pry#lib/pry/commands/find_method.rb:108 + def matched_method_lines(header, method); end + + # Search for all methods with a name that matches the given regex + # within a namespace. + # + # @param [Module] namespace The namespace to search + # @return [Array] + # + # pkg:gem/pry#lib/pry/commands/find_method.rb:174 + def name_search(namespace); end + + # @return [Regexp] The pattern to search for. + # + # pkg:gem/pry#lib/pry/commands/find_method.rb:48 + def pattern; end + + # pretty-print a list of matching methods. + # + # @param [Array] matches + # + # pkg:gem/pry#lib/pry/commands/find_method.rb:80 + def print_matches(matches); end + + # Print matched methods for a class + # + # pkg:gem/pry#lib/pry/commands/find_method.rb:90 + def print_matches_for_class(klass, grouped); end + + # Run the given block against every constant in the provided namespace. + # + # @param [Module] klass The namespace in which to start the search. + # @param [Hash] done The namespaces we've already visited (private) + # @yieldparam klass Each class/module in the namespace. + # + # pkg:gem/pry#lib/pry/commands/find_method.rb:120 + def recurse_namespace(klass, done = T.unsafe(nil), &block); end + + # Gather all the methods in a namespace that pass the given block. + # + # @param [Module] namespace The namespace in which to search. + # @yieldparam [Method] method The method to test + # @yieldreturn [Boolean] + # @return [Array] + # + # pkg:gem/pry#lib/pry/commands/find_method.rb:150 + def search_all_methods(namespace); end + + # The class to search for methods. + # We only search classes, so if the search object is an + # instance, return its class. If no search object is given + # search `target_self`. + # + # pkg:gem/pry#lib/pry/commands/find_method.rb:67 + def search_class; end + + # Output the result of the search. + # + # @param [Array] matches + # + # pkg:gem/pry#lib/pry/commands/find_method.rb:55 + def show_search_results(matches); end +end + +# pkg:gem/pry#lib/pry/commands/fix_indent.rb:5 +class Pry::Command::FixIndent < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/fix_indent.rb:15 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/help.rb:5 +class Pry::Command::Help < ::Pry::ClassCommand + # Get a hash of available commands grouped by the "group" name. + # + # pkg:gem/pry#lib/pry/commands/help.rb:29 + def command_groups; end + + # Display help for an individual command. + # + # @param [Pry::Command] command + # + # pkg:gem/pry#lib/pry/commands/help.rb:125 + def display_command(command); end + + # Display help for a searched item, filtered by group + # + # @param [String] search The string to search for. + # + # pkg:gem/pry#lib/pry/commands/help.rb:111 + def display_filtered_commands(search); end + + # Display help for a searched item, filtered first by group + # and if that fails, filtered by command name. + # + # @param [String] search The string to search for. + # + # pkg:gem/pry#lib/pry/commands/help.rb:98 + def display_filtered_search_results(search); end + + # Display the index view, with headings and short descriptions per command. + # + # @param [Hash>] groups + # + # pkg:gem/pry#lib/pry/commands/help.rb:44 + def display_index(groups); end + + # Display help for an individual command or group. + # + # @param [String] search The string to search for. + # + # pkg:gem/pry#lib/pry/commands/help.rb:86 + def display_search(search); end + + # pkg:gem/pry#lib/pry/commands/help.rb:159 + def group_sort_key(group_name); end + + # Given a group name and an array of commands, + # return the help string for those commands. + # + # @param [String] name The group name. + # @param [Array] commands + # @return [String] The generated help string. + # + # pkg:gem/pry#lib/pry/commands/help.rb:62 + def help_text_for_commands(name, commands); end + + # Clean search terms to make it easier to search group names + # + # @param [String] key + # @return [String] + # + # pkg:gem/pry#lib/pry/commands/help.rb:155 + def normalize(key); end + + # pkg:gem/pry#lib/pry/commands/help.rb:33 + def process; end + + # Find a subset of a hash that matches the user's search term. + # + # If there's an exact match a Hash of one element will be returned, + # otherwise a sub-Hash with every key that matches the search will + # be returned. + # + # @param [String] search the search term + # @param [Hash] hash the hash to search + # + # pkg:gem/pry#lib/pry/commands/help.rb:137 + def search_hash(search, hash); end + + # Sort an array of commands by their `listing` name. + # + # @param [Array] commands The commands to sort + # @return [Array] commands sorted by listing name. + # + # pkg:gem/pry#lib/pry/commands/help.rb:79 + def sorted_commands(commands); end + + # @param [Hash] groups + # @return [Array] An array of sorted group names. + # + # pkg:gem/pry#lib/pry/commands/help.rb:71 + def sorted_group_names(groups); end + + # We only want to show commands that have descriptions, so that the + # easter eggs don't show up. + # + # pkg:gem/pry#lib/pry/commands/help.rb:20 + def visible_commands; end +end + +# pkg:gem/pry#lib/pry/commands/hist.rb:5 +class Pry::Command::Hist < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/hist.rb:25 + def options(opt); end + + # pkg:gem/pry#lib/pry/commands/hist.rb:43 + def process; end + + private + + # Checks +replay_sequence+ for the presence of neighboring replay calls. + # @example + # [1] pry(main)> hist --show 46894 + # 46894: hist --replay 46675..46677 + # [2] pry(main)> hist --show 46675..46677 + # 46675: 1+1 + # 46676: a = 100 + # 46677: hist --tail + # [3] pry(main)> hist --replay 46894 + # Error: Replay index 46894 points out to another replay call: + # `hist -r 46675..46677` + # [4] pry(main)> + # + # @raise [Pry::CommandError] If +replay_sequence+ contains another + # "hist --replay" call + # @param [String] replay_sequence The sequence of commands to be replayed + # (per saltum) + # @return [Boolean] `false` if +replay_sequence+ does not contain another + # "hist --replay" call + # + # pkg:gem/pry#lib/pry/commands/hist.rb:143 + def check_for_juxtaposed_replay(replay_sequence); end + + # Finds history depending on the given switch. + # + # @return [Pry::Code] if it finds `--all` (or `-a`) switch, returns all + # entries in history. Without the switch returns only the entries from the + # current Pry session. + # + # pkg:gem/pry#lib/pry/commands/hist.rb:168 + def find_history; end + + # pkg:gem/pry#lib/pry/commands/hist.rb:105 + def process_clear; end + + # pkg:gem/pry#lib/pry/commands/hist.rb:78 + def process_display; end + + # pkg:gem/pry#lib/pry/commands/hist.rb:110 + def process_replay; end + + # pkg:gem/pry#lib/pry/commands/hist.rb:86 + def process_save; end +end + +# pkg:gem/pry#lib/pry/commands/import_set.rb:5 +class Pry::Command::ImportSet < ::Pry::ClassCommand + # TODO: resolve unused parameter. + # + # pkg:gem/pry#lib/pry/commands/import_set.rb:17 + def process(_command_set_name); end +end + +# pkg:gem/pry#lib/pry/commands/jump_to.rb:5 +class Pry::Command::JumpTo < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/jump_to.rb:14 + def process(break_level); end +end + +# pkg:gem/pry#lib/pry/commands/list_inspectors.rb:5 +class Pry::Command::ListInspectors < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/list_inspectors.rb:16 + def process; end + + private + + # pkg:gem/pry#lib/pry/commands/list_inspectors.rb:28 + def inspector_map; end + + # pkg:gem/pry#lib/pry/commands/list_inspectors.rb:36 + def selected_inspector?(inspector); end + + # pkg:gem/pry#lib/pry/commands/list_inspectors.rb:32 + def selected_text; end +end + +# pkg:gem/pry#lib/pry/commands/ls/config.rb:7 +class Pry::Command::Ls < ::Pry::ClassCommand + # Exclude -q, -v and --grep because they, + # don't specify what the user wants to see. + # + # pkg:gem/pry#lib/pry/commands/ls.rb:64 + def no_user_opts?; end + + # pkg:gem/pry#lib/pry/commands/ls.rb:31 + def options(opt); end + + # pkg:gem/pry#lib/pry/commands/ls.rb:69 + def process; end + + private + + # pkg:gem/pry#lib/pry/commands/ls.rb:85 + def error_list; end + + # pkg:gem/pry#lib/pry/commands/ls.rb:105 + def raise_errors_if_arguments_are_weird; end +end + +# pkg:gem/pry#lib/pry/commands/ls/config.rb:8 +class Pry::Command::Ls::Config + extend ::Forwardable + extend ::Pry::Forwardable + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:44 + def initialize(config); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:42 + def [](*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:42 + def []=(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def builtin_global_color; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def builtin_global_color=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def ceiling; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def ceiling=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def class_constant_color; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def class_constant_color=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def class_var_color; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def class_var_color=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def constant_color; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def constant_color=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:42 + def each(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:42 + def each_pair(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def exception_constant_color; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def exception_constant_color=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def global_var_color; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def global_var_color=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def heading_color; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def heading_color=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def instance_var_color; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def instance_var_color=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:42 + def keys(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def local_var_color; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def local_var_color=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def method_missing_color; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def method_missing_color=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def private_method_color; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def private_method_color=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def protected_method_color; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def protected_method_color=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def pry_var_color; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def pry_var_color=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def pseudo_global_color; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def pseudo_global_color=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def public_method_color; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def public_method_color=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def separator; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def separator=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:42 + def to_a(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:33 + def unloaded_constant_color; end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:37 + def unloaded_constant_color=(value); end + + # pkg:gem/pry#lib/pry/commands/ls/config.rb:42 + def values(*args, **_arg1, &block); end + + class << self + # pkg:gem/pry#lib/pry/commands/ls/config.rb:48 + def default; end + end +end + +# pkg:gem/pry#lib/pry/commands/ls/config.rb:11 +Pry::Command::Ls::Config::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/pry#lib/pry/commands/ls/constants.rb:6 +class Pry::Command::Ls::Constants < ::Pry::Command::Ls::Formatter + include ::Pry::Command::Ls::Interrogatable + + # pkg:gem/pry#lib/pry/commands/ls/constants.rb:14 + def initialize(interrogatee, no_user_opts, opts, pry_instance); end + + # pkg:gem/pry#lib/pry/commands/ls/constants.rb:23 + def correct_opts?; end + + # pkg:gem/pry#lib/pry/commands/ls/constants.rb:27 + def output_self; end + + private + + # pkg:gem/pry#lib/pry/commands/ls/constants.rb:39 + def format(mod, constants); end + + # pkg:gem/pry#lib/pry/commands/ls/constants.rb:35 + def show_deprecated_constants?; end +end + +# pkg:gem/pry#lib/pry/commands/ls/constants.rb:7 +Pry::Command::Ls::Constants::DEPRECATED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/pry#lib/pry/commands/ls/formatter.rb:6 +class Pry::Command::Ls::Formatter + # pkg:gem/pry#lib/pry/commands/ls/formatter.rb:10 + def initialize(pry_instance); end + + # pkg:gem/pry#lib/pry/commands/ls/formatter.rb:7 + def grep=(_arg0); end + + # pkg:gem/pry#lib/pry/commands/ls/formatter.rb:8 + def pry_instance; end + + # pkg:gem/pry#lib/pry/commands/ls/formatter.rb:16 + def write_out; end + + private + + # pkg:gem/pry#lib/pry/commands/ls/formatter.rb:24 + def color(type, str); end + + # pkg:gem/pry#lib/pry/commands/ls/formatter.rb:41 + def correct_opts?; end + + # pkg:gem/pry#lib/pry/commands/ls/formatter.rb:37 + def format_value(value); end + + # pkg:gem/pry#lib/pry/commands/ls/formatter.rb:49 + def grep; end + + # Add a new section to the output. + # Outputs nothing if the section would be empty. + # + # pkg:gem/pry#lib/pry/commands/ls/formatter.rb:30 + def output_section(heading, body); end + + # pkg:gem/pry#lib/pry/commands/ls/formatter.rb:45 + def output_self; end +end + +# pkg:gem/pry#lib/pry/commands/ls/globals.rb:6 +class Pry::Command::Ls::Globals < ::Pry::Command::Ls::Formatter + # pkg:gem/pry#lib/pry/commands/ls/globals.rb:24 + def initialize(opts, pry_instance); end + + # pkg:gem/pry#lib/pry/commands/ls/globals.rb:29 + def output_self; end + + private + + # pkg:gem/pry#lib/pry/commands/ls/globals.rb:36 + def format(globals); end +end + +# Taken from "puts global_variables.inspect". +# +# pkg:gem/pry#lib/pry/commands/ls/globals.rb:8 +Pry::Command::Ls::Globals::BUILTIN_GLOBALS = T.let(T.unsafe(nil), Array) + +# `$SAFE` and `$?` are thread-local, the exception stuff only works in a +# rescue clause, everything else is basically a local variable with a `$` +# in its name. +# +# pkg:gem/pry#lib/pry/commands/ls/globals.rb:19 +Pry::Command::Ls::Globals::PSEUDO_GLOBALS = T.let(T.unsafe(nil), Array) + +# pkg:gem/pry#lib/pry/commands/ls/grep.rb:6 +class Pry::Command::Ls::Grep + # pkg:gem/pry#lib/pry/commands/ls/grep.rb:7 + def initialize(grep_regexp); end + + # pkg:gem/pry#lib/pry/commands/ls/grep.rb:11 + def regexp; end +end + +# pkg:gem/pry#lib/pry/commands/ls/instance_vars.rb:6 +class Pry::Command::Ls::InstanceVars < ::Pry::Command::Ls::Formatter + include ::Pry::Command::Ls::Interrogatable + + # pkg:gem/pry#lib/pry/commands/ls/instance_vars.rb:9 + def initialize(interrogatee, no_user_opts, opts, pry_instance); end + + # pkg:gem/pry#lib/pry/commands/ls/instance_vars.rb:16 + def correct_opts?; end + + # pkg:gem/pry#lib/pry/commands/ls/instance_vars.rb:20 + def output_self; end + + private + + # pkg:gem/pry#lib/pry/commands/ls/instance_vars.rb:34 + def format(type, vars); end +end + +# pkg:gem/pry#lib/pry/commands/ls/interrogatable.rb:6 +module Pry::Command::Ls::Interrogatable + private + + # pkg:gem/pry#lib/pry/commands/ls/interrogatable.rb:13 + def interrogatee_mod; end + + # pkg:gem/pry#lib/pry/commands/ls/interrogatable.rb:9 + def interrogating_a_module?; end +end + +# pkg:gem/pry#lib/pry/commands/ls/jruby_hacks.rb:6 +module Pry::Command::Ls::JRubyHacks + private + + # When removing jruby aliases, we want to keep the alias that is + # "least rubbish" according to this metric. + # + # pkg:gem/pry#lib/pry/commands/ls/jruby_hacks.rb:40 + def rubbishness(name); end + + # JRuby creates lots of aliases for methods imported from java in an attempt + # to make life easier for ruby programmers. (e.g. getFooBar becomes + # get_foo_bar and foo_bar, and maybe foo_bar? if it returns a Boolean). The + # full transformations are in the assignAliases method of: + # https://github.com/jruby/jruby/blob/master/src/org/jruby/javasupport/JavaClass.java + # + # This has the unfortunate side-effect of making the output of ls even more + # incredibly verbose than it normally would be for these objects; and so we + # filter out all but the nicest of these aliases here. + # + # TODO: This is a little bit vague, better heuristics could be used. + # JRuby also has a lot of scala-specific logic, which we don't copy. + # + # pkg:gem/pry#lib/pry/commands/ls/jruby_hacks.rb:21 + def trim_jruby_aliases(methods); end +end + +# pkg:gem/pry#lib/pry/commands/ls/local_names.rb:6 +class Pry::Command::Ls::LocalNames < ::Pry::Command::Ls::Formatter + # pkg:gem/pry#lib/pry/commands/ls/local_names.rb:7 + def initialize(no_user_opts, args, pry_instance); end + + # pkg:gem/pry#lib/pry/commands/ls/local_names.rb:14 + def correct_opts?; end + + # pkg:gem/pry#lib/pry/commands/ls/local_names.rb:18 + def output_self; end + + private + + # pkg:gem/pry#lib/pry/commands/ls/local_names.rb:25 + def format(locals); end +end + +# pkg:gem/pry#lib/pry/commands/ls/local_vars.rb:6 +class Pry::Command::Ls::LocalVars < ::Pry::Command::Ls::Formatter + # pkg:gem/pry#lib/pry/commands/ls/local_vars.rb:7 + def initialize(opts, pry_instance); end + + # pkg:gem/pry#lib/pry/commands/ls/local_vars.rb:13 + def output_self; end + + private + + # pkg:gem/pry#lib/pry/commands/ls/local_vars.rb:34 + def colorized_assignment_style(lhs, rhs, desired_width = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/commands/ls/local_vars.rb:25 + def format(name_value_pairs); end +end + +# pkg:gem/pry#lib/pry/commands/ls/ls_entity.rb:6 +class Pry::Command::Ls::LsEntity + # pkg:gem/pry#lib/pry/commands/ls/ls_entity.rb:9 + def initialize(opts); end + + # pkg:gem/pry#lib/pry/commands/ls/ls_entity.rb:18 + def entities_table; end + + # pkg:gem/pry#lib/pry/commands/ls/ls_entity.rb:7 + def pry_instance; end + + private + + # pkg:gem/pry#lib/pry/commands/ls/ls_entity.rb:32 + def constants; end + + # pkg:gem/pry#lib/pry/commands/ls/ls_entity.rb:56 + def entities; end + + # pkg:gem/pry#lib/pry/commands/ls/ls_entity.rb:28 + def globals; end + + # pkg:gem/pry#lib/pry/commands/ls/ls_entity.rb:24 + def grep(entity); end + + # pkg:gem/pry#lib/pry/commands/ls/ls_entity.rb:44 + def instance_vars; end + + # pkg:gem/pry#lib/pry/commands/ls/ls_entity.rb:48 + def local_names; end + + # pkg:gem/pry#lib/pry/commands/ls/ls_entity.rb:52 + def local_vars; end + + # pkg:gem/pry#lib/pry/commands/ls/ls_entity.rb:36 + def methods; end + + # pkg:gem/pry#lib/pry/commands/ls/ls_entity.rb:40 + def self_methods; end +end + +# pkg:gem/pry#lib/pry/commands/ls/methods.rb:6 +class Pry::Command::Ls::Methods < ::Pry::Command::Ls::Formatter + include ::Pry::Command::Ls::Interrogatable + include ::Pry::Command::Ls::JRubyHacks + include ::Pry::Command::Ls::MethodsHelper + + # pkg:gem/pry#lib/pry/commands/ls/methods.rb:10 + def initialize(interrogatee, no_user_opts, opts, pry_instance); end + + # pkg:gem/pry#lib/pry/commands/ls/methods.rb:22 + def output_self; end + + private + + # Get a lambda that can be used with `take_while` to prevent over-eager + # traversal of the Object's ancestry graph. + # + # pkg:gem/pry#lib/pry/commands/ls/methods.rb:41 + def below_ceiling; end + + # pkg:gem/pry#lib/pry/commands/ls/methods.rb:35 + def correct_opts?; end +end + +# pkg:gem/pry#lib/pry/commands/ls/methods_helper.rb:6 +module Pry::Command::Ls::MethodsHelper + include ::Pry::Command::Ls::JRubyHacks + + private + + # Get all the methods that we'll want to output. + # + # pkg:gem/pry#lib/pry/commands/ls/methods_helper.rb:12 + def all_methods(instance_methods = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/commands/ls/methods_helper.rb:34 + def format(methods); end + + # pkg:gem/pry#lib/pry/commands/ls/methods_helper.rb:26 + def resolution_order; end +end + +# pkg:gem/pry#lib/pry/commands/ls/self_methods.rb:6 +class Pry::Command::Ls::SelfMethods < ::Pry::Command::Ls::Formatter + include ::Pry::Command::Ls::Interrogatable + include ::Pry::Command::Ls::JRubyHacks + include ::Pry::Command::Ls::MethodsHelper + + # pkg:gem/pry#lib/pry/commands/ls/self_methods.rb:10 + def initialize(interrogatee, no_user_opts, opts, pry_instance); end + + # pkg:gem/pry#lib/pry/commands/ls/self_methods.rb:18 + def output_self; end + + private + + # pkg:gem/pry#lib/pry/commands/ls/self_methods.rb:28 + def correct_opts?; end +end + +# pkg:gem/pry#lib/pry/commands/nesting.rb:5 +class Pry::Command::Nesting < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/nesting.rb:14 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/play.rb:5 +class Pry::Command::Play < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/play.rb:74 + def code_object; end + + # pkg:gem/pry#lib/pry/commands/play.rb:82 + def content; end + + # pkg:gem/pry#lib/pry/commands/play.rb:60 + def content_after_options; end + + # pkg:gem/pry#lib/pry/commands/play.rb:70 + def content_at_expression; end + + # The file to play from when no code object is specified. + # e.g `play --lines 4..10` + # + # pkg:gem/pry#lib/pry/commands/play.rb:92 + def default_file; end + + # pkg:gem/pry#lib/pry/commands/play.rb:102 + def file_content; end + + # pkg:gem/pry#lib/pry/commands/play.rb:29 + def options(opt); end + + # pkg:gem/pry#lib/pry/commands/play.rb:48 + def perform_play; end + + # pkg:gem/pry#lib/pry/commands/play.rb:41 + def process; end + + # pkg:gem/pry#lib/pry/commands/play.rb:78 + def should_use_default_file?; end + + # pkg:gem/pry#lib/pry/commands/play.rb:53 + def show_input; end +end + +# pkg:gem/pry#lib/pry/commands/pry_backtrace.rb:5 +class Pry::Command::PryBacktrace < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/pry_backtrace.rb:22 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/raise_up.rb:6 +class Pry::Command::RaiseUp < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/raise_up.rb:27 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/reload_code.rb:5 +class Pry::Command::ReloadCode < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/reload_code.rb:20 + def process; end + + private + + # pkg:gem/pry#lib/pry/commands/reload_code.rb:58 + def check_for_reloadability(code_object, identifier); end + + # pkg:gem/pry#lib/pry/commands/reload_code.rb:32 + def current_file; end + + # pkg:gem/pry#lib/pry/commands/reload_code.rb:42 + def reload_current_file; end + + # pkg:gem/pry#lib/pry/commands/reload_code.rb:51 + def reload_object(identifier); end +end + +# pkg:gem/pry#lib/pry/commands/reset.rb:5 +class Pry::Command::Reset < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/reset.rb:14 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/ri.rb:7 +class Pry::Command::Ri < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/ri.rb:21 + def process(spec); end +end + +# pkg:gem/pry#lib/pry/commands/save_file.rb:5 +class Pry::Command::SaveFile < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/save_file.rb:50 + def display_content; end + + # pkg:gem/pry#lib/pry/commands/save_file.rb:39 + def file_name; end + + # pkg:gem/pry#lib/pry/commands/save_file.rb:56 + def mode; end + + # pkg:gem/pry#lib/pry/commands/save_file.rb:21 + def options(opt); end + + # pkg:gem/pry#lib/pry/commands/save_file.rb:28 + def process; end + + # pkg:gem/pry#lib/pry/commands/save_file.rb:43 + def save_file; end +end + +# pkg:gem/pry#lib/pry/commands/shell_command.rb:5 +class Pry::Command::ShellCommand < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/shell_command.rb:21 + def process(cmd); end + + private + + # pkg:gem/pry#lib/pry/commands/shell_command.rb:50 + def cd_path_env; end + + # pkg:gem/pry#lib/pry/commands/shell_command.rb:54 + def cd_path_exists?; end + + # pkg:gem/pry#lib/pry/commands/shell_command.rb:36 + def parse_destination(dest); end + + # pkg:gem/pry#lib/pry/commands/shell_command.rb:58 + def path_from_cd_path(dest); end + + # pkg:gem/pry#lib/pry/commands/shell_command.rb:43 + def process_cd(dest); end + + # pkg:gem/pry#lib/pry/commands/shell_command.rb:68 + def special_case_path?(dest); end +end + +# pkg:gem/pry#lib/pry/commands/shell_mode.rb:5 +class Pry::Command::ShellMode < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/shell_mode.rb:15 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/show_doc.rb:5 +class Pry::Command::ShowDoc < ::Pry::Command::ShowInfo + include ::Pry::Helpers::DocumentationHelpers + + # The docs for code_object prepared for display. + # + # pkg:gem/pry#lib/pry/commands/show_doc.rb:25 + def content_for(code_object); end + + # Return docs for the code_object, adjusting for whether the code_object + # has yard docs available, in which case it returns those. + # (note we only have to check yard docs for modules since they can + # have multiple docs, but methods can only be doc'd once so we + # dont need to check them) + # + # pkg:gem/pry#lib/pry/commands/show_doc.rb:54 + def docs_for(code_object); end + + # Which sections to include in the 'header', can toggle: :owner, + # :signature and visibility. + # + # pkg:gem/pry#lib/pry/commands/show_doc.rb:66 + def header_options; end + + # process the markup (if necessary) and apply colors + # + # pkg:gem/pry#lib/pry/commands/show_doc.rb:34 + def render_doc_markup_for(code_object); end + + # figure out start line of docs by back-calculating based on + # number of lines in the comment and the start line of the code_object + # @return [Fixnum] start line of docs + # + # pkg:gem/pry#lib/pry/commands/show_doc.rb:73 + def start_line_for(code_object); end +end + +# pkg:gem/pry#lib/pry/commands/show_info.rb:5 +class Pry::Command::ShowInfo < ::Pry::ClassCommand + extend ::Pry::Helpers::BaseHelpers + + # pkg:gem/pry#lib/pry/commands/show_info.rb:10 + def initialize(*_arg0); end + + # pkg:gem/pry#lib/pry/commands/show_info.rb:127 + def code_object_header(code_object, line_num); end + + # This method checks whether the `code_object` is a WrappedModule, if it + # is, then it returns the first candidate (monkeypatch) with accessible + # source (or docs). If `code_object` is not a WrappedModule (i.e a method + # or a command) then the `code_object` itself is just returned. + # + # @return [Pry::WrappedModule, Pry::Method, Pry::Command] + # + # pkg:gem/pry#lib/pry/commands/show_info.rb:61 + def code_object_with_accessible_source(code_object); end + + # pkg:gem/pry#lib/pry/commands/show_info.rb:213 + def complete(input); end + + # pkg:gem/pry#lib/pry/commands/show_info.rb:77 + def content_and_header_for_code_object(code_object); end + + # pkg:gem/pry#lib/pry/commands/show_info.rb:81 + def content_and_headers_for_all_module_candidates(mod); end + + # takes into account possible yard docs, and returns yard_file / yard_line + # Also adjusts for start line of comments (using start_line_for), which it + # has to infer by subtracting number of lines of comment from start line + # of code_object + # + # pkg:gem/pry#lib/pry/commands/show_info.rb:205 + def file_and_line_for(code_object); end + + # Generate a header (meta-data information) for all the code + # object types: methods, modules, commands, procs... + # + # pkg:gem/pry#lib/pry/commands/show_info.rb:106 + def header(code_object); end + + # pkg:gem/pry#lib/pry/commands/show_info.rb:173 + def header_options; end + + # pkg:gem/pry#lib/pry/commands/show_info.rb:142 + def method_header(code_object, line_num); end + + # pkg:gem/pry#lib/pry/commands/show_info.rb:165 + def method_sections(code_object); end + + # pkg:gem/pry#lib/pry/commands/show_info.rb:151 + def module_header(code_object, line_num); end + + # pkg:gem/pry#lib/pry/commands/show_info.rb:100 + def no_definition_message; end + + # pkg:gem/pry#lib/pry/commands/show_info.rb:185 + def obj_name; end + + # pkg:gem/pry#lib/pry/commands/show_info.rb:16 + def options(opt); end + + # pkg:gem/pry#lib/pry/commands/show_info.rb:26 + def process; end + + # pkg:gem/pry#lib/pry/commands/show_info.rb:181 + def show_all_modules?(code_object); end + + # pkg:gem/pry#lib/pry/commands/show_info.rb:193 + def start_line_for(code_object); end + + # pkg:gem/pry#lib/pry/commands/show_info.rb:189 + def use_line_numbers?; end + + # pkg:gem/pry#lib/pry/commands/show_info.rb:73 + def valid_superclass?(code_object); end +end + +# pkg:gem/pry#lib/pry/commands/show_input.rb:5 +class Pry::Command::ShowInput < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/show_input.rb:15 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/show_source.rb:5 +class Pry::Command::ShowSource < ::Pry::Command::ShowInfo + # The source for code_object prepared for display. + # + # pkg:gem/pry#lib/pry/commands/show_source.rb:44 + def content_for(code_object); end + + # pkg:gem/pry#lib/pry/commands/show_source.rb:28 + def options(opt); end + + # pkg:gem/pry#lib/pry/commands/show_source.rb:34 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/stat.rb:5 +class Pry::Command::Stat < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/stat.rb:19 + def options(opt); end + + # pkg:gem/pry#lib/pry/commands/stat.rb:23 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/switch_to.rb:5 +class Pry::Command::SwitchTo < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/switch_to.rb:14 + def process(selection); end +end + +# pkg:gem/pry#lib/pry/commands/toggle_color.rb:5 +class Pry::Command::ToggleColor < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/toggle_color.rb:21 + def color_toggle; end + + # pkg:gem/pry#lib/pry/commands/toggle_color.rb:16 + def process; end +end + +# represents a void return value for a command +# +# pkg:gem/pry#lib/pry/command.rb:20 +Pry::Command::VOID_VALUE = T.let(T.unsafe(nil), Object) + +# pkg:gem/pry#lib/pry/commands/pry_version.rb:5 +class Pry::Command::Version < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/pry_version.rb:14 + def process; end +end + +# pkg:gem/pry#lib/pry/commands/watch_expression.rb:5 +class Pry::Command::WatchExpression < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/watch_expression.rb:31 + def options(opt); end + + # pkg:gem/pry#lib/pry/commands/watch_expression.rb:42 + def process; end + + private + + # pkg:gem/pry#lib/pry/commands/watch_expression.rb:91 + def add_expression; end + + # pkg:gem/pry#lib/pry/commands/watch_expression.rb:96 + def add_hook; end + + # pkg:gem/pry#lib/pry/commands/watch_expression.rb:59 + def delete(index); end + + # pkg:gem/pry#lib/pry/commands/watch_expression.rb:84 + def eval_and_print_changed(output); end + + # pkg:gem/pry#lib/pry/commands/watch_expression.rb:55 + def expressions; end + + # pkg:gem/pry#lib/pry/commands/watch_expression.rb:69 + def list; end +end + +# pkg:gem/pry#lib/pry/commands/watch_expression/expression.rb:6 +class Pry::Command::WatchExpression::Expression + # pkg:gem/pry#lib/pry/commands/watch_expression/expression.rb:9 + def initialize(pry_instance, target, source); end + + # Has the value of the expression changed? + # + # We use the pretty-printed string representation to detect differences + # as this avoids problems with dup (causes too many differences) and == + # (causes too few) + # + # pkg:gem/pry#lib/pry/commands/watch_expression/expression.rb:29 + def changed?; end + + # pkg:gem/pry#lib/pry/commands/watch_expression/expression.rb:15 + def eval!; end + + # pkg:gem/pry#lib/pry/commands/watch_expression/expression.rb:7 + def previous_value; end + + # pkg:gem/pry#lib/pry/commands/watch_expression/expression.rb:7 + def pry_instance; end + + # pkg:gem/pry#lib/pry/commands/watch_expression/expression.rb:7 + def source; end + + # pkg:gem/pry#lib/pry/commands/watch_expression/expression.rb:7 + def target; end + + # pkg:gem/pry#lib/pry/commands/watch_expression/expression.rb:20 + def to_s; end + + # pkg:gem/pry#lib/pry/commands/watch_expression/expression.rb:7 + def value; end + + private + + # pkg:gem/pry#lib/pry/commands/watch_expression/expression.rb:35 + def target_eval(target, source); end +end + +# pkg:gem/pry#lib/pry/commands/whereami.rb:7 +class Pry::Command::Whereami < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/whereami.rb:8 + def initialize(*_arg0); end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:83 + def bad_option_combination?; end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:63 + def code; end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:77 + def code?; end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:88 + def location; end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:55 + def options(opt); end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:92 + def process; end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:44 + def setup; end + + private + + # pkg:gem/pry#lib/pry/commands/whereami.rb:171 + def class_code; end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:152 + def code_window; end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:144 + def default_code; end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:185 + def expand_path(filename); end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:132 + def handle_internal_binding; end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:124 + def marker; end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:156 + def method_code; end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:116 + def nothing_to_do?; end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:140 + def small_method?; end + + # This either returns the `target_self` + # or it returns the class of `target_self` if `target_self` is not a class. + # @return [Pry::WrappedModule] + # + # pkg:gem/pry#lib/pry/commands/whereami.rb:165 + def target_class; end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:128 + def top_level?; end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:120 + def use_line_numbers?; end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:180 + def valid_method?; end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:192 + def window_size; end + + class << self + # pkg:gem/pry#lib/pry/commands/whereami.rb:15 + def method_size_cutoff; end + + # pkg:gem/pry#lib/pry/commands/whereami.rb:15 + def method_size_cutoff=(_arg0); end + end +end + +# pkg:gem/pry#lib/pry/commands/wtf.rb:5 +class Pry::Command::Wtf < ::Pry::ClassCommand + # pkg:gem/pry#lib/pry/commands/wtf.rb:27 + def options(opt); end + + # pkg:gem/pry#lib/pry/commands/wtf.rb:32 + def process; end + + private + + # pkg:gem/pry#lib/pry/commands/wtf.rb:64 + def format_backtrace(backtrace); end + + # pkg:gem/pry#lib/pry/commands/wtf.rb:60 + def format_header(title, exception); end + + # pkg:gem/pry#lib/pry/commands/wtf.rb:83 + def read_line(file, line); end + + # pkg:gem/pry#lib/pry/commands/wtf.rb:76 + def trim_backtrace(backtrace); end + + # pkg:gem/pry#lib/pry/commands/wtf.rb:48 + def unwind_exceptions; end +end + +# pkg:gem/pry#lib/pry/commands/wtf.rb:25 +Pry::Command::Wtf::RUBY_FRAME_PATTERN = T.let(T.unsafe(nil), Regexp) + +# CommandErrors are caught by the REPL loop and displayed to the user. They +# indicate an exceptional condition that's fatal to the current command. +# +# pkg:gem/pry#lib/pry/exceptions.rb:68 +class Pry::CommandError < ::StandardError; end + +# This class is used to create sets of commands. Commands can be imported from +# different sets, aliased, removed, etc. +# +# pkg:gem/pry#lib/pry/command_set.rb:12 +class Pry::CommandSet + include ::Enumerable + include ::Pry::Helpers::BaseHelpers + + # @param [Array] imported_sets + # Sets which will be imported automatically + # @yield Optional block run to define commands + # + # pkg:gem/pry#lib/pry/command_set.rb:20 + def initialize(*imported_sets, &block); end + + # Find a command that matches the given line + # @param [String] pattern The line that might be a command invocation + # @return [Pry::Command, nil] + # + # pkg:gem/pry#lib/pry/command_set.rb:275 + def [](pattern); end + + # Re-assign the command found at _pattern_ with _command_. + # + # @param [Regexp, String] pattern + # The command to add or replace(found at _pattern_). + # + # @param [Pry::Command] command + # The command to add. + # + # @return [Pry::Command] + # Returns the new command (matched with "pattern".) + # + # @example + # Pry.config.commands["help"] = MyHelpCommand + # + # pkg:gem/pry#lib/pry/command_set.rb:298 + def []=(pattern, command); end + + # Add a command to set. + # + # @param [Command] command + # a subclass of Pry::Command. + # + # pkg:gem/pry#lib/pry/command_set.rb:324 + def add_command(command); end + + # Aliases a command + # @param [String, Regex] match The match of the alias (can be a regex). + # @param [String] action The action to be performed (typically + # another command). + # @param [Hash] options The optional configuration parameters, + # accepts the same as the `command` method, but also allows the + # command description to be passed this way too as `:desc` + # @example Creating an alias for `ls -M` + # Pry.config.commands.alias_command "lM", "ls -M" + # @example Pass explicit description (overriding default). + # Pry.config.commands.alias_command "lM", "ls -M", :desc => "cutiepie" + # + # pkg:gem/pry#lib/pry/command_set.rb:190 + def alias_command(match, action, options = T.unsafe(nil)); end + + # Defines a new Pry command. + # @param [String, Regexp] match The start of invocations of this command. + # @param [String] description A description of the command. + # @param [Hash] options The optional configuration parameters. + # @option options [Boolean] :keep_retval Whether or not to use return value + # of the block for return of `command` or just to return `nil` + # (the default). + # @option options [Boolean] :interpolate Whether string #{} based + # interpolation is applied to the command arguments before + # executing the command. Defaults to true. + # @option options [String] :listing The listing name of the + # command. That is the name by which the command is looked up by + # help and by show-source. Necessary for commands with regex matches. + # @option options [Boolean] :use_prefix Whether the command uses + # `Pry.config.command_prefix` prefix (if one is defined). Defaults + # to true. + # @option options [Boolean] :shellwords Whether the command's arguments + # should be split using Shellwords instead of just split on spaces. + # Defaults to true. + # @yield The action to perform. The parameters in the block + # determines the parameters the command will receive. All + # parameters passed into the block will be strings. Successive + # command parameters are separated by whitespace at the Pry prompt. + # @example + # MyCommands = Pry::CommandSet.new do + # command "greet", "Greet somebody" do |name| + # puts "Good afternoon #{name.capitalize}!" + # end + # end + # + # # From pry: + # # pry(main)> pry_instance.commands = MyCommands + # # pry(main)> greet john + # # Good afternoon John! + # # pry(main)> help greet + # # Greet somebody + # @example Regexp command + # MyCommands = Pry::CommandSet.new do + # command( + # /number-(\d+)/, "number-N regex command", :listing => "number" + # ) do |num, name| + # puts "hello #{name}, nice number: #{num}" + # end + # end + # + # # From pry: + # # pry(main)> pry_instance.commands = MyCommands + # # pry(main)> number-10 john + # # hello john, nice number: 10 + # # pry(main)> help number + # # number-N regex command + # + # pkg:gem/pry#lib/pry/command_set.rb:78 + def block_command(match, description = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # pkg:gem/pry#lib/pry/command_set.rb:89 + def command(match, description = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Generate completions for the user's search. + # @param [String] search The line to search for + # @param [Hash] context The context to create the command with + # @return [Array] + # + # pkg:gem/pry#lib/pry/command_set.rb:365 + def complete(search, context = T.unsafe(nil)); end + + # Defines a new Pry command class. + # + # @param [String, Regexp] match The start of invocations of this command. + # @param [String] description A description of the command. + # @param [Hash] options The optional configuration parameters, see {#command} + # @yield The class body's definition. + # + # @example + # Pry::Commands.create_command "echo", "echo's the input", :shellwords => false do + # def options(opt) + # opt.banner "Usage: echo [-u | -d] " + # opt.on :u, :upcase, "ensure the output is all upper-case" + # opt.on :d, :downcase, "ensure the output is all lower-case" + # end + # + # def process + # if opts.present?(:u) && opts.present?(:d) + # raise Pry::CommandError, "-u and -d makes no sense" + # end + # result = args.join(" ") + # result.downcase! if opts.present?(:downcase) + # result.upcase! if opts.present?(:upcase) + # output.puts result + # end + # end + # + # pkg:gem/pry#lib/pry/command_set.rb:117 + def create_command(match, description = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Removes some commands from the set + # @param [Array] searches the matches or listings of the commands + # to remove + # + # pkg:gem/pry#lib/pry/command_set.rb:138 + def delete(*searches); end + + # Sets or gets the description for a command (replacing the old + # description). Returns current description if no description + # parameter provided. + # @param [String, Regexp] search The command match. + # @param [String?] description (nil) The command description. + # @example Setting + # MyCommands = Pry::CommandSet.new do + # desc "help", "help description" + # end + # @example Getting + # Pry.config.commands.desc "amend-line" + # + # pkg:gem/pry#lib/pry/command_set.rb:253 + def desc(search, description = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/command_set.rb:131 + def each(&block); end + + # pkg:gem/pry#lib/pry/command_set.rb:281 + def find_command(pattern); end + + # @param [String, Regexp] match_or_listing The match or listing of a command. + # of the command to retrieve. + # @return [Command] The command object matched. + # + # pkg:gem/pry#lib/pry/command_set.rb:173 + def find_command_by_match_or_listing(match_or_listing); end + + # Find the command that the user might be trying to refer to. + # @param [String] search The user's search. + # @return [Pry::Command?] + # + # pkg:gem/pry#lib/pry/command_set.rb:331 + def find_command_for_help(search); end + + # pkg:gem/pry#lib/pry/command_set.rb:15 + def helper_module; end + + # Imports all the commands from one or more sets. + # @param [Array] sets Command sets, all of the commands of which + # will be imported. + # @return [Pry::CommandSet] Returns the receiver (a command set). + # + # pkg:gem/pry#lib/pry/command_set.rb:149 + def import(*sets); end + + # Imports some commands from a set + # @param [CommandSet] set Set to import commands from + # @param [Array] matches Commands to import + # @return [Pry::CommandSet] Returns the receiver (a command set). + # + # pkg:gem/pry#lib/pry/command_set.rb:161 + def import_from(set, *matches); end + + # pkg:gem/pry#lib/pry/command_set.rb:265 + def keys; end + + # @return [Array] + # The list of commands provided by the command set. + # + # pkg:gem/pry#lib/pry/command_set.rb:262 + def list_commands; end + + # Process the given line to see whether it needs executing as a command. + # @param [String] val The line to execute + # @param [Hash] context The context to execute the commands with + # @return [CommandSet::Result] + # + # pkg:gem/pry#lib/pry/command_set.rb:351 + def process_line(val, context = T.unsafe(nil)); end + + # Rename a command. Accepts either match or listing for the search. + # + # @param [String, Regexp] new_match The new match for the command. + # @param [String, Regexp] search The command's current match or listing. + # @param [Hash] options The optional configuration parameters, + # accepts the same as the `command` method, but also allows the + # command description to be passed this way too. + # @example Renaming the `ls` command and changing its description. + # Pry.config.commands.rename "dir", "ls", :description => "DOS friendly ls" + # + # pkg:gem/pry#lib/pry/command_set.rb:227 + def rename_command(new_match, search, options = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/command_set.rb:270 + def to_h; end + + # pkg:gem/pry#lib/pry/command_set.rb:267 + def to_hash; end + + # Is the given line a command invocation? + # @param [String] val + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/command_set.rb:343 + def valid_command?(val); end + + private + + # Defines helpers methods for this command sets. + # Those helpers are only defined in this command set. + # + # @yield A block defining helper methods + # @example + # helpers do + # def hello + # puts "Hello!" + # end + # + # include OtherModule + # end + # + # pkg:gem/pry#lib/pry/command_set.rb:390 + def helpers(&block); end +end + +# CommandState is a data structure to hold per-command state. +# +# Pry commands can store arbitrary state here. This state persists between +# subsequent command invocations. All state saved here is unique to the +# command. +# +# @since v0.13.0 +# @api private +# +# pkg:gem/pry#lib/pry/command_state.rb:12 +class Pry::CommandState + # pkg:gem/pry#lib/pry/command_state.rb:17 + def initialize; end + + # pkg:gem/pry#lib/pry/command_state.rb:25 + def reset(command_class); end + + # pkg:gem/pry#lib/pry/command_state.rb:21 + def state_for(command_class); end + + private + + # pkg:gem/pry#lib/pry/command_state.rb:31 + def command_struct(command_class); end + + class << self + # pkg:gem/pry#lib/pry/command_state.rb:13 + def default; end + end +end + +# pkg:gem/pry#lib/pry.rb:35 +Pry::Commands = T.let(T.unsafe(nil), Pry::CommandSet) + +# @api private +# +# pkg:gem/pry#lib/pry/config/attributable.rb:4 +class Pry::Config + extend ::Pry::Config::Attributable + + # pkg:gem/pry#lib/pry/config.rb:151 + def initialize; end + + # pkg:gem/pry#lib/pry/config.rb:224 + def [](attr); end + + # pkg:gem/pry#lib/pry/config.rb:220 + def []=(attr, value); end + + # pkg:gem/pry#lib/pry/config.rb:109 + def auto_indent; end + + # pkg:gem/pry#lib/pry/config.rb:109 + def auto_indent=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:116 + def collision_warning; end + + # pkg:gem/pry#lib/pry/config.rb:116 + def collision_warning=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:59 + def color; end + + # pkg:gem/pry#lib/pry/config.rb:59 + def color=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:132 + def command_completions; end + + # pkg:gem/pry#lib/pry/config.rb:132 + def command_completions=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:56 + def command_prefix; end + + # pkg:gem/pry#lib/pry/config.rb:56 + def command_prefix=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:16 + def commands; end + + # pkg:gem/pry#lib/pry/config.rb:16 + def commands=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:122 + def completer; end + + # pkg:gem/pry#lib/pry/config.rb:122 + def completer=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:249 + def control_d_handler; end + + # pkg:gem/pry#lib/pry/config.rb:250 + def control_d_handler=(value); end + + # pkg:gem/pry#lib/pry/config.rb:112 + def correct_indent; end + + # pkg:gem/pry#lib/pry/config.rb:112 + def correct_indent=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:29 + def default_window_size; end + + # pkg:gem/pry#lib/pry/config.rb:29 + def default_window_size=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:77 + def disable_auto_reload; end + + # pkg:gem/pry#lib/pry/config.rb:77 + def disable_auto_reload=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:51 + def editor; end + + # pkg:gem/pry#lib/pry/config.rb:51 + def editor=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:22 + def exception_handler; end + + # pkg:gem/pry#lib/pry/config.rb:22 + def exception_handler=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:142 + def exec_string; end + + # pkg:gem/pry#lib/pry/config.rb:142 + def exec_string=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:119 + def extra_sticky_locals; end + + # pkg:gem/pry#lib/pry/config.rb:119 + def extra_sticky_locals=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:135 + def file_completions; end + + # pkg:gem/pry#lib/pry/config.rb:135 + def file_completions=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:85 + def history; end + + # pkg:gem/pry#lib/pry/config.rb:85 + def history=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:94 + def history_file; end + + # pkg:gem/pry#lib/pry/config.rb:94 + def history_file=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:97 + def history_ignorelist; end + + # pkg:gem/pry#lib/pry/config.rb:97 + def history_ignorelist=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:91 + def history_load; end + + # pkg:gem/pry#lib/pry/config.rb:91 + def history_load=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:88 + def history_save; end + + # pkg:gem/pry#lib/pry/config.rb:88 + def history_save=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:32 + def hooks; end + + # pkg:gem/pry#lib/pry/config.rb:32 + def hooks=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:10 + def input; end + + # pkg:gem/pry#lib/pry/config.rb:10 + def input=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:138 + def ls; end + + # pkg:gem/pry#lib/pry/config.rb:138 + def ls=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:103 + def memory_size; end + + # pkg:gem/pry#lib/pry/config.rb:103 + def memory_size=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:216 + def merge(config_hash); end + + # pkg:gem/pry#lib/pry/config.rb:211 + def merge!(config_hash); end + + # pkg:gem/pry#lib/pry/config.rb:229 + def method_missing(method_name, *args, &_block); end + + # pkg:gem/pry#lib/pry/config.rb:65 + def multiline; end + + # pkg:gem/pry#lib/pry/config.rb:65 + def multiline=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:13 + def output; end + + # pkg:gem/pry#lib/pry/config.rb:13 + def output=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:145 + def output_prefix; end + + # pkg:gem/pry#lib/pry/config.rb:145 + def output_prefix=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:62 + def pager; end + + # pkg:gem/pry#lib/pry/config.rb:62 + def pager=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:19 + def print; end + + # pkg:gem/pry#lib/pry/config.rb:19 + def print=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:35 + def prompt; end + + # pkg:gem/pry#lib/pry/config.rb:35 + def prompt=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:38 + def prompt_name; end + + # pkg:gem/pry#lib/pry/config.rb:38 + def prompt_name=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:42 + def prompt_safe_contexts; end + + # pkg:gem/pry#lib/pry/config.rb:42 + def prompt_safe_contexts=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:125 + def quiet; end + + # pkg:gem/pry#lib/pry/config.rb:125 + def quiet=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:149 + def rc_file; end + + # pkg:gem/pry#lib/pry/config.rb:149 + def rc_file=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:100 + def requires; end + + # pkg:gem/pry#lib/pry/config.rb:100 + def requires=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:71 + def should_load_local_rc; end + + # pkg:gem/pry#lib/pry/config.rb:71 + def should_load_local_rc=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:68 + def should_load_rc; end + + # pkg:gem/pry#lib/pry/config.rb:68 + def should_load_rc=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:74 + def should_load_requires; end + + # pkg:gem/pry#lib/pry/config.rb:74 + def should_load_requires=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:82 + def should_trap_interrupts; end + + # pkg:gem/pry#lib/pry/config.rb:82 + def should_trap_interrupts=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:106 + def system; end + + # pkg:gem/pry#lib/pry/config.rb:106 + def system=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:25 + def unrescued_exceptions; end + + # pkg:gem/pry#lib/pry/config.rb:25 + def unrescued_exceptions=(_arg0); end + + # pkg:gem/pry#lib/pry/config.rb:129 + def windows_console_warning; end + + # pkg:gem/pry#lib/pry/config.rb:129 + def windows_console_warning=(_arg0); end + + private + + # pkg:gem/pry#lib/pry/config.rb:279 + def choose_input; end + + # pkg:gem/pry#lib/pry/config.rb:310 + def default_rc_file; end + + # pkg:gem/pry#lib/pry/config.rb:244 + def initialize_dup(other); end + + # pkg:gem/pry#lib/pry/config.rb:289 + def load_readline; end + + # pkg:gem/pry#lib/pry/config.rb:240 + def respond_to_missing?(method_name, include_all = T.unsafe(nil)); end +end + +# Attributable provides the ability to create "attribute" +# accessors. Attribute accessors create a standard "attr_writer" and a +# customised "attr_reader". This reader is Proc-aware (lazy). +# +# @since v0.13.0 +# @api private +# +# pkg:gem/pry#lib/pry/config/attributable.rb:11 +module Pry::Config::Attributable + # pkg:gem/pry#lib/pry/config/attributable.rb:12 + def attribute(attr_name); end +end + +# LazyValue is a Proc (block) wrapper. It is meant to be used as a +# configuration value. Subsequent `#call` calls always evaluate the given +# block. +# +# @example +# num = 19 +# value = Pry::Config::LazyValue.new { num += 1 } +# value.foo # => 20 +# value.foo # => 21 +# value.foo # => 22 +# +# @api private +# @since v0.13.0 +# @see Pry::Config::MemoizedValue +# +# pkg:gem/pry#lib/pry/config/lazy_value.rb:19 +class Pry::Config::LazyValue + # pkg:gem/pry#lib/pry/config/lazy_value.rb:20 + def initialize(&block); end + + # pkg:gem/pry#lib/pry/config/lazy_value.rb:24 + def call; end +end + +# MemoizedValue is a Proc (block) wrapper. It is meant to be used as a +# configuration value. Subsequent `#call` calls return the same memoized +# result. +# +# @example +# num = 19 +# value = Pry::Config::MemoizedValue.new { num += 1 } +# value.call # => 20 +# value.call # => 20 +# value.call # => 20 +# +# @api private +# @since v0.13.0 +# @see Pry::Config::LazyValue +# +# pkg:gem/pry#lib/pry/config/memoized_value.rb:19 +class Pry::Config::MemoizedValue + # pkg:gem/pry#lib/pry/config/memoized_value.rb:20 + def initialize(&block); end + + # pkg:gem/pry#lib/pry/config/memoized_value.rb:26 + def call; end +end + +# Value holds a value for the given attribute and decides how it should +# be read. Procs get called, other values are returned as is. +# +# @since v0.13.0 +# @api private +# +# pkg:gem/pry#lib/pry/config/value.rb:10 +class Pry::Config::Value + # pkg:gem/pry#lib/pry/config/value.rb:11 + def initialize(value); end + + # pkg:gem/pry#lib/pry/config/value.rb:15 + def call; end +end + +# @api private +# @since v0.13.0 +# +# pkg:gem/pry#lib/pry/control_d_handler.rb:6 +module Pry::ControlDHandler + class << self + # Deal with the ^D key being pressed. Different behaviour in different + # cases: + # 1. In an expression behave like `!` command. + # 2. At top-level session behave like `exit` command. + # 3. In a nested session behave like `cd ..`. + # + # pkg:gem/pry#lib/pry/control_d_handler.rb:12 + def default(pry_instance); end + end +end + +# pkg:gem/pry#lib/pry/pry_instance.rb:58 +Pry::EMPTY_COMPLETIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/pry#lib/pry/editor.rb:6 +class Pry::Editor + include ::Pry::Helpers::OptionsHelpers + include ::Pry::Helpers::CommandHelpers + + # pkg:gem/pry#lib/pry/editor.rb:27 + def initialize(pry_instance); end + + # Generate the string that's used to start the editor. This includes + # all the flags we want as well as the file and line number we + # want to open at. + # + # pkg:gem/pry#lib/pry/editor.rb:60 + def build_editor_invocation_string(file, line, blocking); end + + # pkg:gem/pry#lib/pry/editor.rb:31 + def edit_tempfile_with_content(initial_content, line = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/editor.rb:41 + def invoke_editor(file, line, blocking = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/editor.rb:25 + def pry_instance; end + + private + + # Some editors that run outside the terminal allow you to control whether or + # not to block the process from which they were launched (in this case, Pry). + # For those editors, return the flag that produces the desired behavior. + # + # pkg:gem/pry#lib/pry/editor.rb:100 + def blocking_flag_for_editor(blocking); end + + # Get the name of the binary that Pry.config.editor points to. + # + # This is useful for deciding which flags we pass to the editor as + # we can just use the program's name and ignore any absolute paths. + # + # @example + # Pry.config.editor="/home/conrad/bin/textmate -w" + # editor_name + # # => textmate + # + # pkg:gem/pry#lib/pry/editor.rb:153 + def editor_name; end + + # Start the editor running, using the calculated invocation string + # + # pkg:gem/pry#lib/pry/editor.rb:76 + def open_editor(editor_invocation); end + + # We need JRuby specific code here cos just shelling out using + # system() appears to be pretty broken :/ + # + # pkg:gem/pry#lib/pry/editor.rb:89 + def open_editor_on_jruby(editor_invocation); end + + # Return the syntax for a given editor for starting the editor + # and moving to a particular line within that file + # + # pkg:gem/pry#lib/pry/editor.rb:115 + def start_line_syntax_for_editor(file_name, line_number); end + + class << self + # pkg:gem/pry#lib/pry/editor.rb:7 + def default; end + end +end + +# Env is a helper module to work with environment variables. +# +# @since v0.13.0 +# @api private +# +# pkg:gem/pry#lib/pry/env.rb:8 +module Pry::Env + class << self + # pkg:gem/pry#lib/pry/env.rb:9 + def [](key); end + end +end + +# @api private +# @since v0.13.0 +# +# pkg:gem/pry#lib/pry/exception_handler.rb:6 +module Pry::ExceptionHandler + class << self + # Will only show the first line of the backtrace. + # + # pkg:gem/pry#lib/pry/exception_handler.rb:9 + def handle_exception(output, exception, _pry_instance); end + + private + + # pkg:gem/pry#lib/pry/exception_handler.rb:42 + def cause_text(cause); end + + # pkg:gem/pry#lib/pry/exception_handler.rb:32 + def exception_text(exception); end + + # pkg:gem/pry#lib/pry/exception_handler.rb:19 + def standard_error_text_for(exception); end + end +end + +# pkg:gem/pry#lib/pry/forwardable.rb:4 +module Pry::Forwardable + include ::Forwardable + + # Since Ruby 2.4, Forwardable will print a warning when + # calling a method that is private on a delegate, and + # in the future it could be an error: https://bugs.ruby-lang.org/issues/12782#note-3 + # + # That's why we revert to a custom implementation for delegating one + # private method to another. + # + # pkg:gem/pry#lib/pry/forwardable.rb:16 + def def_private_delegators(target, *private_delegates); end +end + +# When we try to get a binding for an object, we try to define a method on +# that Object's singleton class. This doesn't work for "frozen" Object's, and +# the exception is just a vanilla RuntimeError. +# +# pkg:gem/pry#lib/pry/exceptions.rb:56 +module Pry::FrozenObjectException + class << self + # pkg:gem/pry#lib/pry/exceptions.rb:57 + def ===(exception); end + end +end + +# @return [Boolean] true if this Ruby supports safe levels and tainting, +# to guard against using deprecated or unsupported features +# +# pkg:gem/pry#lib/pry/pry_class.rb:11 +Pry::HAS_SAFE_LEVEL = T.let(T.unsafe(nil), FalseClass) + +# pkg:gem/pry#lib/pry/helpers/base_helpers.rb:4 +module Pry::Helpers + class << self + # pkg:gem/pry#lib/pry/helpers/table.rb:27 + def tablify(things, line_length, pry_instance = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/helpers/table.rb:5 + def tablify_or_one_line(heading, things, pry_instance = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/helpers/table.rb:16 + def tablify_to_screen_width(things, options, pry_instance = T.unsafe(nil)); end + end +end + +# pkg:gem/pry#lib/pry/helpers/base_helpers.rb:5 +module Pry::Helpers::BaseHelpers + extend ::Pry::Helpers::BaseHelpers + + # pkg:gem/pry#lib/pry/helpers/base_helpers.rb:43 + def colorize_code(code); end + + # pkg:gem/pry#lib/pry/helpers/base_helpers.rb:27 + def find_command(name, set = T.unsafe(nil)); end + + # formatting + # + # pkg:gem/pry#lib/pry/helpers/base_helpers.rb:54 + def heading(text); end + + # pkg:gem/pry#lib/pry/helpers/base_helpers.rb:47 + def highlight(string, regexp, highlight_color = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/helpers/base_helpers.rb:34 + def not_a_real_file?(file); end + + # Acts like send but ignores any methods defined below Object or Class in the + # inheritance hierarchy. + # This is required to introspect methods on objects like Net::HTTP::Get that + # have overridden the `method` method. + # + # pkg:gem/pry#lib/pry/helpers/base_helpers.rb:22 + def safe_send(obj, method, *args, &block); end + + # pkg:gem/pry#lib/pry/helpers/base_helpers.rb:8 + def silence_warnings; end + + # Send the given text through the best available pager (if Pry.config.pager is + # enabled). Infers where to send the output if used as a mixin. + # DEPRECATED. + # + # pkg:gem/pry#lib/pry/helpers/base_helpers.rb:62 + def stagger_output(text, _out = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/helpers/base_helpers.rb:38 + def use_ansi_codes?; end +end + +# pkg:gem/pry#lib/pry/helpers/command_helpers.rb:7 +module Pry::Helpers::CommandHelpers + include ::Pry::Helpers::OptionsHelpers + extend ::Pry::Helpers::OptionsHelpers + extend ::Pry::Helpers::CommandHelpers + + # pkg:gem/pry#lib/pry/helpers/command_helpers.rb:115 + def absolute_index_number(line_number, array_length); end + + # pkg:gem/pry#lib/pry/helpers/command_helpers.rb:123 + def absolute_index_range(range_or_number, array_length); end + + # pkg:gem/pry#lib/pry/helpers/command_helpers.rb:31 + def get_method_or_raise(method_name, context, opts = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/helpers/command_helpers.rb:21 + def internal_binding?(context); end + + # pkg:gem/pry#lib/pry/helpers/command_helpers.rb:97 + def one_index_number(line_number); end + + # convert a 1-index range to a 0-indexed one + # + # pkg:gem/pry#lib/pry/helpers/command_helpers.rb:102 + def one_index_range(range); end + + # pkg:gem/pry#lib/pry/helpers/command_helpers.rb:106 + def one_index_range_or_number(range_or_number); end + + # Restrict a string to the given range of lines (1-indexed) + # @param [String] content The string. + # @param [Range, Integer] lines The line(s) to restrict it to. + # @return [String] The resulting string. + # + # pkg:gem/pry#lib/pry/helpers/command_helpers.rb:92 + def restrict_to_lines(content, lines); end + + # pkg:gem/pry#lib/pry/helpers/command_helpers.rb:135 + def set_file_and_dir_locals(file_name, pry = T.unsafe(nil), ctx = T.unsafe(nil)); end + + # Open a temp file and yield it to the block, closing it after + # @return [String] The path of the temp file + # + # pkg:gem/pry#lib/pry/helpers/command_helpers.rb:14 + def temp_file(ext = T.unsafe(nil)); end + + # Remove any common leading whitespace from every line in `text`. This + # can be used to make a HEREDOC line up with the left margin, without + # sacrificing the indentation level of the source code. + # + # @example + # opt.banner(unindent(<<-USAGE)) + # Lorem ipsum dolor sit amet, consectetur adipisicing elit, + # sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + # "Ut enim ad minim veniam." + # USAGE + # + # @param [String] dirty_text The text from which to remove indentation + # @return [String] the text with indentation stripped + # + # pkg:gem/pry#lib/pry/helpers/command_helpers.rb:68 + def unindent(dirty_text, left_padding = T.unsafe(nil)); end +end + +# This class contains methods useful for extracting +# documentation from methods and classes. +# +# pkg:gem/pry#lib/pry/helpers/documentation_helpers.rb:7 +module Pry::Helpers::DocumentationHelpers + private + + # Given a string that makes up a comment in a source-code file parse out the content + # that the user is intended to read. (i.e. without leading indentation, #-characters + # or shebangs) + # + # @param [String] comment + # @return [String] + # + # pkg:gem/pry#lib/pry/helpers/documentation_helpers.rb:67 + def get_comment_content(comment); end + + # pkg:gem/pry#lib/pry/helpers/documentation_helpers.rb:51 + def process_comment_markup(comment); end + + # pkg:gem/pry#lib/pry/helpers/documentation_helpers.rb:15 + def process_rdoc(comment); end + + # pkg:gem/pry#lib/pry/helpers/documentation_helpers.rb:45 + def process_yardoc(comment); end + + # pkg:gem/pry#lib/pry/helpers/documentation_helpers.rb:30 + def process_yardoc_tag(comment, tag); end + + # @param [String] code + # @return [String] + # + # pkg:gem/pry#lib/pry/helpers/documentation_helpers.rb:57 + def strip_comments_from_c_code(code); end + + # @param [String] text + # @return [String] + # + # pkg:gem/pry#lib/pry/helpers/documentation_helpers.rb:79 + def strip_leading_whitespace(text); end + + class << self + # Given a string that makes up a comment in a source-code file parse out the content + # that the user is intended to read. (i.e. without leading indentation, #-characters + # or shebangs) + # + # @param [String] comment + # @return [String] + # + # pkg:gem/pry#lib/pry/helpers/documentation_helpers.rb:67 + def get_comment_content(comment); end + + # pkg:gem/pry#lib/pry/helpers/documentation_helpers.rb:51 + def process_comment_markup(comment); end + + # pkg:gem/pry#lib/pry/helpers/documentation_helpers.rb:15 + def process_rdoc(comment); end + + # pkg:gem/pry#lib/pry/helpers/documentation_helpers.rb:45 + def process_yardoc(comment); end + + # pkg:gem/pry#lib/pry/helpers/documentation_helpers.rb:30 + def process_yardoc_tag(comment, tag); end + + # @param [String] code + # @return [String] + # + # pkg:gem/pry#lib/pry/helpers/documentation_helpers.rb:57 + def strip_comments_from_c_code(code); end + + # @param [String] text + # @return [String] + # + # pkg:gem/pry#lib/pry/helpers/documentation_helpers.rb:79 + def strip_leading_whitespace(text); end + end +end + +# pkg:gem/pry#lib/pry/helpers/documentation_helpers.rb:8 +Pry::Helpers::DocumentationHelpers::YARD_TAGS = T.let(T.unsafe(nil), Array) + +# pkg:gem/pry#lib/pry/helpers/options_helpers.rb:5 +module Pry::Helpers::OptionsHelpers + private + + # Get the method object parsed by the slop instance + # + # pkg:gem/pry#lib/pry/helpers/options_helpers.rb:23 + def method_object; end + + # Add method options to the Pry::Slop instance + # + # pkg:gem/pry#lib/pry/helpers/options_helpers.rb:9 + def method_options(opt); end + + class << self + # Get the method object parsed by the slop instance + # + # pkg:gem/pry#lib/pry/helpers/options_helpers.rb:23 + def method_object; end + + # Add method options to the Pry::Slop instance + # + # pkg:gem/pry#lib/pry/helpers/options_helpers.rb:9 + def method_options(opt); end + end +end + +# Contains methods for querying the platform that Pry is running on +# @api public +# @since v0.12.0 +# +# pkg:gem/pry#lib/pry/helpers/platform.rb:10 +module Pry::Helpers::Platform + class << self + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/helpers/platform.rb:35 + def jruby?; end + + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/helpers/platform.rb:40 + def jruby_19?; end + + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/helpers/platform.rb:17 + def linux?; end + + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/helpers/platform.rb:12 + def mac_osx?; end + + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/helpers/platform.rb:45 + def mri?; end + + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/helpers/platform.rb:50 + def mri_2?; end + + # @return [Boolean] true when Pry is running on Windows with ANSI support, + # false otherwise + # + # pkg:gem/pry#lib/pry/helpers/platform.rb:23 + def windows?; end + + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/helpers/platform.rb:28 + def windows_ansi?; end + end +end + +# pkg:gem/pry#lib/pry/helpers/table.rb:35 +class Pry::Helpers::Table + # pkg:gem/pry#lib/pry/helpers/table.rb:37 + def initialize(items, args, pry_instance = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/helpers/table.rb:81 + def ==(other); end + + # pkg:gem/pry#lib/pry/helpers/table.rb:36 + def column_count; end + + # pkg:gem/pry#lib/pry/helpers/table.rb:68 + def column_count=(count); end + + # pkg:gem/pry#lib/pry/helpers/table.rb:77 + def columns; end + + # pkg:gem/pry#lib/pry/helpers/table.rb:73 + def fits_on_line?(line_length); end + + # pkg:gem/pry#lib/pry/helpers/table.rb:36 + def items; end + + # pkg:gem/pry#lib/pry/helpers/table.rb:62 + def items=(items); end + + # pkg:gem/pry#lib/pry/helpers/table.rb:47 + def rows_to_s(style = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/helpers/table.rb:85 + def to_a; end + + # pkg:gem/pry#lib/pry/helpers/table.rb:43 + def to_s; end + + private + + # pkg:gem/pry#lib/pry/helpers/table.rb:91 + def _max_width(things); end + + # pkg:gem/pry#lib/pry/helpers/table.rb:95 + def _rebuild_colorless_cache; end + + # pkg:gem/pry#lib/pry/helpers/table.rb:116 + def _recall_color_for(thing); end + + # pkg:gem/pry#lib/pry/helpers/table.rb:105 + def _recolumn; end +end + +# The methods defined on {Text} are available to custom commands via +# {Pry::Command#text}. +# +# pkg:gem/pry#lib/pry/helpers/text.rb:7 +module Pry::Helpers::Text + extend ::Pry::Helpers::Text + + # pkg:gem/pry#lib/pry/helpers/text.rb:23 + def black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def black_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def black_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def black_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def black_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def black_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def black_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def black_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def black_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def black_on_yellow(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:23 + def blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def blue_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def blue_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def blue_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def blue_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def blue_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def blue_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def blue_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def blue_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def blue_on_yellow(text); end + + # Returns _text_ as bold text for use on a terminal. + # + # @param [String, #to_s] text + # @return [String] _text_ + # + # pkg:gem/pry#lib/pry/helpers/text.rb:54 + def bold(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:27 + def bright_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_black_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_black_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_black_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_black_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_black_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_black_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_black_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_black_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_black_on_yellow(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:27 + def bright_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_blue_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_blue_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_blue_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_blue_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_blue_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_blue_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_blue_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_blue_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_blue_on_yellow(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:27 + def bright_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_cyan_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_cyan_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_cyan_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_cyan_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_cyan_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_cyan_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_cyan_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_cyan_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_cyan_on_yellow(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:27 + def bright_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_green_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_green_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_green_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_green_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_green_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_green_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_green_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_green_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_green_on_yellow(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:27 + def bright_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_magenta_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_magenta_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_magenta_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_magenta_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_magenta_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_magenta_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_magenta_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_magenta_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_magenta_on_yellow(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:27 + def bright_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_purple_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_purple_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_purple_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_purple_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_purple_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_purple_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_purple_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_purple_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_purple_on_yellow(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:27 + def bright_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_red_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_red_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_red_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_red_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_red_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_red_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_red_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_red_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_red_on_yellow(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:27 + def bright_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_white_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_white_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_white_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_white_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_white_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_white_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_white_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_white_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_white_on_yellow(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:27 + def bright_yellow(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_yellow_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_yellow_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_yellow_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_yellow_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_yellow_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_yellow_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_yellow_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_yellow_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:36 + def bright_yellow_on_yellow(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:23 + def cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def cyan_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def cyan_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def cyan_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def cyan_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def cyan_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def cyan_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def cyan_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def cyan_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def cyan_on_yellow(text); end + + # Returns `text` in the default foreground colour. + # Use this instead of "black" or "white" when you mean absence of colour. + # + # @param [String, #to_s] text + # @return [String] + # + # pkg:gem/pry#lib/pry/helpers/text.rb:63 + def default(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:23 + def green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def green_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def green_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def green_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def green_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def green_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def green_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def green_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def green_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def green_on_yellow(text); end + + # Returns _text_ indented by _chars_ spaces. + # + # @param [String] text + # @param [Fixnum] chars + # + # pkg:gem/pry#lib/pry/helpers/text.rb:113 + def indent(text, chars); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:23 + def magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def magenta_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def magenta_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def magenta_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def magenta_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def magenta_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def magenta_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def magenta_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def magenta_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def magenta_on_yellow(text); end + + # @yield + # Yields a block with color turned off. + # + # @return [void] + # + # pkg:gem/pry#lib/pry/helpers/text.rb:73 + def no_color; end + + # @yield + # Yields a block with paging turned off. + # + # @return [void] + # + # pkg:gem/pry#lib/pry/helpers/text.rb:87 + def no_pager; end + + # pkg:gem/pry#lib/pry/helpers/text.rb:23 + def purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def purple_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def purple_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def purple_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def purple_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def purple_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def purple_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def purple_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def purple_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def purple_on_yellow(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:23 + def red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def red_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def red_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def red_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def red_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def red_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def red_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def red_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def red_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def red_on_yellow(text); end + + # Remove any color codes from _text_. + # + # @param [String, #to_s] text + # @return [String] _text_ stripped of any color codes. + # + # pkg:gem/pry#lib/pry/helpers/text.rb:46 + def strip_color(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:23 + def white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def white_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def white_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def white_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def white_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def white_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def white_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def white_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def white_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def white_on_yellow(text); end + + # Returns _text_ in a numbered list, beginning at _offset_. + # + # @param [#each_line] text + # @param [Fixnum] offset + # @return [String] + # + # pkg:gem/pry#lib/pry/helpers/text.rb:100 + def with_line_numbers(text, offset, color = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:23 + def yellow(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def yellow_on_black(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def yellow_on_blue(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def yellow_on_cyan(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def yellow_on_green(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def yellow_on_magenta(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def yellow_on_purple(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def yellow_on_red(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def yellow_on_white(text); end + + # pkg:gem/pry#lib/pry/helpers/text.rb:32 + def yellow_on_yellow(text); end +end + +# pkg:gem/pry#lib/pry/helpers/text.rb:10 +Pry::Helpers::Text::COLORS = T.let(T.unsafe(nil), Hash) + +# The History class is responsible for maintaining the user's input history, +# both internally and within Readline. +# +# pkg:gem/pry#lib/pry/history.rb:6 +class Pry::History + # pkg:gem/pry#lib/pry/history.rb:29 + def initialize(options = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/history.rb:70 + def <<(line); end + + # Clear this session's history. This won't affect the contents of the + # history file. + # + # pkg:gem/pry#lib/pry/history.rb:74 + def clear; end + + # Filter the history with the histignore options + # @return [Array] An array containing all the lines that are not + # included in the histignore. + # + # pkg:gem/pry#lib/pry/history.rb:95 + def filter(history); end + + # @return [Integer] total number of lines, including original lines + # + # pkg:gem/pry#lib/pry/history.rb:27 + def history_line_count; end + + # Load the input history using `History.loader`. + # @return [Integer] The number of lines loaded + # + # pkg:gem/pry#lib/pry/history.rb:40 + def load; end + + # pkg:gem/pry#lib/pry/history.rb:21 + def loader; end + + # pkg:gem/pry#lib/pry/history.rb:21 + def loader=(_arg0); end + + # @return [Fixnum] Number of lines in history when Pry first loaded. + # + # pkg:gem/pry#lib/pry/history.rb:24 + def original_lines; end + + # Add a line to the input history, ignoring blank and duplicate lines. + # @param [String] line + # @return [String] The same line that was passed in + # + # pkg:gem/pry#lib/pry/history.rb:53 + def push(line); end + + # pkg:gem/pry#lib/pry/history.rb:21 + def saver; end + + # pkg:gem/pry#lib/pry/history.rb:21 + def saver=(_arg0); end + + # @return [Fixnum] The number of lines in history from just this session. + # + # pkg:gem/pry#lib/pry/history.rb:81 + def session_line_count; end + + # Return an Array containing all stored history. + # @return [Array] An Array containing all lines of history loaded + # or entered by the user in the current session. + # + # pkg:gem/pry#lib/pry/history.rb:88 + def to_a; end + + private + + # The history file, opened for appending. + # + # pkg:gem/pry#lib/pry/history.rb:127 + def history_file; end + + # pkg:gem/pry#lib/pry/history.rb:143 + def history_file_path; end + + # pkg:gem/pry#lib/pry/history.rb:147 + def invalid_readline_line?(line); end + + # The default loader. Yields lines from `Pry.config.history_file`. + # + # pkg:gem/pry#lib/pry/history.rb:113 + def read_from_file; end + + # The default saver. Appends the given line to `Pry.config.history_file`. + # + # pkg:gem/pry#lib/pry/history.rb:122 + def save_to_file(line); end + + # Check if the line match any option in the histignore + # [Pry.config.history_ignorelist] + # @return [Boolean] a boolean that notifies if the line was found in the + # histignore array. + # + # pkg:gem/pry#lib/pry/history.rb:105 + def should_ignore?(line); end + + class << self + # pkg:gem/pry#lib/pry/history.rb:7 + def default_file; end + end +end + +# Implements a hooks system for Pry. A hook is a callable that is associated +# with an event. A number of events are currently provided by Pry, these +# include: `:when_started`, `:before_session`, `:after_session`. A hook must +# have a name, and is connected with an event by the `Pry::Hooks#add_hook` +# method. +# +# @example Adding a hook for the `:before_session` event. +# Pry.config.hooks.add_hook(:before_session, :say_hi) do +# puts "hello" +# end +# +# pkg:gem/pry#lib/pry/hooks.rb:14 +class Pry::Hooks + # pkg:gem/pry#lib/pry/hooks.rb:25 + def initialize; end + + # Add a new hook to be executed for the `event_name` event. + # @param [Symbol] event_name The name of the event. + # @param [Symbol] hook_name The name of the hook. + # @param [#call] callable The callable. + # @yield The block to use as the callable (if no `callable` provided). + # @return [Pry:Hooks] The receiver. + # + # pkg:gem/pry#lib/pry/hooks.rb:81 + def add_hook(event_name, hook_name, callable = T.unsafe(nil), &block); end + + # Clear all hooks functions for a given event. + # + # @param [String] event_name The name of the event. + # @return [void] + # + # pkg:gem/pry#lib/pry/hooks.rb:165 + def clear_event_hooks(event_name); end + + # @param [Symbol] event_name The name of the event. + # @param [Symbol] hook_name The name of the hook. + # to delete. + # @return [#call] The deleted hook. + # + # pkg:gem/pry#lib/pry/hooks.rb:147 + def delete_hook(event_name, hook_name); end + + # pkg:gem/pry#lib/pry/hooks.rb:39 + def errors; end + + # Execute the list of hooks for the `event_name` event. + # @param [Symbol] event_name The name of the event. + # @param [Array] args The arguments to pass to each hook function. + # @return [Object] The return value of the last executed hook. + # + # pkg:gem/pry#lib/pry/hooks.rb:108 + def exec_hook(event_name, *args, &block); end + + # @param [Symbol] event_name The name of the event. + # @param [Symbol] hook_name The name of the hook + # @return [#call] a specific hook for a given event. + # + # pkg:gem/pry#lib/pry/hooks.rb:128 + def get_hook(event_name, hook_name); end + + # @param [Symbol] event_name The name of the event. + # @return [Hash] The hash of hook names / hook functions. + # @note Modifying the returned hash does not alter the hooks, use + # `add_hook`/`delete_hook` for that. + # + # pkg:gem/pry#lib/pry/hooks.rb:139 + def get_hooks(event_name); end + + # @param [Symbol] event_name The name of the event. + # @return [Fixnum] The number of hook functions for `event_name`. + # + # pkg:gem/pry#lib/pry/hooks.rb:121 + def hook_count(event_name); end + + # @param [Symbol] event_name Name of the event. + # @param [Symbol] hook_name Name of the hook. + # @return [Boolean] Whether the hook by the name `hook_name`. + # + # pkg:gem/pry#lib/pry/hooks.rb:172 + def hook_exists?(event_name, hook_name); end + + # @example + # hooks = Pry::Hooks.new.add_hook(:before_session, :say_hi) { puts "hi!" } + # Pry::Hooks.new.merge(hooks) + # @param [Pry::Hooks] other The `Pry::Hooks` instance to merge + # @return [Pry::Hooks] a new `Pry::Hooks` instance containing a merge of the + # contents of two `Pry:Hooks` instances. + # + # pkg:gem/pry#lib/pry/hooks.rb:69 + def merge(other); end + + # Destructively merge the contents of two `Pry:Hooks` instances. + # + # @param [Pry::Hooks] other The `Pry::Hooks` instance to merge + # @return [Pry:Hooks] The receiver. + # @see #merge + # + # pkg:gem/pry#lib/pry/hooks.rb:48 + def merge!(other); end + + protected + + # pkg:gem/pry#lib/pry/hooks.rb:178 + def hooks; end + + private + + # Ensure that duplicates have their @hooks object. + # + # pkg:gem/pry#lib/pry/hooks.rb:30 + def initialize_copy(_orig); end + + class << self + # pkg:gem/pry#lib/pry/hooks.rb:15 + def default; end + end +end + +# Pry::Indent is a class that can be used to indent a number of lines +# containing Ruby code similar as to how IRB does it (but better). The class +# works by tokenizing a string using CodeRay and then looping over those +# tokens. Based on the tokens in a line of code that line (or the next one) +# will be indented or un-indented by correctly. +# +# pkg:gem/pry#lib/pry/indent.rb:11 +class Pry::Indent + include ::Pry::Helpers::BaseHelpers + + # pkg:gem/pry#lib/pry/indent.rb:107 + def initialize(pry_instance = T.unsafe(nil)); end + + # Return a string which, when printed, will rewrite the previous line with + # the correct indentation. Mostly useful for fixing 'end'. + # + # @param [String] prompt The user's prompt + # @param [String] code The code the user just typed in + # @param [Integer] overhang The number of characters to erase afterwards (the + # the difference in length between the old line and the new one) + # + # @return [String] correctly indented line + # + # pkg:gem/pry#lib/pry/indent.rb:395 + def correct_indentation(prompt, code, overhang = T.unsafe(nil)); end + + # Get the indentation for the start of the next line. + # + # This is what's used between the prompt and the cursor in pry. + # + # @return String The correct number of spaces + # + # pkg:gem/pry#lib/pry/indent.rb:185 + def current_prefix; end + + # If the code just before an "if" or "while" token on a line looks like the + # end of a statement, then we want to treat that "if" as a singleline, not + # multiline statement. + # + # pkg:gem/pry#lib/pry/indent.rb:268 + def end_of_statement?(last_token, last_kind); end + + # Are we currently in the middle of a string literal. + # + # This is used to determine whether to re-indent a given line, we mustn't + # re-indent within string literals because to do so would actually change + # the value of the String! + # + # @return Boolean + # + # pkg:gem/pry#lib/pry/indent.rb:279 + def in_string?; end + + # Indents a string and returns it. This string can either be a single line + # or multiple ones. + # + # @example + # str = <] + # + # pkg:gem/pry#lib/pry/indent.rb:378 + def module_nesting; end + + # All the open delimiters, in the order that they first appeared. + # + # @return [String] + # + # pkg:gem/pry#lib/pry/indent.rb:314 + def open_delimiters; end + + # Return a string which restores the CodeRay string status to the correct value by + # opening HEREDOCs and strings. + # + # @return String + # + # pkg:gem/pry#lib/pry/indent.rb:322 + def open_delimiters_line; end + + # reset internal state + # + # pkg:gem/pry#lib/pry/indent.rb:113 + def reset; end + + # @return [Array] The stack of open tokens. + # + # pkg:gem/pry#lib/pry/indent.rb:24 + def stack; end + + # Given a string of Ruby code, use CodeRay to export the tokens. + # + # @param [String] string The Ruby to lex + # @return [Array] An Array of pairs of [token_value, token_type] + # + # pkg:gem/pry#lib/pry/indent.rb:287 + def tokenize(string); end + + # Update the internal state about what kind of strings are open. + # + # Most of the complication here comes from the fact that HEREDOCs can be + # nested. For normal strings (which can't be nested) we assume that CodeRay + # correctly pairs open-and-close delimiters so we don't bother checking what + # they are. + # + # @param [String] token The token (of type :delimiter) + # + # pkg:gem/pry#lib/pry/indent.rb:299 + def track_delimiter(token); end + + # Update the internal state relating to module nesting. + # + # It's responsible for adding to the @module_nesting array, which looks + # something like: + # + # [ ["class", "Foo"], ["module", "Bar::Baz"], ["class <<", "self"] ] + # + # A nil value in the @module_nesting array happens in two places: either + # when @awaiting_class is true and we're still waiting for the string to + # fill that space, or when a parse was rejected. + # + # At the moment this function is quite restricted about what formats it will + # parse, for example we disallow expressions after the class keyword. This + # could maybe be improved in the future. + # + # @param [String] token a token from Coderay + # @param [Symbol] kind the kind of that token + # + # pkg:gem/pry#lib/pry/indent.rb:343 + def track_module_nesting(token, kind); end + + # Update the internal state relating to module nesting on 'end'. + # + # If the current 'end' pairs up with a class or a module then we should + # pop an array off of @module_nesting + # + # @param [String] token a token from Coderay + # @param [Symbol] kind the kind of that token + # + # pkg:gem/pry#lib/pry/indent.rb:368 + def track_module_nesting_end(token, kind = T.unsafe(nil)); end + + class << self + # Clean the indentation of a fragment of ruby. + # + # @param [String] str + # @return [String] + # + # pkg:gem/pry#lib/pry/indent.rb:85 + def indent(str); end + + # Get the module nesting at the given point in the given string. + # + # NOTE If the line specified contains a method definition, then the nesting + # at the start of the method definition is used. Otherwise the nesting from + # the end of the line is used. + # + # @param [String] str The ruby code to analyze + # @param [Fixnum] line_number The line number (starting from 1) + # @return [Array] + # + # pkg:gem/pry#lib/pry/indent.rb:98 + def nesting_at(str, line_number); end + end +end + +# Collection of token types that should be ignored. Without this list +# keywords such as "class" inside strings would cause the code to be +# indented incorrectly. +# +# :pre_constant and :preserved_constant are the CodeRay 0.9.8 and 1.0.0 +# classifications of "true", "false", and "nil". +# +# pkg:gem/pry#lib/pry/indent.rb:63 +Pry::Indent::IGNORE_TOKENS = T.let(T.unsafe(nil), Array) + +# Collection of tokens that should appear dedented even though they +# don't affect the surrounding code. +# +# pkg:gem/pry#lib/pry/indent.rb:79 +Pry::Indent::MIDWAY_TOKENS = T.let(T.unsafe(nil), Array) + +# Hash containing all the tokens that should increase the indentation +# level. The keys of this hash are open tokens, the values the matching +# tokens that should prevent a line from being indented if they appear on +# the same line. +# +# pkg:gem/pry#lib/pry/indent.rb:33 +Pry::Indent::OPEN_TOKENS = T.let(T.unsafe(nil), Hash) + +# Which tokens can be followed by an optional "do" keyword. +# +# pkg:gem/pry#lib/pry/indent.rb:55 +Pry::Indent::OPTIONAL_DO_TOKENS = T.let(T.unsafe(nil), Array) + +# Which tokens can either be open tokens, or appear as modifiers on +# a single-line. +# +# pkg:gem/pry#lib/pry/indent.rb:52 +Pry::Indent::SINGLELINE_TOKENS = T.let(T.unsafe(nil), Array) + +# The amount of spaces to insert for each indent level. +# +# pkg:gem/pry#lib/pry/indent.rb:27 +Pry::Indent::SPACES = T.let(T.unsafe(nil), String) + +# Tokens that indicate the end of a statement (i.e. that, if they appear +# directly before an "if" indicates that that if applies to the same line, +# not the next line) +# +# :reserved and :keywords are the CodeRay 0.9.8 and 1.0.0 respectively +# classifications of "super", "next", "return", etc. +# +# pkg:gem/pry#lib/pry/indent.rb:72 +Pry::Indent::STATEMENT_END_TOKENS = T.let(T.unsafe(nil), Array) + +# Raised if {#module_nesting} would not work. +# +# pkg:gem/pry#lib/pry/indent.rb:15 +class Pry::Indent::UnparseableNestingError < ::StandardError; end + +# pkg:gem/pry#lib/pry/input/simple_stdio.rb:4 +module Pry::Input; end + +# Readline replacement for low-capability terminals. +# +# pkg:gem/pry#lib/pry/input/simple_stdio.rb:6 +class Pry::Input::SimpleStdio + class << self + # pkg:gem/pry#lib/pry/input/simple_stdio.rb:7 + def readline(prompt); end + end +end + +# pkg:gem/pry#lib/pry/input_completer.rb:6 +class Pry::InputCompleter + # pkg:gem/pry#lib/pry/input_completer.rb:42 + def initialize(input, pry = T.unsafe(nil)); end + + # build_path separates the input into two parts: path and input. + # input is the partial string that should be completed + # path is a proc that takes an input and builds a full path. + # + # pkg:gem/pry#lib/pry/input_completer.rb:240 + def build_path(input); end + + # Return a new completion proc for use by Readline. + # + # pkg:gem/pry#lib/pry/input_completer.rb:56 + def call(str, options = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/input_completer.rb:255 + def ignored_modules; end + + # pkg:gem/pry#lib/pry/input_completer.rb:229 + def select_message(path, receiver, message, candidates); end +end + +# pkg:gem/pry#lib/pry/input_completer.rb:8 +Pry::InputCompleter::ARRAY_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/pry#lib/pry/input_completer.rb:15 +Pry::InputCompleter::CONSTANT_OR_METHOD_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/pry#lib/pry/input_completer.rb:14 +Pry::InputCompleter::CONSTANT_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/pry#lib/pry/input_completer.rb:17 +Pry::InputCompleter::GLOBALVARIABLE_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/pry#lib/pry/input_completer.rb:16 +Pry::InputCompleter::HEX_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/pry#lib/pry/input_completer.rb:7 +Pry::InputCompleter::NUMERIC_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/pry#lib/pry/input_completer.rb:12 +Pry::InputCompleter::PROC_OR_HASH_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/pry#lib/pry/input_completer.rb:11 +Pry::InputCompleter::REGEX_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/pry#lib/pry/input_completer.rb:20 +Pry::InputCompleter::RESERVED_WORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/pry#lib/pry/input_completer.rb:10 +Pry::InputCompleter::SYMBOL_METHOD_CALL_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/pry#lib/pry/input_completer.rb:9 +Pry::InputCompleter::SYMBOL_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/pry#lib/pry/input_completer.rb:13 +Pry::InputCompleter::TOPLEVEL_LOOKUP_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/pry#lib/pry/input_completer.rb:18 +Pry::InputCompleter::VARIABLE_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/pry#lib/pry/input_completer.rb:40 +Pry::InputCompleter::WORD_ESCAPE_STR = T.let(T.unsafe(nil), String) + +# There is one InputLock per input (such as STDIN) as two REPLs on the same +# input makes things delirious. InputLock serializes accesses to the input so +# that threads to not conflict with each other. The latest thread to request +# ownership of the input wins. +# +# pkg:gem/pry#lib/pry/input_lock.rb:8 +class Pry::InputLock + # pkg:gem/pry#lib/pry/input_lock.rb:29 + def initialize; end + + # Adds ourselves to the ownership list. The last one in the list may access + # the input through interruptible_region(). + # + # pkg:gem/pry#lib/pry/input_lock.rb:38 + def __with_ownership; end + + # pkg:gem/pry#lib/pry/input_lock.rb:81 + def enter_interruptible_region; end + + # pkg:gem/pry#lib/pry/input_lock.rb:108 + def interruptible_region; end + + # pkg:gem/pry#lib/pry/input_lock.rb:95 + def leave_interruptible_region; end + + # pkg:gem/pry#lib/pry/input_lock.rb:75 + def with_ownership(&block); end + + class << self + # pkg:gem/pry#lib/pry/input_lock.rb:19 + def for(input); end + + # pkg:gem/pry#lib/pry/input_lock.rb:13 + def global_lock; end + + # pkg:gem/pry#lib/pry/input_lock.rb:13 + def global_lock=(_arg0); end + + # pkg:gem/pry#lib/pry/input_lock.rb:12 + def input_locks; end + + # pkg:gem/pry#lib/pry/input_lock.rb:12 + def input_locks=(_arg0); end + end +end + +# pkg:gem/pry#lib/pry/input_lock.rb:9 +class Pry::InputLock::Interrupt < ::Exception; end + +# pkg:gem/pry#lib/pry/inspector.rb:4 +class Pry::Inspector; end + +# pkg:gem/pry#lib/pry/inspector.rb:5 +Pry::Inspector::MAP = T.let(T.unsafe(nil), Hash) + +# pkg:gem/pry#lib/pry/pry_class.rb:7 +Pry::LOCAL_RC_FILE = T.let(T.unsafe(nil), String) + +# pkg:gem/pry#lib/pry/last_exception.rb:12 +class Pry::LastException < ::BasicObject + # pkg:gem/pry#lib/pry/last_exception.rb:15 + def initialize(exception); end + + # pkg:gem/pry#lib/pry/last_exception.rb:13 + def bt_index; end + + # pkg:gem/pry#lib/pry/last_exception.rb:13 + def bt_index=(_arg0); end + + # pkg:gem/pry#lib/pry/last_exception.rb:52 + def bt_source_location_for(index); end + + # @return [String] + # returns the path to a file for the current backtrace. see {#bt_index}. + # + # pkg:gem/pry#lib/pry/last_exception.rb:37 + def file; end + + # pkg:gem/pry#lib/pry/last_exception.rb:57 + def inc_bt_index; end + + # @return [Fixnum] + # returns the line for the current backtrace. see {#bt_index}. + # + # pkg:gem/pry#lib/pry/last_exception.rb:43 + def line; end + + # pkg:gem/pry#lib/pry/last_exception.rb:21 + def method_missing(name, *args, &block); end + + # @return [Exception] + # returns the wrapped exception + # + # pkg:gem/pry#lib/pry/last_exception.rb:48 + def wrapped_exception; end + + private + + # pkg:gem/pry#lib/pry/last_exception.rb:29 + def respond_to_missing?(name, include_all = T.unsafe(nil)); end +end + +# This class wraps the normal `Method` and `UnboundMethod` classes +# to provide extra functionality useful to Pry. +# +# pkg:gem/pry#lib/pry/method.rb:20 +class Pry::Method + include ::Pry::Helpers::BaseHelpers + include ::Pry::Helpers::DocumentationHelpers + include ::Pry::CodeObject::Helpers + extend ::Pry::Helpers::BaseHelpers + extend ::Forwardable + extend ::Pry::Forwardable + + # A new instance of `Pry::Method` wrapping the given `::Method`, + # `UnboundMethod`, or `Proc`. + # + # @param [::Method, UnboundMethod, Proc] method + # @param [Hash] known_info Can be used to pre-cache expensive to compute stuff. + # @return [Pry::Method] + # + # pkg:gem/pry#lib/pry/method.rb:263 + def initialize(method, known_info = T.unsafe(nil)); end + + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/method.rb:483 + def ==(other); end + + # @return [Boolean] Is the method definitely an alias? + # + # pkg:gem/pry#lib/pry/method.rb:478 + def alias?; end + + # @return [Array] All known aliases for the method. + # + # pkg:gem/pry#lib/pry/method.rb:461 + def aliases; end + + # @return [Boolean] Whether the method is bound. + # + # pkg:gem/pry#lib/pry/method.rb:446 + def bound_method?; end + + # pkg:gem/pry#lib/pry/method.rb:515 + def comment; end + + # @return [String, nil] The documentation for the method, or `nil` if it's + # unavailable. + # + # pkg:gem/pry#lib/pry/method.rb:329 + def doc; end + + # @return [Boolean] Was the method defined outside a source file? + # + # pkg:gem/pry#lib/pry/method.rb:436 + def dynamically_defined?; end + + # @param [Class] klass + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/method.rb:491 + def is_a?(klass); end + + # pkg:gem/pry#lib/pry/method.rb:494 + def kind_of?(klass); end + + # Delegate any unknown calls to the wrapped method. + # + # pkg:gem/pry#lib/pry/method.rb:503 + def method_missing(method_name, *args, &block); end + + # Get the name of the method as a String, regardless of the underlying + # Method#name type. + # + # @return [String] + # + # pkg:gem/pry#lib/pry/method.rb:272 + def name; end + + # Get the name of the method including the class on which it was defined. + # @example + # method(:puts).method_name + # => "Kernel.puts" + # @return [String] + # + # pkg:gem/pry#lib/pry/method.rb:299 + def name_with_owner; end + + # @return [String, nil] The original name the method was defined under, + # before any aliasing, or `nil` if it can't be determined. + # + # pkg:gem/pry#lib/pry/method.rb:429 + def original_name; end + + # pkg:gem/pry#lib/pry/method.rb:255 + def owner(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/method.rb:255 + def parameters(*args, **_arg1, &block); end + + # @return [Boolean] Was the method defined within the Pry REPL? + # + # pkg:gem/pry#lib/pry/method.rb:456 + def pry_method?; end + + # pkg:gem/pry#lib/pry/method.rb:255 + def receiver(*args, **_arg1, &block); end + + # Update the live copy of the method's source. + # + # pkg:gem/pry#lib/pry/method.rb:314 + def redefine(source); end + + # @param [String, Symbol] method_name + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/method.rb:498 + def respond_to?(method_name, include_all = T.unsafe(nil)); end + + # @return [String] A representation of the method's signature, including its + # name and parameters. Optional and "rest" parameters are marked with `*` + # and block parameters with `&`. Keyword arguments are shown with `:` + # If the parameter names are unavailable, they're given numbered names instead. + # Paraphrased from `awesome_print` gem. + # + # pkg:gem/pry#lib/pry/method.rb:391 + def signature; end + + # @return [Boolean] Whether the method is a singleton method. + # + # pkg:gem/pry#lib/pry/method.rb:451 + def singleton_method?; end + + # @return [String, nil] The source code of the method, or `nil` if it's unavailable. + # + # pkg:gem/pry#lib/pry/method.rb:304 + def source; end + + # Can we get the source code for this method? + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/method.rb:321 + def source?; end + + # @return [String, nil] The name of the file the method is defined in, or + # `nil` if the filename is unavailable. + # + # pkg:gem/pry#lib/pry/method.rb:348 + def source_file; end + + # @return [Fixnum, nil] The line of code in `source_file` which begins + # the method's definition, or `nil` if that information is unavailable. + # + # pkg:gem/pry#lib/pry/method.rb:361 + def source_line; end + + # @return [Range, nil] The range of lines in `source_file` which contain + # the method's definition, or `nil` if that information is unavailable. + # + # pkg:gem/pry#lib/pry/method.rb:367 + def source_range; end + + # @return [Symbol] The source type of the method. The options are + # `:ruby` for Ruby methods or `:c` for methods written in C. + # + # pkg:gem/pry#lib/pry/method.rb:342 + def source_type; end + + # @return [Pry::Method, nil] The wrapped method that is called when you + # use "super" in the body of this method. + # + # pkg:gem/pry#lib/pry/method.rb:417 + def super(times = T.unsafe(nil)); end + + # @return [Boolean] Whether the method is unbound. + # + # pkg:gem/pry#lib/pry/method.rb:441 + def unbound_method?; end + + # Is the method undefined? (aka `Disowned`) + # @return [Boolean] false + # + # pkg:gem/pry#lib/pry/method.rb:290 + def undefined?; end + + # @return [Symbol] The visibility of the method. May be `:public`, + # `:protected`, or `:private`. + # + # pkg:gem/pry#lib/pry/method.rb:373 + def visibility; end + + # Get underlying object wrapped by this Pry::Method instance + # @return [Method, UnboundMethod, Proc] + # + # pkg:gem/pry#lib/pry/method.rb:284 + def wrapped; end + + # Get the owner of the method as a Pry::Module + # @return [Pry::Module] + # + # pkg:gem/pry#lib/pry/method.rb:278 + def wrapped_owner; end + + private + + # pkg:gem/pry#lib/pry/method.rb:577 + def c_source; end + + # @param [String] first_ln The first line of a method definition. + # @return [String, nil] + # + # pkg:gem/pry#lib/pry/method.rb:564 + def method_name_from_first_line(first_ln); end + + # @return [YARD::CodeObjects::MethodObject] + # @raise [CommandError] when the method can't be found or `pry-doc` isn't installed. + # + # pkg:gem/pry#lib/pry/method.rb:523 + def pry_doc_info; end + + # pkg:gem/pry#lib/pry/method.rb:511 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/method.rb:582 + def ruby_source; end + + # @param [Class, Module] ancestors The ancestors to investigate + # @return [Method] The unwrapped super-method + # + # pkg:gem/pry#lib/pry/method.rb:543 + def super_using_ancestors(ancestors, times = T.unsafe(nil)); end + + class << self + # Get all of the instance methods of a `Class` or `Module` + # @param [Class,Module] klass + # @param [Boolean] include_super Whether to include methods from ancestors. + # @return [Array[Pry::Method]] + # + # pkg:gem/pry#lib/pry/method.rb:161 + def all_from_class(klass, include_super = T.unsafe(nil)); end + + # Get all of the methods on an `Object` + # + # @param [Object] obj + # + # @param [Boolean] include_super + # indicates whether or not to include methods from ancestors. + # + # @return [Array[Pry::Method]] + # + # pkg:gem/pry#lib/pry/method.rb:184 + def all_from_obj(obj, include_super = T.unsafe(nil)); end + + # Given a `Binding`, try to extract the `::Method` it originated from and + # use it to instantiate a `Pry::Method`. Return `nil` if this isn't + # possible. + # + # @param [Binding] binding + # @return [Pry::Method, nil] + # + # pkg:gem/pry#lib/pry/method.rb:77 + def from_binding(binding); end + + # Given a `Class` or `Module` and the name of a method, try to + # instantiate a `Pry::Method` containing the instance method of + # that name. Return `nil` if no such method exists. + # + # @param [Class, Module] klass + # @param [String] name + # @param [Binding] target The binding where the method is looked up. + # @return [Pry::Method, nil] + # + # pkg:gem/pry#lib/pry/method.rb:136 + def from_class(klass, name, target = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/method.rb:141 + def from_module(klass, name, target = T.unsafe(nil)); end + + # Given an object and the name of a method, try to instantiate + # a `Pry::Method` containing the method of that name bound to + # that object. Return `nil` if no such method exists. + # + # @param [Object] obj + # @param [String] name + # @param [Binding] target The binding where the method is looked up. + # @return [Pry::Method, nil] + # + # pkg:gem/pry#lib/pry/method.rb:151 + def from_obj(obj, name, target = T.unsafe(nil)); end + + # Given a string representing a method name and optionally a binding to + # search in, find and return the requested method wrapped in a + # `Pry::Method` instance. + # + # @param [String] name The name of the method to retrieve. + # @param [Binding] target The context in which to search for the method. + # @param [Hash] options + # @option options [Boolean] :instance Look for an instance method if + # `name` doesn't contain any context. + # @option options [Boolean] :methods Look for a bound/singleton method if + # `name` doesn't contain any context. + # @return [Pry::Method, nil] A `Pry::Method` instance containing the + # requested method, or `nil` if name is `nil` or no method could be + # located matching the parameters. + # + # pkg:gem/pry#lib/pry/method.rb:43 + def from_str(name, target = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/method.rb:227 + def instance_method_definition?(name, definition_line); end + + # Get every `Class` and `Module`, in order, that will be checked when looking + # for methods on instances of the given `Class` or `Module`. + # This does not treat singleton classes of classes specially. + # @param [Class, Module] klass + # @return [Array[Class, Module]] + # + # pkg:gem/pry#lib/pry/method.rb:210 + def instance_resolution_order(klass); end + + # In order to support 2.0 Refinements we need to look up methods + # inside the relevant Binding. + # @param [Object] obj The owner/receiver of the method. + # @param [Symbol] method_name The name of the method. + # @param [Symbol] method_type The type of method: :method or :instance_method + # @param [Binding] target The binding where the method is looked up. + # @return [Method, UnboundMethod] The 'refined' method object. + # + # pkg:gem/pry#lib/pry/method.rb:114 + def lookup_method_via_binding(obj, method_name, method_type, target = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/method.rb:215 + def method_definition?(name, definition_line); end + + # Get every `Class` and `Module`, in order, that will be checked when looking + # for an instance method to call on this object. + # @param [Object] obj + # @return [Array[Class, Module]] + # + # pkg:gem/pry#lib/pry/method.rb:192 + def resolution_order(obj); end + + # pkg:gem/pry#lib/pry/method.rb:247 + def singleton_class_of(obj); end + + # Get the singleton classes of superclasses that could define methods on + # the given class object, and any modules they include. + # If a module is included at multiple points in the ancestry, only + # the lowest copy will be returned. + # + # pkg:gem/pry#lib/pry/method.rb:238 + def singleton_class_resolution_order(klass); end + + # pkg:gem/pry#lib/pry/method.rb:220 + def singleton_method_definition?(name, definition_line); end + end +end + +# A Disowned Method is one that's been removed from the class on which it was defined. +# +# e.g. +# class C +# def foo +# C.send(:undefine_method, :foo) +# Pry::Method.from_binding(binding) +# end +# end +# +# In this case we assume that the "owner" is the singleton class of the receiver. +# +# This occurs mainly in Sinatra applications. +# +# pkg:gem/pry#lib/pry/method/disowned.rb:18 +class Pry::Method::Disowned < ::Pry::Method + # Create a new Disowned method. + # + # @param [Object] receiver + # @param [String] method_name + # + # pkg:gem/pry#lib/pry/method/disowned.rb:25 + def initialize(receiver, method_name); end + + # Raise a more useful error message instead of trying to forward to nil. + # + # pkg:gem/pry#lib/pry/method/disowned.rb:52 + def method_missing(method_name, *args, &block); end + + # pkg:gem/pry#lib/pry/method/disowned.rb:19 + def name; end + + # Get the hypothesized owner of the method. + # + # @return [Object] + # + # pkg:gem/pry#lib/pry/method/disowned.rb:46 + def owner; end + + # pkg:gem/pry#lib/pry/method/disowned.rb:19 + def receiver; end + + # Can we get the source for this method? + # @return [Boolean] false + # + # pkg:gem/pry#lib/pry/method/disowned.rb:39 + def source?; end + + # Is the method undefined? (aka `Disowned`) + # @return [Boolean] true + # + # pkg:gem/pry#lib/pry/method/disowned.rb:33 + def undefined?; end + + private + + # pkg:gem/pry#lib/pry/method/disowned.rb:62 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end +end + +# pkg:gem/pry#lib/pry/method/patcher.rb:5 +class Pry::Method::Patcher + # pkg:gem/pry#lib/pry/method/patcher.rb:12 + def initialize(method); end + + # pkg:gem/pry#lib/pry/method/patcher.rb:6 + def method; end + + # pkg:gem/pry#lib/pry/method/patcher.rb:6 + def method=(_arg0); end + + # perform the patch + # + # pkg:gem/pry#lib/pry/method/patcher.rb:21 + def patch_in_ram(source); end + + private + + # pkg:gem/pry#lib/pry/method/patcher.rb:38 + def cache_key; end + + # Update the definition line so that it can be eval'd directly on the Method's + # owner instead of from the original context. + # + # In particular this takes `def self.foo` and turns it into `def foo` so that we + # don't end up creating the method on the singleton class of the singleton class + # by accident. + # + # This is necessarily done by String manipulation because we can't find out what + # syntax is needed for the argument list by ruby-level introspection. + # + # @param [String] line The original definition line. e.g. def self.foo(bar, baz=1) + # @return [String] The new definition line. e.g. def foo(bar, baz=1) + # + # pkg:gem/pry#lib/pry/method/patcher.rb:78 + def definition_for_owner(line); end + + # pkg:gem/pry#lib/pry/method/patcher.rb:33 + def redefine(source); end + + # Run some code ensuring that at the end target#meth_name will not have changed. + # + # When we're redefining aliased methods we will overwrite the method at the + # unaliased name (so that super continues to work). By wrapping that code in a + # translation we make that not happen, which means that alias_method_chains, etc. + # continue to work. + # + # pkg:gem/pry#lib/pry/method/patcher.rb:49 + def with_method_transaction; end + + # Apply wrap_for_owner and wrap_for_nesting successively to `source` + # @param [String] source + # @return [String] The wrapped source. + # + # pkg:gem/pry#lib/pry/method/patcher.rb:91 + def wrap(source); end + + # Update the new source code to have the correct Module.nesting. + # + # This method uses syntactic analysis of the original source file to determine + # the new nesting, so that we can tell the difference between: + # + # class A; def self.b; end; end + # class << A; def b; end; end + # + # The resulting code should be evaluated in the TOPLEVEL_BINDING. + # + # @param [String] source The source to wrap. + # @return [String] + # + # pkg:gem/pry#lib/pry/method/patcher.rb:122 + def wrap_for_nesting(source); end + + # Update the source code so that when it has the right owner when eval'd. + # + # This (combined with definition_for_owner) is backup for the case that + # wrap_for_nesting fails, to ensure that the method will still be defined in + # the correct place. + # + # @param [String] source The source to wrap + # @return [String] + # + # pkg:gem/pry#lib/pry/method/patcher.rb:103 + def wrap_for_owner(source); end + + class << self + # pkg:gem/pry#lib/pry/method/patcher.rb:16 + def code_for(filename); end + end +end + +# This class is responsible for locating the *real* `Pry::Method` +# object captured by a binding. +# +# Given a `Binding` from inside a method and a 'seed' Pry::Method object, +# there are primarily two situations where the seed method doesn't match +# the Binding: +# 1. The Pry::Method is from a subclass +# 2. The Pry::Method represents a method of the same name while the original +# was renamed to something else. For 1. we search vertically up the +# inheritance chain, and for 2. we search laterally along the object's +# method table. +# +# When we locate the method that matches the Binding we wrap it in +# Pry::Method and return it, or return nil if we fail. +# +# pkg:gem/pry#lib/pry/method/weird_method_locator.rb:19 +class Pry::Method::WeirdMethodLocator + # @param [Pry::Method] method The seed method. + # @param [Binding] target The Binding that captures the method + # we want to locate. + # + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:55 + def initialize(method, target); end + + # @return [Pry::Method, nil] The Pry::Method that matches the + # given binding. + # + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:62 + def find_method; end + + # @return [Boolean] Whether the Pry::Method is unrecoverable + # This usually happens when the method captured by the Binding + # has been subsequently deleted. + # + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:69 + def lost_method?; end + + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:49 + def method; end + + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:49 + def method=(_arg0); end + + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:50 + def target; end + + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:50 + def target=(_arg0); end + + private + + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:215 + def all_methods_for(obj); end + + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:167 + def expanded_source_location(source_location); end + + # it's possible in some cases that the method we find by this approach is + # a sub-method of the one we're currently in, consider: + # + # class A; def b; binding.pry; end; end + # class B < A; def b; super; end; end + # + # Given that we can normally find the source_range of methods, and that we + # know which __FILE__ and __LINE__ the binding is at, we can hope to + # disambiguate these cases. + # + # This obviously won't work if the source is unavailable for some reason, + # or if both methods have the same __FILE__ and __LINE__. + # + # @return [Pry::Method, nil] The Pry::Method representing the + # superclass method. + # + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:131 + def find_method_in_superclass; end + + # This is the case where the name of a method has changed + # (via alias_method) so we locate the Method object for the + # renamed method. + # + # @return [Pry::Method, nil] The Pry::Method representing the + # renamed method + # + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:156 + def find_renamed_method; end + + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:197 + def index_to_line_number(index); end + + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:206 + def lines_for_file(file); end + + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:80 + def normal_method?(method); end + + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:106 + def pry_file?; end + + # Use static analysis to locate the start of the method definition. + # We have the `__FILE__` and `__LINE__` from the binding and the + # original name of the method so we search up until we find a + # def/define_method, etc defining a method of the appropriate name. + # + # @return [Array] The `source_location` of the + # renamed method + # + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:184 + def renamed_method_source_location; end + + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:75 + def skip_superclass_search?; end + + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:88 + def target_file; end + + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:98 + def target_line; end + + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:84 + def target_self; end + + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:202 + def valid_file?(file); end + + class << self + # Whether the given method object matches the associated binding. + # If the method object does not match the binding, then it's + # most likely not the method captured by the binding, and we + # must commence a search. + # + # @param [Pry::Method] method + # @param [Binding] binding + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:29 + def normal_method?(method, binding); end + + # pkg:gem/pry#lib/pry/method/weird_method_locator.rb:44 + def weird_method?(method, binding); end + end +end + +# pkg:gem/pry#lib/pry/exceptions.rb:69 +class Pry::MethodNotFound < ::Pry::CommandError; end + +# pkg:gem/pry#lib/pry/command_set.rb:4 +class Pry::NoCommandError < ::StandardError + # pkg:gem/pry#lib/pry/command_set.rb:5 + def initialize(match, owner); end +end + +# `ObjectPath` implements the resolution of "object paths", which are strings +# that are similar to filesystem paths but meant for traversing Ruby objects. +# Examples of valid object paths include: +# +# x +# @foo/@bar +# "string"/upcase +# Pry/Method +# +# Object paths are mostly relevant in the context of the `cd` command. +# @see https://github.com/pry/pry/wiki/State-navigation +# +# pkg:gem/pry#lib/pry/object_path.rb:17 +class Pry::ObjectPath + # @param [String] path_string The object path expressed as a string. + # @param [Array] current_stack The current state of the binding + # stack. + # + # pkg:gem/pry#lib/pry/object_path.rb:23 + def initialize(path_string, current_stack); end + + # @return [Array] a new stack resulting from applying the given + # path to the current stack. + # + # pkg:gem/pry#lib/pry/object_path.rb:30 + def resolve; end + + private + + # pkg:gem/pry#lib/pry/object_path.rb:74 + def complete?(segment); end + + # pkg:gem/pry#lib/pry/object_path.rb:78 + def handle_failure(context, err); end +end + +# pkg:gem/pry#lib/pry/object_path.rb:18 +Pry::ObjectPath::SPECIAL_TERMS = T.let(T.unsafe(nil), Array) + +# indicates obsolete API +# +# pkg:gem/pry#lib/pry/exceptions.rb:72 +class Pry::ObsoleteError < ::StandardError; end + +# pkg:gem/pry#lib/pry/output.rb:4 +class Pry::Output + # pkg:gem/pry#lib/pry/output.rb:10 + def initialize(pry_instance); end + + # pkg:gem/pry#lib/pry/output.rb:34 + def <<(*objs); end + + # pkg:gem/pry#lib/pry/output.rb:53 + def decolorize_maybe(str); end + + # Return a screen height or the default if that fails. + # + # pkg:gem/pry#lib/pry/output.rb:74 + def height; end + + # pkg:gem/pry#lib/pry/output.rb:41 + def method_missing(method_name, *args, &block); end + + # pkg:gem/pry#lib/pry/output.rb:28 + def print(*objs); end + + # pkg:gem/pry#lib/pry/output.rb:8 + def pry_instance; end + + # pkg:gem/pry#lib/pry/output.rb:15 + def puts(*objs); end + + # @return [Array] a pair of [rows, columns] which gives the size of + # the window. If the window size cannot be determined, the default value. + # + # pkg:gem/pry#lib/pry/output.rb:61 + def size; end + + # pkg:gem/pry#lib/pry/output.rb:37 + def tty?; end + + # Return a screen width or the default if that fails. + # + # pkg:gem/pry#lib/pry/output.rb:69 + def width; end + + # pkg:gem/pry#lib/pry/output.rb:35 + def write(*objs); end + + private + + # pkg:gem/pry#lib/pry/output.rb:80 + def actual_screen_size; end + + # pkg:gem/pry#lib/pry/output.rb:125 + def ansicon_env_size; end + + # pkg:gem/pry#lib/pry/output.rb:109 + def env_size; end + + # pkg:gem/pry#lib/pry/output.rb:92 + def io_console_size; end + + # pkg:gem/pry#lib/pry/output.rb:132 + def nonzero_column?(size); end + + # pkg:gem/pry#lib/pry/output.rb:114 + def readline_size; end + + # pkg:gem/pry#lib/pry/output.rb:49 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end +end + +# @return [Array] default terminal screen size [rows, cols] +# +# pkg:gem/pry#lib/pry/output.rb:6 +Pry::Output::DEFAULT_SIZE = T.let(T.unsafe(nil), Array) + +# pkg:gem/pry#lib/pry/pager.rb:7 +class Pry::Pager + # pkg:gem/pry#lib/pry/pager.rb:13 + def initialize(pry_instance); end + + # Yields a pager object (`NullPager`, `SimplePager`, or `SystemPager`). + # All pagers accept output with `#puts`, `#print`, `#write`, and `#<<`. + # + # pkg:gem/pry#lib/pry/pager.rb:33 + def open; end + + # Send the given text through the best available pager (if + # `Pry.config.pager` is enabled). If you want to send text through in + # chunks as you generate it, use `open` to get a writable object + # instead. + # + # @param [String] text + # Text to run through a pager. + # + # pkg:gem/pry#lib/pry/pager.rb:25 + def page(text); end + + # pkg:gem/pry#lib/pry/pager.rb:11 + def pry_instance; end + + private + + # Return an instance of the "best" available pager class -- + # `SystemPager` if possible, `SimplePager` if `SystemPager` isn't + # available, and `NullPager` if the user has disabled paging. All + # pagers accept output with `#puts`, `#print`, `#write`, and `#<<`. You + # must call `#close` when you're done writing output to a pager, and + # you must rescue `Pry::Pager::StopPaging`. These requirements can be + # avoided by using `.open` instead. + # + # pkg:gem/pry#lib/pry/pager.rb:56 + def best_available; end + + # pkg:gem/pry#lib/pry/pager.rb:43 + def enabled?; end + + # pkg:gem/pry#lib/pry/pager.rb:47 + def output; end +end + +# `NullPager` is a "pager" that actually just prints all output as it +# comes in. Used when `Pry.config.pager` is false. +# +# pkg:gem/pry#lib/pry/pager.rb:68 +class Pry::Pager::NullPager + # pkg:gem/pry#lib/pry/pager.rb:69 + def initialize(out); end + + # pkg:gem/pry#lib/pry/pager.rb:80 + def <<(str); end + + # pkg:gem/pry#lib/pry/pager.rb:86 + def close; end + + # pkg:gem/pry#lib/pry/pager.rb:77 + def print(str); end + + # pkg:gem/pry#lib/pry/pager.rb:73 + def puts(str); end + + # pkg:gem/pry#lib/pry/pager.rb:82 + def write(str); end + + private + + # pkg:gem/pry#lib/pry/pager.rb:90 + def height; end + + # pkg:gem/pry#lib/pry/pager.rb:94 + def width; end +end + +# `PageTracker` tracks output to determine whether it's likely to take +# up a whole page. This doesn't need to be super precise, but we can +# use it for `SimplePager` and to avoid invoking the system pager +# unnecessarily. +# +# One simplifying assumption is that we don't need `#page?` to return +# `true` on the basis of an incomplete line. Long lines should be +# counted as multiple lines, but we don't have to transition from +# `false` to `true` until we see a newline. +# +# pkg:gem/pry#lib/pry/pager.rb:213 +class Pry::Pager::PageTracker + # pkg:gem/pry#lib/pry/pager.rb:214 + def initialize(rows, cols); end + + # pkg:gem/pry#lib/pry/pager.rb:231 + def page?; end + + # pkg:gem/pry#lib/pry/pager.rb:220 + def record(str); end + + # pkg:gem/pry#lib/pry/pager.rb:235 + def reset; end + + private + + # Approximation of the printable length of a given line, without the + # newline and without ANSI color codes. + # + # pkg:gem/pry#lib/pry/pager.rb:244 + def line_length(line); end +end + +# `SimplePager` is a straightforward pure-Ruby pager. We use it on +# JRuby and when we can't find a usable external pager. +# +# pkg:gem/pry#lib/pry/pager.rb:101 +class Pry::Pager::SimplePager < ::Pry::Pager::NullPager + # pkg:gem/pry#lib/pry/pager.rb:102 + def initialize(*_arg0); end + + # pkg:gem/pry#lib/pry/pager.rb:107 + def write(str); end +end + +# pkg:gem/pry#lib/pry/pager.rb:8 +class Pry::Pager::StopPaging < ::StandardError; end + +# `SystemPager` buffers output until we're pretty sure it's at least a +# page long, then invokes an external pager and starts streaming output +# to it. If `#close` is called before then, it just prints out the +# buffered content. +# +# pkg:gem/pry#lib/pry/pager.rb:129 +class Pry::Pager::SystemPager < ::Pry::Pager::NullPager + # pkg:gem/pry#lib/pry/pager.rb:161 + def initialize(*_arg0); end + + # pkg:gem/pry#lib/pry/pager.rb:181 + def close; end + + # pkg:gem/pry#lib/pry/pager.rb:168 + def write(str); end + + private + + # pkg:gem/pry#lib/pry/pager.rb:195 + def invoked_pager?; end + + # pkg:gem/pry#lib/pry/pager.rb:199 + def pager; end + + # pkg:gem/pry#lib/pry/pager.rb:191 + def write_to_pager(text); end + + class << self + # pkg:gem/pry#lib/pry/pager.rb:142 + def available?; end + + # pkg:gem/pry#lib/pry/pager.rb:130 + def default_pager; end + end +end + +# Prompt represents the Pry prompt, which can be used with Readline-like +# libraries. It defines a few default prompts (default prompt, simple prompt, +# etc) and also provides an API for adding and implementing custom prompts. +# +# @example Registering a new Pry prompt +# Pry::Prompt.add( +# :ipython, +# 'IPython-like prompt', [':', '...:'] +# ) do |_context, _nesting, pry_instance, sep| +# sep == ':' ? "In [#{pry_instance.input_ring.count}]: " : ' ...: ' +# end +# +# # Produces: +# # In [3]: def foo +# # ...: puts 'foo' +# # ...: end +# # => :foo +# # In [4]: +# +# @example Manually instantiating the Prompt class +# prompt_procs = [ +# proc { '#{rand(1)}>" }, +# proc { "#{('a'..'z').to_a.sample}*" } +# ] +# prompt = Pry::Prompt.new( +# :random, +# 'Random number or letter prompt.', +# prompt_procs +# ) +# prompt.wait_proc.call(...) #=> +# prompt.incomplete_proc.call(...) +# +# @since v0.11.0 +# @api public +# +# pkg:gem/pry#lib/pry/prompt.rb:38 +class Pry::Prompt + # @param [String] name + # @param [String] description + # @param [Array] prompt_procs + # + # pkg:gem/pry#lib/pry/prompt.rb:117 + def initialize(name, description, prompt_procs); end + + # @deprecated Use a `Pry::Prompt` instance directly + # + # pkg:gem/pry#lib/pry/prompt.rb:135 + def [](key); end + + # @return [String] + # + # pkg:gem/pry#lib/pry/prompt.rb:108 + def description; end + + # @return [Proc] the proc which builds the prompt when in the middle of an + # expression such as open method, etc. (`*`) + # + # pkg:gem/pry#lib/pry/prompt.rb:130 + def incomplete_proc; end + + # @return [String] + # + # pkg:gem/pry#lib/pry/prompt.rb:105 + def name; end + + # @return [Array] the array of procs that hold + # `[wait_proc, incomplete_proc]` + # + # pkg:gem/pry#lib/pry/prompt.rb:112 + def prompt_procs; end + + # @return [Proc] the proc which builds the wait prompt (`>`) + # + # pkg:gem/pry#lib/pry/prompt.rb:124 + def wait_proc; end + + class << self + # Retrieves a prompt. + # + # @example + # Prompt[:my_prompt] + # + # @param [Symbol] name The name of the prompt you want to access + # @return [Hash{Symbol=>Object}] + # @since v0.12.0 + # + # pkg:gem/pry#lib/pry/prompt.rb:52 + def [](name); end + + # Adds a new prompt to the prompt hash. + # + # @param [Symbol] name + # @param [String] description + # @param [Array] separators The separators to differentiate + # between prompt modes (default mode and class/method definition mode). + # The Array *must* have a size of 2. + # @yield [context, nesting, pry_instance, sep] + # @yieldparam context [Object] the context where Pry is currently in + # @yieldparam nesting [Integer] whether the context is nested + # @yieldparam pry_instance [Pry] the Pry instance + # @yieldparam separator [String] separator string + # @return [nil] + # @raise [ArgumentError] if the size of `separators` is not 2 + # @raise [ArgumentError] if `prompt_name` is already occupied + # @since v0.12.0 + # + # pkg:gem/pry#lib/pry/prompt.rb:79 + def add(name, description = T.unsafe(nil), separators = T.unsafe(nil)); end + + # @return [Hash{Symbol=>Hash}] the duplicate of the internal prompts hash + # @note Use this for read-only operations + # @since v0.12.0 + # + # pkg:gem/pry#lib/pry/prompt.rb:59 + def all; end + end +end + +# pkg:gem/pry#lib/pry/repl.rb:4 +class Pry::REPL + extend ::Forwardable + extend ::Pry::Forwardable + + # Create an instance of {REPL} wrapping the given {Pry}. + # @param [Pry] pry The instance of {Pry} that this {REPL} will control. + # @param [Hash] options Options for this {REPL} instance. + # @option options [Object] :target The initial target of the session. + # + # pkg:gem/pry#lib/pry/repl.rb:22 + def initialize(pry, options = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/repl.rb:6 + def input(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/repl.rb:6 + def output(*args, **_arg1, &block); end + + # @return [Pry] The instance of {Pry} that the user is controlling. + # + # pkg:gem/pry#lib/pry/repl.rb:9 + def pry; end + + # @return [Pry] The instance of {Pry} that the user is controlling. + # + # pkg:gem/pry#lib/pry/repl.rb:9 + def pry=(_arg0); end + + # Start the read-eval-print loop. + # @return [Object?] If the session throws `:breakout`, return the value + # thrown with it. + # @raise [Exception] If the session throws `:raise_up`, raise the exception + # thrown with it. + # + # pkg:gem/pry#lib/pry/repl.rb:36 + def start; end + + private + + # Calculates correct overhang for current line. Supports vi Readline + # mode and its indicators such as "(ins)" or "(cmd)". + # + # @return [Integer] + # @note This doesn't calculate overhang for Readline's emacs mode with an + # indicator because emacs is the default mode and it doesn't use + # indicators in 99% of cases. + # + # pkg:gem/pry#lib/pry/repl.rb:307 + def calculate_overhang(current_prompt, original_val, indented_val); end + + # pkg:gem/pry#lib/pry/repl.rb:287 + def complete_expression?(multiline_input); end + + # pkg:gem/pry#lib/pry/repl.rb:246 + def coolline_available?; end + + # Clean up after the repl session. + # @return [void] + # + # pkg:gem/pry#lib/pry/repl.rb:84 + def epilogue; end + + # Manage switching of input objects on encountering `EOFError`s. + # @return [Object] Whatever the given block returns. + # @return [:no_more_input] Indicates that no more input can be read. + # + # pkg:gem/pry#lib/pry/repl.rb:127 + def handle_read_errors; end + + # pkg:gem/pry#lib/pry/repl.rb:234 + def input_multiline?; end + + # pkg:gem/pry#lib/pry/repl.rb:228 + def input_readline(*args); end + + # pkg:gem/pry#lib/pry/repl.rb:219 + def input_readmultiline(*args); end + + # If `$stdout` is not a tty, it's probably a pipe. + # @example + # # `piping?` returns `false` + # % pry + # [1] pry(main) + # + # # `piping?` returns `true` + # % pry | tee log + # + # pkg:gem/pry#lib/pry/repl.rb:272 + def piping?; end + + # pkg:gem/pry#lib/pry/repl.rb:250 + def prism_available?; end + + # Set up the repl session. + # @return [void] + # + # pkg:gem/pry#lib/pry/repl.rb:47 + def prologue; end + + # Read a line of input from the user. + # @return [String] The line entered by the user. + # @return [nil] On ``. + # @return [:control_c] On ``. + # @return [:no_more_input] On EOF. + # + # pkg:gem/pry#lib/pry/repl.rb:93 + def read; end + + # Returns the next line of input to be sent to the {Pry} instance. + # @param [String] current_prompt The prompt to use for input. + # @return [String?] The next line of input, or `nil` on . + # + # pkg:gem/pry#lib/pry/repl.rb:169 + def read_line(current_prompt); end + + # pkg:gem/pry#lib/pry/repl.rb:242 + def readline_available?; end + + # pkg:gem/pry#lib/pry/repl.rb:238 + def reline_available?; end + + # The actual read-eval-print loop. + # + # The {REPL} instance is responsible for reading and looping, whereas the + # {Pry} instance is responsible for evaluating user input and printing + # return values and command output. + # + # @return [Object?] If the session throws `:breakout`, return the value + # thrown with it. + # @raise [Exception] If the session throws `:raise_up`, raise the exception + # thrown with it. + # + # pkg:gem/pry#lib/pry/repl.rb:66 + def repl; end + + # @return [void] + # + # pkg:gem/pry#lib/pry/repl.rb:279 + def set_readline_output; end + + class << self + # Instantiate a new {Pry} instance with the given options, then start a + # {REPL} instance wrapping it. + # @option options See {Pry#initialize} + # + # pkg:gem/pry#lib/pry/repl.rb:14 + def start(options); end + end +end + +# pkg:gem/pry#lib/pry/repl.rb:285 +Pry::REPL::UNEXPECTED_TOKENS = T.let(T.unsafe(nil), Array) + +# A class to manage the loading of files through the REPL loop. +# This is an interesting trick as it processes your file as if it +# was user input in an interactive session. As a result, all Pry +# commands are available, and they are executed non-interactively. Furthermore +# the session becomes interactive when the repl loop processes a +# 'make-interactive' command in the file. The session also becomes +# interactive when an exception is encountered, enabling you to fix +# the error before returning to non-interactive processing with the +# 'make-non-interactive' command. +# +# pkg:gem/pry#lib/pry/repl_file_loader.rb:14 +class Pry::REPLFileLoader + # pkg:gem/pry#lib/pry/repl_file_loader.rb:15 + def initialize(file_name); end + + # Define a few extra commands useful for flipping back & forth + # between interactive/non-interactive modes + # + # pkg:gem/pry#lib/pry/repl_file_loader.rb:59 + def define_additional_commands; end + + # Switch to interactive mode, i.e take input from the user + # and use the regular print and exception handlers. + # @param [Pry] pry_instance the Pry instance to make interactive. + # + # pkg:gem/pry#lib/pry/repl_file_loader.rb:26 + def interactive_mode(pry_instance); end + + # Actually load the file through the REPL by setting file content + # as the REPL input stream. + # + # pkg:gem/pry#lib/pry/repl_file_loader.rb:75 + def load; end + + # Switch to non-interactive mode. Essentially + # this means there is no result output + # and that the session becomes interactive when an exception is encountered. + # @param [Pry] pry_instance the Pry instance to make non-interactive. + # + # pkg:gem/pry#lib/pry/repl_file_loader.rb:37 + def non_interactive_mode(pry_instance, content); end +end + +# As a REPL, we often want to catch any unexpected exceptions that may have +# been raised; however we don't want to go overboard and prevent the user +# from exiting Pry when they want to. +# +# pkg:gem/pry#lib/pry/exceptions.rb:7 +module Pry::RescuableException + class << self + # pkg:gem/pry#lib/pry/exceptions.rb:8 + def ===(exception); end + end +end + +# Wraps the return result of process_commands, indicates if the +# result IS a command and what kind of command (e.g void) +# +# pkg:gem/pry#lib/pry/command_set.rb:397 +class Pry::Result + # pkg:gem/pry#lib/pry/command_set.rb:400 + def initialize(is_command, retval = T.unsafe(nil)); end + + # Is the result a command? + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/command_set.rb:407 + def command?; end + + # pkg:gem/pry#lib/pry/command_set.rb:398 + def retval; end + + # Is the result a command and if it is, is it a void command? + # (one that does not return a value) + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/command_set.rb:414 + def void_command?; end +end + +# A ring is a thread-safe fixed-capacity array to which you can only add +# elements. Older entries are overwritten as you add new elements, so that the +# ring can never contain more than `max_size` elements. +# +# @example +# ring = Pry::Ring.new(3) +# ring << 1 << 2 << 3 +# ring.to_a #=> [1, 2, 3] +# ring << 4 +# ring.to_a #=> [2, 3, 4] +# +# ring[0] #=> 2 +# ring[-1] #=> 4 +# ring.clear +# ring[0] #=> nil +# +# @api public +# @since v0.12.0 +# +# pkg:gem/pry#lib/pry/ring.rb:22 +class Pry::Ring + # @param [Integer] max_size Maximum buffer size. The buffer will start + # overwriting elements once its reaches its maximum capacity + # + # pkg:gem/pry#lib/pry/ring.rb:33 + def initialize(max_size); end + + # Push `value` to the current index. + # + # @param [Object] value + # @return [self] + # + # pkg:gem/pry#lib/pry/ring.rb:43 + def <<(value); end + + # Read the value stored at `index`. + # + # @param [Integer, Range] index The element (if Integer) or elements + # (if Range) associated with `index` + # @return [Object, Array, nil] element(s) at `index`, `nil` if none + # exist + # + # pkg:gem/pry#lib/pry/ring.rb:57 + def [](index); end + + # Clear the buffer and reset count. + # @return [void] + # + # pkg:gem/pry#lib/pry/ring.rb:75 + def clear; end + + # @return [Integer] how many objects were added during the lifetime of the + # ring + # + # pkg:gem/pry#lib/pry/ring.rb:28 + def count; end + + # @return [Integer] maximum buffer size + # + # pkg:gem/pry#lib/pry/ring.rb:24 + def max_size; end + + # pkg:gem/pry#lib/pry/ring.rb:29 + def size; end + + # @return [Array] the buffer as unwinded array + # + # pkg:gem/pry#lib/pry/ring.rb:67 + def to_a; end + + private + + # pkg:gem/pry#lib/pry/ring.rb:84 + def transpose_buffer_tail; end +end + +# pkg:gem/pry#lib/pry/slop.rb:5 +class Pry::Slop + include ::Enumerable + + # Create a new instance of Slop and optionally build options via a block. + # + # config - A Hash of configuration options. + # block - An optional block used to specify options. + # + # pkg:gem/pry#lib/pry/slop.rb:127 + def initialize(config = T.unsafe(nil), &block); end + + # Fetch an options argument value. + # + # key - The Symbol or String option short or long flag. + # + # Returns the Object value for this option, or nil. + # + # pkg:gem/pry#lib/pry/slop.rb:278 + def [](key); end + + # Add a callback. + # + # label - The Symbol identifier to attach this callback. + # + # Returns nothing. + # + # pkg:gem/pry#lib/pry/slop.rb:398 + def add_callback(label, &block); end + + # Get or set the banner. + # + # banner - The String to set the banner. + # + # Returns the banner String. + # + # pkg:gem/pry#lib/pry/slop.rb:168 + def banner(banner = T.unsafe(nil)); end + + # Set the banner. + # + # banner - The String to set the banner. + # + # pkg:gem/pry#lib/pry/slop.rb:159 + def banner=(banner); end + + # Add a new command. + # + # command - The Symbol or String used to identify this command. + # options - A Hash of configuration options (see Slop::new) + # + # Returns a new instance of Slop mapped to this command. + # + # pkg:gem/pry#lib/pry/slop.rb:196 + def command(command, options = T.unsafe(nil), &block); end + + # The Hash of configuration options for this Slop instance. + # + # pkg:gem/pry#lib/pry/slop.rb:118 + def config; end + + # Get or set the description (used for commands). + # + # desc - The String to set the description. + # + # Returns the description String. + # + # pkg:gem/pry#lib/pry/slop.rb:185 + def description(desc = T.unsafe(nil)); end + + # Set the description (used for commands). + # + # desc - The String to set the description. + # + # pkg:gem/pry#lib/pry/slop.rb:176 + def description=(desc); end + + # Enumerable interface. Yields each Slop::Option. + # + # pkg:gem/pry#lib/pry/slop.rb:297 + def each(&block); end + + # Fetch a Slop object associated with this command. + # + # command - The String or Symbol name of the command. + # + # Examples: + # + # opts.command :foo do + # on :v, :verbose, 'Enable verbose mode' + # end + # + # # ruby run.rb foo -v + # opts.fetch_command(:foo).verbose? #=> true + # + # pkg:gem/pry#lib/pry/slop.rb:389 + def fetch_command(command); end + + # Fetch a Slop::Option object. + # + # key - The Symbol or String option key. + # + # Examples: + # + # opts.on(:foo, 'Something fooey', :argument => :optional) + # opt = opts.fetch_option(:foo) + # opt.class #=> Slop::Option + # opt.accepts_optional_argument? #=> true + # + # Returns an Option or nil if none were found. + # + # pkg:gem/pry#lib/pry/slop.rb:373 + def fetch_option(key); end + + # pkg:gem/pry#lib/pry/slop.rb:282 + def get(key); end + + # pkg:gem/pry#lib/pry/slop.rb:440 + def help; end + + # Fetch a list of options which were missing from the parsed list. + # + # Examples: + # + # opts = Slop.new do + # on :n, :name= + # on :p, :password= + # end + # + # opts.parse %w[ --name Lee ] + # opts.missing #=> ['password'] + # + # Returns an Array of Strings representing missing options. + # + # pkg:gem/pry#lib/pry/slop.rb:357 + def missing; end + + # Add an Option. + # + # objects - An Array with an optional Hash as the last element. + # + # Examples: + # + # on '-u', '--username=', 'Your username' + # on :v, :verbose, 'Enable verbose mode' + # + # Returns the created instance of Slop::Option. + # + # pkg:gem/pry#lib/pry/slop.rb:265 + def on(*objects, &block); end + + # pkg:gem/pry#lib/pry/slop.rb:271 + def opt(*objects, &block); end + + # pkg:gem/pry#lib/pry/slop.rb:270 + def option(*objects, &block); end + + # The Array of Slop::Option objects tied to this Slop instance. + # + # pkg:gem/pry#lib/pry/slop.rb:121 + def options; end + + # Parse a list of items, executing and gathering options along the way. + # + # items - The Array of items to extract options from (default: ARGV). + # block - An optional block which when used will yield non options. + # + # Returns an Array of original items. + # + # pkg:gem/pry#lib/pry/slop.rb:206 + def parse(items = T.unsafe(nil), &block); end + + # Parse a list of items, executing and gathering options along the way. + # unlike parse() this method will remove any options and option arguments + # from the original Array. + # + # items - The Array of items to extract options from (default: ARGV). + # block - An optional block which when used will yield non options. + # + # Returns an Array of original items with options removed. + # + # pkg:gem/pry#lib/pry/slop.rb:219 + def parse!(items = T.unsafe(nil), &block); end + + # Check for an options presence. + # + # Examples: + # + # opts.parse %w( --foo ) + # opts.present?(:foo) #=> true + # opts.present?(:bar) #=> false + # + # Returns true if all of the keys are present in the parsed arguments. + # + # pkg:gem/pry#lib/pry/slop.rb:333 + def present?(*keys); end + + # Specify code to be executed when these options are parsed. + # + # callable - An object responding to a call method. + # + # yields - The instance of Slop parsing these options + # An Array of unparsed arguments + # + # Example: + # + # Slop.parse do + # on :v, :verbose + # + # run do |opts, args| + # puts "Arguments: #{args.inspect}" if opts.verbose? + # end + # end + # + # pkg:gem/pry#lib/pry/slop.rb:317 + def run(callable = T.unsafe(nil), &block); end + + # Add string separators between options. + # + # text - The String text to print. + # + # pkg:gem/pry#lib/pry/slop.rb:405 + def separator(text); end + + # Is strict mode enabled? + # + # Returns true if strict mode is enabled, false otherwise. + # + # pkg:gem/pry#lib/pry/slop.rb:152 + def strict?; end + + # pkg:gem/pry#lib/pry/slop.rb:294 + def to_h(include_commands = T.unsafe(nil)); end + + # Returns a new Hash with option flags as keys and option values as values. + # + # include_commands - If true, merge options from all sub-commands. + # + # pkg:gem/pry#lib/pry/slop.rb:287 + def to_hash(include_commands = T.unsafe(nil)); end + + # Print a handy Slop help string. + # + # Returns the banner followed by available option help strings. + # + # pkg:gem/pry#lib/pry/slop.rb:416 + def to_s; end + + private + + # Autocreate an option on the fly. See the :autocreate Slop config option. + # + # items - The Array of items we're parsing. + # index - The current Integer index for the item we're processing. + # + # Returns nothing. + # + # pkg:gem/pry#lib/pry/slop.rb:590 + def autocreate(items, index); end + + # Build an option from a list of objects. + # + # objects - An Array of objects used to build this option. + # + # Returns a new instance of Slop::Option. + # + # pkg:gem/pry#lib/pry/slop.rb:606 + def build_option(objects, &block); end + + # Remove any leading -- characters from a string. + # + # object - The Object we want to cast to a String and clean. + # + # Returns the newly cleaned String with leading -- characters removed. + # + # pkg:gem/pry#lib/pry/slop.rb:659 + def clean(object); end + + # pkg:gem/pry#lib/pry/slop.rb:663 + def commands_to_help; end + + # Execute a `-abc` type option where a, b and c are all options. This + # method is only executed if the multiple_switches argument is true. + # + # option - The first Option object. + # argument - The argument to this option. (Split into multiple Options). + # index - The index of the current item being processed. + # + # Returns nothing. + # + # pkg:gem/pry#lib/pry/slop.rb:552 + def execute_multiple_switches(option, argument, index); end + + # Execute an option, firing off callbacks and assigning arguments. + # + # option - The Slop::Option object found by #process_item. + # argument - The argument Object to assign to this option. + # index - The current Integer index of the object we're processing. + # item - The optional String item we're processing. + # + # Returns nothing. + # + # pkg:gem/pry#lib/pry/slop.rb:519 + def execute_option(option, argument, index, item = T.unsafe(nil)); end + + # Extract the long flag from an item. + # + # objects - The Array of objects passed from #build_option. + # config - The Hash of configuration options built in #build_option. + # + # pkg:gem/pry#lib/pry/slop.rb:644 + def extract_long_flag(objects, config); end + + # Extract an option from a flag. + # + # flag - The flag key used to extract an option. + # + # Returns an Array of [option, argument]. + # + # pkg:gem/pry#lib/pry/slop.rb:567 + def extract_option(flag); end + + # Extract the short flag from an item. + # + # objects - The Array of objects passed from #build_option. + # config - The Hash of configuration options built in #build_option. + # + # pkg:gem/pry#lib/pry/slop.rb:626 + def extract_short_flag(objects, config); end + + # Convenience method for present?(:option). + # + # Examples: + # + # opts.parse %( --verbose ) + # opts.verbose? #=> true + # opts.other? #=> false + # + # Returns true if this option is present. If this method does not end + # with a ? character it will instead call super(). + # + # pkg:gem/pry#lib/pry/slop.rb:454 + def method_missing(method, *args, &block); end + + # Process a list item, figure out if it's an option, execute any + # callbacks, assign any option arguments, and do some sanity checks. + # + # items - The Array of items to process. + # index - The current Integer index of the item we want to process. + # block - An optional block which when passed will yield non options. + # + # Returns nothing. + # + # pkg:gem/pry#lib/pry/slop.rb:472 + def process_item(items, index, &block); end + + # Override this method so we can check if an option? method exists. + # + # Returns true if this option key exists in our list of options. + # + # pkg:gem/pry#lib/pry/slop.rb:340 + def respond_to_missing?(method_name, include_all = T.unsafe(nil)); end + + class << self + # Build a Slop object from a option specification. + # + # This allows you to design your options via a simple String rather + # than programmatically. Do note though that with this method, you're + # unable to pass any advanced options to the on() method when creating + # options. + # + # string - The optspec String + # config - A Hash of configuration options to pass to Slop.new + # + # Examples: + # + # opts = Slop.optspec(<<-SPEC) + # ruby foo.rb [options] + # --- + # n,name= Your name + # a,age= Your age + # A,auth Sign in with auth + # p,passcode= Your secret pass code + # SPEC + # + # opts.fetch_option(:name).description #=> "Your name" + # + # Returns a new instance of Slop. + # + # pkg:gem/pry#lib/pry/slop.rb:97 + def optspec(string, config = T.unsafe(nil)); end + + # items - The Array of items to extract options from (default: ARGV). + # config - The Hash of configuration options to send to Slop.new(). + # block - An optional block used to add options. + # + # Examples: + # + # Slop.parse(ARGV, :help => true) do + # on '-n', '--name', 'Your username', :argument => true + # end + # + # Returns a new instance of Slop. + # + # pkg:gem/pry#lib/pry/slop.rb:54 + def parse(items = T.unsafe(nil), config = T.unsafe(nil), &block); end + + # items - The Array of items to extract options from (default: ARGV). + # config - The Hash of configuration options to send to Slop.new(). + # block - An optional block used to add options. + # + # Returns a new instance of Slop. + # + # pkg:gem/pry#lib/pry/slop.rb:63 + def parse!(items = T.unsafe(nil), config = T.unsafe(nil), &block); end + end +end + +# pkg:gem/pry#lib/pry/slop/commands.rb:5 +class Pry::Slop::Commands + include ::Enumerable + + # Create a new instance of Slop::Commands and optionally build + # Slop instances via a block. Any configuration options used in + # this method will be the default configuration options sent to + # each Slop object created. + # + # config - An optional configuration Hash. + # block - Optional block used to define commands. + # + # Examples: + # + # commands = Slop::Commands.new do + # on :new do + # on '-o', '--outdir=', 'The output directory' + # on '-v', '--verbose', 'Enable verbose mode' + # end + # + # on :generate do + # on '--assets', 'Generate assets', :default => true + # end + # + # global do + # on '-D', '--debug', 'Enable debug mode', :default => false + # end + # end + # + # commands[:new].class #=> Slop + # commands.parse + # + # pkg:gem/pry#lib/pry/slop/commands.rb:39 + def initialize(config = T.unsafe(nil), &block); end + + # Fetch the instance of Slop tied to a command. + # + # key - The String or Symbol key used to locate this command. + # + # Returns the Slop instance if this key is found, nil otherwise. + # + # pkg:gem/pry#lib/pry/slop/commands.rb:100 + def [](key); end + + # pkg:gem/pry#lib/pry/slop/commands.rb:8 + def arguments; end + + # Optionally set the banner for this command help output. + # + # banner - The String text to set the banner. + # + # Returns the String banner if one is set. + # + # pkg:gem/pry#lib/pry/slop/commands.rb:59 + def banner(banner = T.unsafe(nil)); end + + # Optionally set the banner for this command help output. + # + # banner - The String text to set the banner. + # + # Returns the String banner if one is set. + # + # pkg:gem/pry#lib/pry/slop/commands.rb:9 + def banner=(_arg0); end + + # pkg:gem/pry#lib/pry/slop/commands.rb:8 + def commands; end + + # pkg:gem/pry#lib/pry/slop/commands.rb:8 + def config; end + + # Add a Slop instance used when no other commands exist. + # + # config - A Hash of configuration options to pass to Slop. + # block - An optional block used to pass options to Slop. + # + # Returns the newly created Slop instance mapped to default. + # + # pkg:gem/pry#lib/pry/slop/commands.rb:81 + def default(config = T.unsafe(nil), &block); end + + # Enumerable interface. + # + # pkg:gem/pry#lib/pry/slop/commands.rb:119 + def each(&block); end + + # pkg:gem/pry#lib/pry/slop/commands.rb:103 + def get(key); end + + # Add a global Slop instance. + # + # config - A Hash of configuration options to pass to Slop. + # block - An optional block used to pass options to Slop. + # + # Returns the newly created Slop instance mapped to global. + # + # pkg:gem/pry#lib/pry/slop/commands.rb:91 + def global(config = T.unsafe(nil), &block); end + + # pkg:gem/pry#lib/pry/slop/commands.rb:167 + def help; end + + # Returns the inspection String. + # + # pkg:gem/pry#lib/pry/slop/commands.rb:170 + def inspect; end + + # Add a Slop instance for a specific command. + # + # command - A String or Symbol key used to identify this command. + # config - A Hash of configuration options to pass to Slop. + # block - An optional block used to pass options to Slop. + # + # Returns the newly created Slop instance mapped to command. + # + # pkg:gem/pry#lib/pry/slop/commands.rb:71 + def on(command, config = T.unsafe(nil), &block); end + + # Parse a list of items. + # + # items - The Array of items to parse. + # + # Returns the original Array of items. + # + # pkg:gem/pry#lib/pry/slop/commands.rb:128 + def parse(items = T.unsafe(nil)); end + + # Parse a list of items, removing any options or option arguments found. + # + # items - The Array of items to parse. + # + # Returns the original Array of items with options removed. + # + # pkg:gem/pry#lib/pry/slop/commands.rb:138 + def parse!(items = T.unsafe(nil)); end + + # Check for a command presence. + # + # Examples: + # + # cmds.parse %w( foo ) + # cmds.present?(:foo) #=> true + # cmds.present?(:bar) #=> false + # + # Returns true if the given key is present in the parsed arguments. + # + # pkg:gem/pry#lib/pry/slop/commands.rb:114 + def present?(key); end + + # Returns a nested Hash with Slop options and values. See Slop#to_hash. + # + # pkg:gem/pry#lib/pry/slop/commands.rb:153 + def to_hash; end + + # Returns the help String. + # + # pkg:gem/pry#lib/pry/slop/commands.rb:158 + def to_s; end + + private + + # Returns nothing. + # + # pkg:gem/pry#lib/pry/slop/commands.rb:177 + def execute_arguments!(items); end + + # Returns nothing. + # + # pkg:gem/pry#lib/pry/slop/commands.rb:183 + def execute_global_opts!(items); end +end + +# Returns a default Hash of configuration options this Slop instance uses. +# +# pkg:gem/pry#lib/pry/slop.rb:30 +Pry::Slop::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# The main Error class, all Exception classes inherit from this class. +# +# pkg:gem/pry#lib/pry/slop.rb:12 +class Pry::Slop::Error < ::StandardError; end + +# Raised when an argument does not match its intended match constraint. +# +# pkg:gem/pry#lib/pry/slop.rb:21 +class Pry::Slop::InvalidArgumentError < ::Pry::Slop::Error; end + +# Raised when an invalid command is found and the strict flag is enabled. +# +# pkg:gem/pry#lib/pry/slop.rb:27 +class Pry::Slop::InvalidCommandError < ::Pry::Slop::Error; end + +# Raised when an invalid option is found and the strict flag is enabled. +# +# pkg:gem/pry#lib/pry/slop.rb:24 +class Pry::Slop::InvalidOptionError < ::Pry::Slop::Error; end + +# Raised when an option argument is expected but none are given. +# +# pkg:gem/pry#lib/pry/slop.rb:15 +class Pry::Slop::MissingArgumentError < ::Pry::Slop::Error; end + +# Raised when an option is expected/required but not present. +# +# pkg:gem/pry#lib/pry/slop.rb:18 +class Pry::Slop::MissingOptionError < ::Pry::Slop::Error; end + +# pkg:gem/pry#lib/pry/slop/option.rb:5 +class Pry::Slop::Option + # Incapsulate internal option information, mainly used to store + # option specific configuration data, most of the meat of this + # class is found in the #value method. + # + # slop - The instance of Slop tied to this Option. + # short - The String or Symbol short flag. + # long - The String or Symbol long flag. + # description - The String description text. + # config - A Hash of configuration options. + # block - An optional block used as a callback. + # + # pkg:gem/pry#lib/pry/slop/option.rb:35 + def initialize(slop, short, long, description, config = T.unsafe(nil), &block); end + + # Returns true if this option accepts an optional argument. + # + # pkg:gem/pry#lib/pry/slop/option.rb:72 + def accepts_optional_argument?; end + + # pkg:gem/pry#lib/pry/slop/option.rb:23 + def argument_in_value; end + + # pkg:gem/pry#lib/pry/slop/option.rb:23 + def argument_in_value=(_arg0); end + + # Call this options callback if one exists, and it responds to call(). + # + # Returns nothing. + # + # pkg:gem/pry#lib/pry/slop/option.rb:84 + def call(*objects); end + + # pkg:gem/pry#lib/pry/slop/option.rb:22 + def config; end + + # pkg:gem/pry#lib/pry/slop/option.rb:23 + def count; end + + # pkg:gem/pry#lib/pry/slop/option.rb:23 + def count=(_arg0); end + + # pkg:gem/pry#lib/pry/slop/option.rb:22 + def description; end + + # Returns true if this option expects an argument. + # + # pkg:gem/pry#lib/pry/slop/option.rb:67 + def expects_argument?; end + + # pkg:gem/pry#lib/pry/slop/option.rb:140 + def help; end + + # Returns the String inspection text. + # + # pkg:gem/pry#lib/pry/slop/option.rb:143 + def inspect; end + + # Returns the String flag of this option. Preferring the long flag. + # + # pkg:gem/pry#lib/pry/slop/option.rb:77 + def key; end + + # pkg:gem/pry#lib/pry/slop/option.rb:22 + def long; end + + # pkg:gem/pry#lib/pry/slop/option.rb:22 + def short; end + + # Returns the help String for this option. + # + # pkg:gem/pry#lib/pry/slop/option.rb:124 + def to_s; end + + # pkg:gem/pry#lib/pry/slop/option.rb:22 + def types; end + + # Fetch the argument value for this option. + # + # Returns the Object once any type conversions have taken place. + # + # pkg:gem/pry#lib/pry/slop/option.rb:108 + def value; end + + # Set the new argument value for this option. + # + # We use this setter method to handle concatenating lists. That is, + # when an array type is specified and used more than once, values from + # both options will be grouped together and flattened into a single array. + # + # pkg:gem/pry#lib/pry/slop/option.rb:93 + def value=(new_value); end + + private + + # Convert an object to a Float if possible. + # + # value - The Object we want to convert to a float. + # + # Returns the Float value if possible to convert, else a zero. + # + # pkg:gem/pry#lib/pry/slop/option.rb:173 + def value_to_float(value); end + + # Convert an object to an Integer if possible. + # + # value - The Object we want to convert to an integer. + # + # Returns the Integer value if possible to convert, else a zero. + # + # pkg:gem/pry#lib/pry/slop/option.rb:156 + def value_to_integer(value); end + + # Convert an object to a Range if possible. + # + # value - The Object we want to convert to a range. + # + # Returns the Range value if one could be found, else the original object. + # + # pkg:gem/pry#lib/pry/slop/option.rb:190 + def value_to_range(value); end +end + +# The default Hash of configuration options this class uses. +# +# pkg:gem/pry#lib/pry/slop/option.rb:7 +Pry::Slop::Option::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/pry#lib/pry/slop.rb:9 +Pry::Slop::VERSION = T.let(T.unsafe(nil), String) + +# @api private +# @since v0.13.0 +# +# pkg:gem/pry#lib/pry/syntax_highlighter.rb:8 +class Pry::SyntaxHighlighter + class << self + # pkg:gem/pry#lib/pry/syntax_highlighter.rb:9 + def highlight(code, language = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/syntax_highlighter.rb:17 + def keyword_token_color; end + + # Sets comment token to blue (black by default), so it's more legible. + # + # pkg:gem/pry#lib/pry/syntax_highlighter.rb:22 + def overwrite_coderay_comment_token!; end + + # pkg:gem/pry#lib/pry/syntax_highlighter.rb:13 + def tokenize(code, language = T.unsafe(nil)); end + end +end + +# @api private +# @since v0.13.0 +# +# pkg:gem/pry#lib/pry/system_command_handler.rb:6 +module Pry::SystemCommandHandler + class << self + # pkg:gem/pry#lib/pry/system_command_handler.rb:8 + def default(output, command, _pry_instance); end + end +end + +# Catches SecurityErrors if $SAFE is set +# +# pkg:gem/pry#lib/pry/exceptions.rb:28 +module Pry::TooSafeException + class << self + # pkg:gem/pry#lib/pry/exceptions.rb:29 + def ===(exception); end + end +end + +# An Exception Tag (cf. Exceptional Ruby) that instructs Pry to show the error +# in a more user-friendly manner. This should be used when the exception +# happens within Pry itself as a direct consequence of the user typing +# something wrong. +# +# This allows us to distinguish between the user typing: +# +# pry(main)> def ) +# SyntaxError: unexpected ) +# +# pry(main)> method_that_evals("def )") +# SyntaxError: (eval):1: syntax error, unexpected ')' +# from ./a.rb:2 in `eval' +# +# pkg:gem/pry#lib/pry/exceptions.rb:51 +module Pry::UserError; end + +# pkg:gem/pry#lib/pry/version.rb:4 +Pry::VERSION = T.let(T.unsafe(nil), String) + +# @api private +# @since v0.13.0 +# +# pkg:gem/pry#lib/pry/warning.rb:6 +module Pry::Warning + class << self + # Prints a warning message with exact file and line location, similar to how + # Ruby's -W prints warnings. + # + # @param [String] message + # @return [void] + # + # pkg:gem/pry#lib/pry/warning.rb:12 + def warn(message); end + end +end + +# pkg:gem/pry#lib/pry/wrapped_module.rb:16 +class Pry::WrappedModule + include ::Pry::Helpers::BaseHelpers + include ::Pry::CodeObject::Helpers + + # @raise [ArgumentError] if the argument is not a `Module` + # @param [Module] mod + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:56 + def initialize(mod); end + + # Return a candidate for this module of specified rank. A `rank` + # of 0 is equivalent to the 'primary candidate', which is the + # module definition with the highest number of methods. A `rank` + # of 1 is the module definition with the second highest number of + # methods, and so on. Module candidates are necessary as modules + # can be reopened multiple times and in multiple places in Ruby, + # the candidate API gives you access to the module definition + # representing each of those reopenings. + # @raise [Pry::CommandError] If the `rank` is out of range. That + # is greater than `number_of_candidates - 1`. + # @param [Fixnum] rank + # @return [Pry::WrappedModule::Candidate] + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:239 + def candidate(rank); end + + # @return [Array] + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:250 + def candidates; end + + # Is this strictly a class? + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:126 + def class?; end + + # Returns an array of the names of the constants accessible in the wrapped + # module. This avoids the problem of accidentally calling the singleton + # method `Module.constants`. + # @param [Boolean] inherit Include the names of constants from included + # modules? + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:76 + def constants(inherit = T.unsafe(nil)); end + + # Returns documentation for the module. + # This documentation is for the primary candidate, if + # you would like documentation for other candidates use + # `WrappedModule#candidate` to select the candidate you're + # interested in. + # @raise [Pry::CommandError] If documentation cannot be found. + # @return [String] The documentation for the module. + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:195 + def doc; end + + # @return [String, nil] The associated file for the module (i.e + # the primary candidate: highest ranked monkeypatch). + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:176 + def file; end + + # @return [Fixnum, nil] The associated line for the module (i.e + # the primary candidate: highest ranked monkeypatch). + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:183 + def line; end + + # Forward method invocations to the wrapped module + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:150 + def method_missing(method_name, *args, &block); end + + # The prefix that would appear before methods defined on this class. + # + # i.e. the "String." or "String#" in String.new and String#initialize. + # + # @return String + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:85 + def method_prefix; end + + # Is this strictly a module? (does not match classes) + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:120 + def module?; end + + # The name of the Module if it has one, otherwise #. + # + # @return [String] + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:100 + def nonblank_name; end + + # @return [Fixnum] The number of candidate definitions for the + # current module. + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:245 + def number_of_candidates; end + + # Is this a singleton class? + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:110 + def singleton_class?; end + + # Get the instance associated with this singleton class. + # + # @raise ArgumentError: tried to get instance of non singleton class + # + # @return [Object] + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:135 + def singleton_instance; end + + # Returns the source for the module. + # This source is for the primary candidate, if + # you would like source for other candidates use + # `WrappedModule#candidate` to select the candidate you're + # interested in. + # @raise [Pry::CommandError] If source cannot be found. + # @return [String] The source for the module. + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:206 + def source; end + + # pkg:gem/pry#lib/pry/wrapped_module.rb:179 + def source_file; end + + # pkg:gem/pry#lib/pry/wrapped_module.rb:186 + def source_line; end + + # Retrieve the source location of a module. Return value is in same + # format as Method#source_location. If the source location + # cannot be found this method returns `nil`. + # + # @return [Array, nil] The source location of the + # module (or class), or `nil` if no source location found. + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:168 + def source_location; end + + # @param [Fixnum] times How far to travel up the ancestor chain. + # @return [Pry::WrappedModule, nil] The wrapped module that is the + # superclass. + # When `self` is a `Module` then return the + # nth ancestor, otherwise (in the case of classes) return the + # nth ancestor that is a class. + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:270 + def super(times = T.unsafe(nil)); end + + # pkg:gem/pry#lib/pry/wrapped_module.rb:20 + def wrapped; end + + # @return [String] Return the YARD docs for this module. + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:223 + def yard_doc; end + + # @return [Boolean] Whether YARD docs are available for this module. + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:260 + def yard_docs?; end + + # @return [String] Return the associated file for the + # module from YARD, if one exists. + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:212 + def yard_file; end + + # @return [Fixnum] Return the associated line for the + # module from YARD, if one exists. + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:218 + def yard_line; end + + private + + # Return all methods (instance methods and class methods) for a + # given module. + # @return [Array] + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:347 + def all_methods_for(mod); end + + # We only want methods that have a non-nil `source_location`. We also + # skip some spooky internal methods. + # + # @return [Array] + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:329 + def all_relevant_methods_for(mod); end + + # A helper method. + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:310 + def all_source_locations_by_popularity; end + + # memoized lines for file + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:371 + def lines_for_file(file); end + + # @return [Array>] The array of `Pry::Method` objects, + # there are two associated with each candidate. The first is the 'base + # method' for a candidate and it serves as the start point for + # the search in uncovering the module definition. The second is + # the last method defined for that candidate and it is used to + # speed up source code extraction. + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:302 + def method_candidates; end + + # Detect methods that are defined with `def_delegator` from the Forwardable + # module. We want to reject these methods as they screw up module + # extraction since the `source_location` for such methods points at forwardable.rb + # TODO: make this more robust as valid user-defined files called + # forwardable.rb are also skipped. + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:366 + def method_defined_by_forwardable_module?(method); end + + # pkg:gem/pry#lib/pry/wrapped_module.rb:351 + def nested_module?(parent, name); end + + # @return [Pry::WrappedModule::Candidate] The candidate with the + # highest rank, that is the 'monkey patch' of this module with the + # highest number of methods, which contains a source code line that + # defines the module. It is considered the 'canonical' definition + # for the module. In the absence of a suitable candidate, the + # candidate of rank 0 will be returned, or a CommandError raised if + # there are no candidates at all. + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:292 + def primary_candidate; end + + # pkg:gem/pry#lib/pry/wrapped_module.rb:158 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end + + class << self + # Convert a string to a module. + # + # @param [String] mod_name + # @param [Binding] target The binding where the lookup takes place. + # @return [Module, nil] The module or `nil` (if conversion failed). + # @example + # Pry::WrappedModule.from_str("Pry::Code") + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:29 + def from_str(mod_name, target = T.unsafe(nil)); end + + private + + # We use this method to decide whether code is safe to eval. Method's are + # generally not, but everything else is. + # TODO: is just checking != "method" enough?? + # TODO: see duplication of this method in Pry::CodeObject + # @param [String] str The string to lookup. + # @param [Binding] target Where the lookup takes place. + # @return [Boolean] + # + # pkg:gem/pry#lib/pry/wrapped_module.rb:45 + def safe_to_evaluate?(str, target); end + end +end + +# This class represents a single candidate for a module/class definition. +# It provides access to the source, documentation, line and file +# for a monkeypatch (reopening) of a class/module. +# +# pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:8 +class Pry::WrappedModule::Candidate + include ::Pry::Helpers::DocumentationHelpers + include ::Pry::CodeObject::Helpers + extend ::Forwardable + extend ::Pry::Forwardable + + # @raise [Pry::CommandError] If `rank` is out of bounds. + # @param [Pry::WrappedModule] wrapper The associated + # `Pry::WrappedModule` instance that owns the candidates. + # @param [Fixnum] rank The rank of the candidate to + # retrieve. Passing 0 returns 'primary candidate' (the candidate with largest + # number of methods), passing 1 retrieves candidate with + # second largest number of methods, and so on, up to + # `Pry::WrappedModule#number_of_candidates() - 1` + # + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:38 + def initialize(wrapper, rank); end + + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:27 + def class?(*args, **_arg1, &block); end + + # @raise [Pry::CommandError] If documentation cannot be found. + # @return [String] The documentation for the candidate. + # + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:70 + def doc; end + + # @return [String] The file where the module definition is located. + # + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:14 + def file; end + + # @return [Fixnum] The line where the module definition is located. + # + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:18 + def line; end + + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:27 + def module?(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:27 + def nonblank_name(*args, **_arg1, &block); end + + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:27 + def number_of_candidates(*args, **_arg1, &block); end + + # @raise [Pry::CommandError] If source code cannot be found. + # @return [String] The source for the candidate, i.e the + # complete module/class definition. + # + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:59 + def source; end + + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:15 + def source_file; end + + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:19 + def source_line; end + + # @return [Array, nil] A `[String, Fixnum]` pair representing the + # source location (file and line) for the candidate or `nil` + # if no source location found. + # + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:79 + def source_location; end + + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:27 + def wrapped(*args, **_arg1, &block); end + + private + + # Locate the first line of the module definition. + # @param [String] file The file that contains the module + # definition (somewhere). + # @param [Fixnum] line The module definition should appear + # before this line (if it exists). + # @return [Fixnum] The line where the module is defined. This + # line number is one-indexed. + # + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:99 + def first_line_of_module_definition(file, line); end + + # This method is used by `Candidate#source_location` as a + # starting point for the search for the candidate's definition. + # @return [Array] The source location of the base method used to + # calculate the source location of the candidate. + # + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:116 + def first_method_source_location; end + + # @return [Array] The source location of the last method in this + # candidate's module definition. + # + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:122 + def last_method_source_location; end + + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:28 + def lines_for_file(*a, &b); end + + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:28 + def method_candidates(*a, &b); end + + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:104 + def module_definition_first_line?(line); end + + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:28 + def name(*a, &b); end + + # Return the number of lines between the start of the class definition and + # the start of the last method. We use this value so we can quickly grab + # these lines from the file (without having to check each intervening line + # for validity, which is expensive) speeding up source extraction. + # + # @return [Integer] number of lines. + # + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:132 + def number_of_lines_in_first_chunk; end + + # pkg:gem/pry#lib/pry/wrapped_module/candidate.rb:28 + def yard_docs?(*a, &b); end +end 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..0230ef8 --- /dev/null +++ b/sorbet/rbi/gems/rails-dom-testing@2.3.0.rbi @@ -0,0 +1,9 @@ +# 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`. + + +# 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-html-sanitizer@1.7.1.rbi b/sorbet/rbi/gems/rails-html-sanitizer@1.7.1.rbi new file mode 100644 index 0000000..d98def1 --- /dev/null +++ b/sorbet/rbi/gems/rails-html-sanitizer@1.7.1.rbi @@ -0,0 +1,9 @@ +# 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`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem 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..a310a8c --- /dev/null +++ b/sorbet/rbi/gems/rake@13.4.2.rbi @@ -0,0 +1,3127 @@ +# 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 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.0.rbi b/sorbet/rbi/gems/rbi@0.4.0.rbi new file mode 100644 index 0000000..1f95994 --- /dev/null +++ b/sorbet/rbi/gems/rbi@0.4.0.rbi @@ -0,0 +1,5706 @@ +# 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:978 +class RBI::Arg < ::RBI::Node + # pkg:gem/rbi#lib/rbi/model.rb:983 + 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:989 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:994 + sig { returns(::String) } + def to_s; end + + # pkg:gem/rbi#lib/rbi/model.rb:980 + 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:130 + 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:145 + 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:155 + 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:810 +class RBI::BlockParam < ::RBI::Param + # pkg:gem/rbi#lib/rbi/model.rb:816 + 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:835 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:830 + sig { override.returns(T::Boolean) } + def anonymous?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:813 + sig { override.returns(T.nilable(::String)) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:824 + 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:868 +class RBI::Extend < ::RBI::Mixin + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:870 + 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:877 + 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:859 + 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:1236 + 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:1242 + 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:865 + 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:1309 +class RBI::Helper < ::RBI::NodeWithComments + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:1314 + 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:1311 + sig { returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:1322 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:854 +class RBI::Include < ::RBI::Mixin + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:856 + 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:863 + 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:999 +class RBI::KwArg < ::RBI::Arg + # pkg:gem/rbi#lib/rbi/model.rb:1004 + 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:1010 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:1001 + sig { returns(::String) } + def keyword; end + + # pkg:gem/rbi#lib/rbi/model.rb:1015 + sig { returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:746 +class RBI::KwOptParam < ::RBI::Param + # pkg:gem/rbi#lib/rbi/model.rb:755 + 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:775 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:770 + sig { override.returns(T::Boolean) } + def anonymous?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:749 + sig { override.returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:764 + sig { override.returns(::String) } + def to_s; end + + # pkg:gem/rbi#lib/rbi/model.rb:752 + sig { returns(::String) } + def value; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:716 +class RBI::KwParam < ::RBI::Param + # pkg:gem/rbi#lib/rbi/model.rb:722 + 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:741 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:736 + sig { override.returns(T::Boolean) } + def anonymous?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:719 + sig { override.returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:730 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:780 +class RBI::KwRestParam < ::RBI::Param + # pkg:gem/rbi#lib/rbi/model.rb:786 + 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:805 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:800 + sig { override.returns(T::Boolean) } + def anonymous?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:783 + sig { override.returns(T.nilable(::String)) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:794 + 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:546 + 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: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:559 + sig do + params( + params: T.nilable(T::Array[::RBI::SigParam]), + return_type: 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), 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:585 + 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:595 + 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:1353 +class RBI::MixesInClassMethods < ::RBI::Mixin + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:1360 + 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:1367 + sig { override.returns(::String) } + def to_s; end +end + +# @abstract +# +# pkg:gem/rbi#lib/rbi/model.rb:843 +class RBI::Mixin < ::RBI::NodeWithComments + abstract! + + # pkg:gem/rbi#lib/rbi/model.rb:848 + 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:845 + 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 + +# @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:877 + 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:1251 + 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:1257 + 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:883 + 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:652 +class RBI::OptParam < ::RBI::Param + # pkg:gem/rbi#lib/rbi/model.rb:661 + 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:681 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:676 + sig { override.returns(T::Boolean) } + def anonymous?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:655 + sig { override.returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:670 + sig { override.returns(::String) } + def to_s; end + + # pkg:gem/rbi#lib/rbi/model.rb:658 + sig { returns(::String) } + def value; end +end + +# @abstract +# +# pkg:gem/rbi#lib/rbi/model.rb:601 +class RBI::Param < ::RBI::NodeWithComments + abstract! + + # pkg:gem/rbi#lib/rbi/model.rb:603 + 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:617 + 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:608 + 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:1013 +class RBI::Parser::HeredocLocationVisitor < ::Prism::Visitor + # pkg:gem/rbi#lib/rbi/parser.rb:1015 + 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:1046 + sig { returns(::Prism::Location) } + def location; end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:1036 + sig { override.params(node: ::Prism::InterpolatedStringNode).void } + def visit_interpolated_string_node(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:1025 + sig { override.params(node: ::Prism::StringNode).void } + def visit_string_node(node); end + + private + + # pkg:gem/rbi#lib/rbi/parser.rb:1057 + sig { params(node: T.any(::Prism::InterpolatedStringNode, ::Prism::StringNode)).void } + def handle_string_node(node); end +end + +# pkg:gem/rbi#lib/rbi/parser.rb:915 +class RBI::Parser::SigBuilder < ::RBI::Parser::Visitor + # pkg:gem/rbi#lib/rbi/parser.rb:920 + sig { params(content: ::String, file: ::String).void } + def initialize(content, file:); end + + # pkg:gem/rbi#lib/rbi/parser.rb:996 + sig { params(node: ::Prism::CallNode, value: ::String).returns(T::Boolean) } + def allow_incompatible_override?(node, value); end + + # pkg:gem/rbi#lib/rbi/parser.rb:917 + sig { returns(::RBI::Sig) } + def current; end + + # pkg:gem/rbi#lib/rbi/parser.rb:986 + sig { params(node: ::Prism::Node).returns(::String) } + def sig_param_name(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:978 + sig { override.params(node: ::Prism::AssocNode).void } + def visit_assoc_node(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:928 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end +end + +# pkg:gem/rbi#lib/rbi/parser.rb:164 +class RBI::Parser::TreeBuilder < ::RBI::Parser::Visitor + # pkg:gem/rbi#lib/rbi/parser.rb:172 + 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:169 + sig { returns(T.nilable(::Prism::Node)) } + def last_node; end + + # pkg:gem/rbi#lib/rbi/parser.rb:166 + sig { returns(::RBI::Tree) } + def tree; end + + # pkg:gem/rbi#lib/rbi/parser.rb:361 + sig { params(node: ::Prism::CallNode).void } + def visit_call_node(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:185 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:236 + sig { params(node: T.any(::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode)).void } + def visit_constant_assign(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:229 + sig { override.params(node: ::Prism::ConstantPathWriteNode).void } + def visit_constant_path_write_node(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:221 + sig { override.params(node: ::Prism::ConstantWriteNode).void } + def visit_constant_write_node(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:291 + sig { override.params(node: ::Prism::DefNode).void } + def visit_def_node(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:313 + sig { override.params(node: ::Prism::ModuleNode).void } + def visit_module_node(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:332 + sig { override.params(node: ::Prism::ProgramNode).void } + def visit_program_node(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/parser.rb:344 + 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:539 + 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:557 + sig { void } + def collect_orphan_comments; end + + # pkg:gem/rbi#lib/rbi/parser.rb:580 + sig { returns(::RBI::Tree) } + def current_scope; end + + # pkg:gem/rbi#lib/rbi/parser.rb:585 + sig { returns(T::Array[::RBI::Sig]) } + def current_sigs; end + + # pkg:gem/rbi#lib/rbi/parser.rb:592 + 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:604 + sig { params(node: ::Prism::Node).returns(T::Array[::RBI::Comment]) } + def node_comments(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:666 + sig { params(node: ::Prism::Comment).returns(::RBI::Comment) } + def parse_comment(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:699 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Array[::RBI::Param]) } + def parse_params(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:673 + 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:765 + sig { params(node: ::Prism::CallNode).returns(::RBI::Sig) } + def parse_sig(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:774 + 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:822 + sig { params(send: ::Prism::CallNode).void } + def parse_tstruct_field(send); end + + # pkg:gem/rbi#lib/rbi/parser.rb:859 + sig { params(name: ::String, node: ::Prism::Node).returns(::RBI::Visibility) } + def parse_visibility(name, node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:873 + sig { void } + def separate_header_comments; end + + # pkg:gem/rbi#lib/rbi/parser.rb:883 + sig { void } + def set_root_tree_loc; end + + # pkg:gem/rbi#lib/rbi/parser.rb:902 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def t_enum_value?(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:897 + 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:143 + sig { params(node: ::Prism::Node).returns(::Prism::Location) } + def adjust_prism_location_for_heredoc(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:154 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def self?(node); end + + # pkg:gem/rbi#lib/rbi/parser.rb:159 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def t_sig_without_runtime?(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:702 + sig { params(node: ::RBI::Node).returns(T::Boolean) } + def oneline?(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:670 + sig { params(node: ::RBI::Node).void } + def print_blank_line_before(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:680 + sig { params(node: ::RBI::Node).void } + def print_loc(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:686 + 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:761 + sig { params(node: ::RBI::Sig).void } + def print_sig_as_block(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:731 + sig { params(node: ::RBI::Sig).void } + def print_sig_as_line(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:694 + 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:831 + sig { params(node: ::RBI::Sig).returns(T::Array[::String]) } + def sig_modifiers(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:481 + 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:401 + 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:646 + 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:413 + sig { override.params(node: ::RBI::Extend).void } + def visit_extend(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:615 + sig { override.params(node: ::RBI::Group).void } + def visit_group(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:599 + sig { override.params(node: ::RBI::Helper).void } + def visit_helper(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:407 + sig { override.params(node: ::RBI::Include).void } + def visit_include(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:487 + 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:609 + sig { override.params(node: ::RBI::MixesInClassMethods).void } + def visit_mixes_in_class_methods(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:418 + 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:371 + sig { override.params(node: ::RBI::OptParam).void } + def visit_opt_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:448 + sig { override.params(node: ::RBI::Private).void } + def visit_private(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:442 + sig { override.params(node: ::RBI::Protected).void } + def visit_protected(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:436 + 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:636 + 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:656 + 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:463 + sig { override.params(node: ::RBI::Send).void } + def visit_send(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:495 + sig { override.params(node: ::RBI::Sig).void } + def visit_sig(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:516 + 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:541 + sig { params(node: ::RBI::TStructField).void } + def visit_t_struct_field(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:560 + sig { override.params(node: ::RBI::TEnum).void } + def visit_tenum(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:566 + sig { override.params(node: ::RBI::TEnumBlock).void } + def visit_tenum_block(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:579 + 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:524 + sig { override.params(node: ::RBI::TStruct).void } + def visit_tstruct(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:530 + sig { override.params(node: ::RBI::TStructConst).void } + def visit_tstruct_const(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:536 + sig { override.params(node: ::RBI::TStructProp).void } + def visit_tstruct_prop(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:589 + sig { override.params(node: ::RBI::TypeMember).void } + def visit_type_member(node); end + + # pkg:gem/rbi#lib/rbi/printer.rb:453 + sig { params(node: ::RBI::Visibility).void } + def visit_visibility(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/printer.rb:622 + sig { override.params(node: ::RBI::VisibilityGroup).void } + def visit_visibility_group(node); end +end + +# pkg:gem/rbi#lib/rbi/printer.rb:828 +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:937 +class RBI::Private < ::RBI::Visibility + # pkg:gem/rbi#lib/rbi/model.rb:939 + 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:929 +class RBI::Protected < ::RBI::Visibility + # pkg:gem/rbi#lib/rbi/model.rb:931 + 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:918 +class RBI::Public < ::RBI::Visibility + # pkg:gem/rbi#lib/rbi/model.rb:920 + 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:926 +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:220 + sig { params(type_name: ::String).returns(::String) } + def erase_t_generic_type(type_name); end + + # pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:135 + sig { params(type: ::RBS::Types::ClassInstance).returns(::RBI::Type) } + def translate_class_instance(type); end + + # pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:147 + sig { params(type: ::RBS::Types::Function).returns(::RBI::Type) } + def translate_function(type); end + + # pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:215 + sig { params(type_name: ::String).returns(::String) } + def translate_t_generic_type(type_name); end + + # pkg:gem/rbi#lib/rbi/rbs/type_translator.rb:123 + 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:206 +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:193 +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:210 +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:426 + sig { params(node: ::RBI::Method, sig: ::RBI::Sig).void } + def print_method_sig_inline(node, sig); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:488 + sig { params(node: ::RBI::Method, sig: ::RBI::Sig).void } + def print_method_sig_multiline(node, sig); 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:690 + 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:622 + 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:826 + 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:634 + 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:799 + sig { override.params(node: ::RBI::Group).void } + def visit_group(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:787 + sig { override.params(node: ::RBI::Helper).void } + def visit_helper(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:628 + sig { override.params(node: ::RBI::Include).void } + def visit_include(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:696 + sig { override.params(node: ::RBI::KwArg).void } + def visit_kw_arg(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:609 + sig { override.params(node: ::RBI::KwOptParam).void } + def visit_kw_opt_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:603 + sig { override.params(node: ::RBI::KwParam).void } + def visit_kw_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:615 + 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:793 + sig { override.params(node: ::RBI::MixesInClassMethods).void } + def visit_mixes_in_class_methods(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:639 + 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:583 + sig { override.params(node: ::RBI::OptParam).void } + def visit_opt_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:669 + sig { override.params(node: ::RBI::Private).void } + def visit_private(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:663 + sig { override.params(node: ::RBI::Protected).void } + def visit_protected(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:657 + sig { override.params(node: ::RBI::Public).void } + def visit_public(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:573 + sig { override.params(node: ::RBI::ReqParam).void } + def visit_req_param(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:820 + sig { override.params(node: ::RBI::RequiresAncestor).void } + def visit_requires_ancestor(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:593 + 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:836 + 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:684 + sig { override.params(node: ::RBI::Send).void } + def visit_send(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:554 + sig { params(node: ::RBI::Sig).void } + def visit_sig(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:567 + 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:753 + sig { override.params(node: ::RBI::TEnum).void } + def visit_tenum(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:759 + sig { override.params(node: ::RBI::TEnumBlock).void } + def visit_tenum_block(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:765 + 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:702 + sig { override.params(node: ::RBI::TStruct).void } + def visit_tstruct(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:737 + sig { override.params(node: ::RBI::TStructConst).void } + def visit_tstruct_const(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:745 + sig { override.params(node: ::RBI::TStructProp).void } + def visit_tstruct_prop(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:781 + sig { override.params(node: ::RBI::TypeMember).void } + def visit_type_member(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:674 + sig { params(node: ::RBI::Visibility).void } + def visit_visibility(node); end + + # @override + # + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:806 + sig { override.params(node: ::RBI::VisibilityGroup).void } + def visit_visibility_group(node); end + + private + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:929 + 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:963 + sig { params(code: T.nilable(::String)).returns(T.nilable(::String)) } + def parse_t_let(code); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:951 + sig { params(type: T.any(::RBI::Type, ::String)).returns(::RBI::Type) } + def parse_type(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:852 + sig { params(node: ::RBI::Node).void } + def print_blank_line_before(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:871 + sig { params(node: ::RBI::Node).void } + def print_loc(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:913 + 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:877 + sig { params(node: ::RBI::Method, param: ::RBI::SigParam).void } + def print_sig_param(node, param); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:921 + 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:622 +class RBI::ReqParam < ::RBI::Param + # pkg:gem/rbi#lib/rbi/model.rb:628 + 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:647 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:642 + sig { override.returns(T::Boolean) } + def anonymous?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:625 + sig { override.returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:636 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:1372 +class RBI::RequiresAncestor < ::RBI::NodeWithComments + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:1377 + 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:1374 + sig { returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:1384 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:686 +class RBI::RestParam < ::RBI::Param + # pkg:gem/rbi#lib/rbi/model.rb:692 + 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:711 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:706 + sig { override.returns(T::Boolean) } + def anonymous?; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:689 + sig { override.returns(T.nilable(::String)) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:700 + 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:69 + 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:947 +class RBI::Send < ::RBI::NodeWithComments + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:955 + 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:963 + sig { params(arg: ::RBI::Arg).void } + def <<(arg); end + + # pkg:gem/rbi#lib/rbi/model.rb:968 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:952 + 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:949 + sig { returns(::String) } + def method; end + + # pkg:gem/rbi#lib/rbi/model.rb:973 + sig { returns(::String) } + def to_s; end +end + +# Sorbet's sigs +# +# pkg:gem/rbi#lib/rbi/model.rb:1022 +class RBI::Sig < ::RBI::NodeWithComments + # pkg:gem/rbi#lib/rbi/model.rb:1080 + sig do + params( + params: T.nilable(T::Array[::RBI::SigParam]), + return_type: 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), 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:1112 + sig { params(param: ::RBI::SigParam).void } + def <<(param); end + + # pkg:gem/rbi#lib/rbi/model.rb:1122 + sig { params(other: ::Object).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:1117 + sig { params(name: ::String, type: T.any(::RBI::Type, ::String)).void } + def add_param(name, type); end + + # pkg:gem/rbi#lib/rbi/model.rb:1044 + sig { returns(T::Boolean) } + def allow_incompatible_override; end + + # pkg:gem/rbi#lib/rbi/model.rb:1044 + def allow_incompatible_override=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:1047 + sig { returns(T::Boolean) } + def allow_incompatible_override_visibility; end + + # pkg:gem/rbi#lib/rbi/model.rb:1047 + def allow_incompatible_override_visibility=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:1063 + sig { returns(T.nilable(::Symbol)) } + def checked; end + + # pkg:gem/rbi#lib/rbi/model.rb:1063 + def checked=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:1032 + sig { returns(T::Boolean) } + def is_abstract; end + + # pkg:gem/rbi#lib/rbi/model.rb:1032 + def is_abstract=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:1041 + sig { returns(T::Boolean) } + def is_final; end + + # pkg:gem/rbi#lib/rbi/model.rb:1041 + def is_final=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:1038 + sig { returns(T::Boolean) } + def is_overridable; end + + # pkg:gem/rbi#lib/rbi/model.rb:1038 + def is_overridable=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:1035 + sig { returns(T::Boolean) } + def is_override; end + + # pkg:gem/rbi#lib/rbi/model.rb:1035 + def is_override=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:1024 + sig { returns(T::Array[::RBI::SigParam]) } + def params; end + + # pkg:gem/rbi#lib/rbi/model.rb:1029 + sig { returns(T.any(::RBI::Type, ::String)) } + def return_type; end + + # pkg:gem/rbi#lib/rbi/model.rb:1029 + def return_type=(_arg0); end + + # pkg:gem/rbi#lib/rbi/model.rb:1053 + sig { returns(T::Array[::String]) } + def type_params; end + + # pkg:gem/rbi#lib/rbi/model.rb:1058 + sig { returns(T::Boolean) } + def type_params?; end + + # pkg:gem/rbi#lib/rbi/model.rb:1050 + sig { returns(T::Boolean) } + def without_runtime; end + + # pkg:gem/rbi#lib/rbi/model.rb:1050 + def without_runtime=(_arg0); end +end + +# pkg:gem/rbi#lib/rbi/model.rb:1131 +class RBI::SigParam < ::RBI::NodeWithComments + # pkg:gem/rbi#lib/rbi/model.rb:1139 + 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:1159 + sig { params(other: ::Object).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:1154 + sig { returns(T::Boolean) } + def anonymous?; end + + # pkg:gem/rbi#lib/rbi/model.rb:1133 + sig { returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:1149 + sig { override.returns(::String) } + def to_s; end + + # pkg:gem/rbi#lib/rbi/model.rb:1136 + 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:1256 +class RBI::TEnum < ::RBI::Class + # pkg:gem/rbi#lib/rbi/model.rb:1258 + 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:1264 +class RBI::TEnumBlock < ::RBI::Scope + # pkg:gem/rbi#lib/rbi/model.rb:1266 + 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:1273 + 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:1279 + sig { override.returns(::String) } + def to_s; end +end + +# pkg:gem/rbi#lib/rbi/model.rb:1284 +class RBI::TEnumValue < ::RBI::NodeWithComments + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:1289 + 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:1296 + 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:1286 + sig { returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:1302 + sig { override.returns(::String) } + def to_s; end +end + +# Sorbet's T::Struct +# +# pkg:gem/rbi#lib/rbi/model.rb:1168 +class RBI::TStruct < ::RBI::Class + # pkg:gem/rbi#lib/rbi/model.rb:1170 + 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:1200 +class RBI::TStructConst < ::RBI::TStructField + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:1208 + 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:1215 + 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:1222 + sig { override.returns(::String) } + def to_s; end +end + +# @abstract +# +# pkg:gem/rbi#lib/rbi/model.rb:1177 +class RBI::TStructField < ::RBI::NodeWithComments + abstract! + + # pkg:gem/rbi#lib/rbi/model.rb:1188 + 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:1185 + sig { returns(T.nilable(::String)) } + def default; end + + # pkg:gem/rbi#lib/rbi/model.rb:1185 + def default=(_arg0); end + + # @abstract + # + # pkg:gem/rbi#lib/rbi/model.rb:1197 + sig { abstract.returns(T::Array[::String]) } + def fully_qualified_names; end + + # pkg:gem/rbi#lib/rbi/model.rb:1179 + sig { returns(::String) } + def name; end + + # pkg:gem/rbi#lib/rbi/model.rb:1182 + sig { returns(T.any(::RBI::Type, ::String)) } + def type; end + + # pkg:gem/rbi#lib/rbi/model.rb:1182 + def type=(_arg0); end +end + +# pkg:gem/rbi#lib/rbi/model.rb:1227 +class RBI::TStructProp < ::RBI::TStructField + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:1235 + 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:1242 + 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:1249 + 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:77 + 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:993 + sig { void } + def initialize; end + + # @abstract + # + # pkg:gem/rbi#lib/rbi/type.rb:1064 + sig { abstract.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/type.rb:1067 + sig { params(other: ::BasicObject).returns(T::Boolean) } + def eql?(other); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:1073 + 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:1007 + sig { returns(::RBI::Type) } + def nilable; end + + # Returns whether the type is nilable. + # + # pkg:gem/rbi#lib/rbi/type.rb:1034 + 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:1022 + 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:1048 + sig { abstract.returns(::RBI::Type) } + def normalize; end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1266 + 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:1060 + sig { abstract.returns(::RBI::Type) } + def simplify; end + + # @abstract + # + # pkg:gem/rbi#lib/rbi/type.rb:1079 + sig { abstract.returns(::String) } + def to_rbi; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:1083 + 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:929 + 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:938 + 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:854 + sig { returns(::RBI::Type::Anything) } + def anything; end + + # Builds a type that represents `T.attached_class`. + # + # pkg:gem/rbi#lib/rbi/type.rb:860 + sig { returns(::RBI::Type::AttachedClass) } + def attached_class; end + + # Builds a type that represents `T::Boolean`. + # + # pkg:gem/rbi#lib/rbi/type.rb:866 + 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:910 + sig { params(type: ::RBI::Type::Simple, type_parameter: T.nilable(::RBI::Type)).returns(::RBI::Type::ClassOf) } + def class_of(type, type_parameter = T.unsafe(nil)); 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:946 + 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:919 + 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:872 + 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:980 + sig { returns(::RBI::Type::Proc) } + def proc; end + + # Builds a type that represents `T.self_type`. + # + # pkg:gem/rbi#lib/rbi/type.rb:878 + 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:972 + 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:843 + 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:898 + 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:904 + 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:966 + 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:958 + 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:952 + 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:884 + sig { returns(::RBI::Type::Untyped) } + def untyped; end + + # Builds a type that represents `void`. + # + # pkg:gem/rbi#lib/rbi/type.rb:890 + sig { returns(::RBI::Type::Void) } + def void; end + + private + + # pkg:gem/rbi#lib/rbi/type_parser.rb:322 + sig { params(node: ::Prism::CallNode).returns(T::Array[::Prism::Node]) } + def call_chain(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:309 + 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:294 + 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:244 + sig { params(node: ::Prism::CallNode).returns(::RBI::Type) } + def parse_proc(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:223 + 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:218 + sig { params(node: ::Prism::ArrayNode).returns(::RBI::Type) } + def parse_tuple(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:335 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def t?(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:354 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def t_boolean?(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:361 + sig { params(node: ::Prism::ConstantPathNode).returns(T::Boolean) } + def t_class?(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:371 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def t_class_of?(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:366 + sig { params(node: ::Prism::ConstantPathNode).returns(T::Boolean) } + def t_module?(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:378 + sig { params(node: ::Prism::CallNode).returns(T::Boolean) } + def t_proc?(node); end + + # pkg:gem/rbi#lib/rbi/type_parser.rb:347 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def t_type_alias?(node); end + + # pkg:gem/rbi#lib/rbi/type.rb:987 + 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_parameter: T.nilable(::RBI::Type)).void } + def initialize(type, type_parameter = T.unsafe(nil)); 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.nilable(::RBI::Type)) } + def type_parameter; 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:743 +class RBI::Type::Proc < ::RBI::Type + # pkg:gem/rbi#lib/rbi/type.rb:754 + sig { void } + def initialize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:763 + sig { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/type.rb:791 + sig { params(type: T.untyped).returns(T.self_type) } + def bind(type); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:823 + sig { override.returns(::RBI::Type) } + def normalize; end + + # pkg:gem/rbi#lib/rbi/type.rb:773 + sig { params(params: ::RBI::Type).returns(T.self_type) } + def params(**params); end + + # pkg:gem/rbi#lib/rbi/type.rb:751 + sig { returns(T.nilable(::RBI::Type)) } + def proc_bind; end + + # pkg:gem/rbi#lib/rbi/type.rb:745 + sig { returns(T::Hash[::Symbol, ::RBI::Type]) } + def proc_params; end + + # pkg:gem/rbi#lib/rbi/type.rb:748 + sig { returns(::RBI::Type) } + def proc_returns; end + + # pkg:gem/rbi#lib/rbi/type.rb:779 + sig { params(type: T.untyped).returns(T.self_type) } + def returns(type); end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:829 + sig { override.returns(::RBI::Type) } + def simplify; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:798 + sig { override.returns(::String) } + def to_rbi; end + + # pkg:gem/rbi#lib/rbi/type.rb:785 + 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:729 + sig { override.returns(::RBI::Type) } + def normalize; end + + # @override + # + # pkg:gem/rbi#lib/rbi/type.rb:735 + 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:1327 +class RBI::TypeMember < ::RBI::NodeWithComments + include ::RBI::Indexable + + # pkg:gem/rbi#lib/rbi/model.rb:1332 + 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:1340 + 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:1329 + sig { returns(::String) } + def name; end + + # @override + # + # pkg:gem/rbi#lib/rbi/model.rb:1348 + sig { override.returns(::String) } + def to_s; end + + # pkg:gem/rbi#lib/rbi/model.rb:1329 + def value; end +end + +# pkg:gem/rbi#lib/rbi/rbs_printer.rb:984 +class RBI::TypePrinter + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:989 + 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:986 + sig { returns(::String) } + def string; end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:995 + sig { params(node: ::RBI::Type).void } + def visit(node); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1117 + sig { params(type: ::RBI::Type::All).void } + def visit_all(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1127 + sig { params(type: ::RBI::Type::Any).void } + def visit_any(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1062 + sig { params(type: ::RBI::Type::Anything).void } + def visit_anything(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1087 + sig { params(type: ::RBI::Type::AttachedClass).void } + def visit_attached_class(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1046 + sig { params(type: ::RBI::Type::Boolean).void } + def visit_boolean(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1194 + sig { params(type: ::RBI::Type::Class).void } + def visit_class(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1105 + sig { params(type: ::RBI::Type::ClassOf).void } + def visit_class_of(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1051 + sig { params(type: ::RBI::Type::Generic).void } + def visit_generic(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1201 + sig { params(type: ::RBI::Type::Module).void } + def visit_module(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1092 + sig { params(type: ::RBI::Type::Nilable).void } + def visit_nilable(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1072 + sig { params(type: ::RBI::Type::NoReturn).void } + def visit_no_return(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1167 + sig { params(type: ::RBI::Type::Proc).void } + def visit_proc(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1082 + sig { params(type: ::RBI::Type::SelfType).void } + def visit_self_type(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1147 + sig { params(type: ::RBI::Type::Shape).void } + def visit_shape(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1041 + sig { params(type: ::RBI::Type::Simple).void } + def visit_simple(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1137 + sig { params(type: ::RBI::Type::Tuple).void } + def visit_tuple(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1189 + sig { params(type: ::RBI::Type::TypeParameter).void } + def visit_type_parameter(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1077 + sig { params(type: ::RBI::Type::Untyped).void } + def visit_untyped(type); end + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1067 + sig { params(type: ::RBI::Type::Void).void } + def visit_void(type); end + + private + + # pkg:gem/rbi#lib/rbi/rbs_printer.rb:1210 + 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:885 +class RBI::Visibility < ::RBI::NodeWithComments + abstract! + + # pkg:gem/rbi#lib/rbi/model.rb:890 + 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:896 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # pkg:gem/rbi#lib/rbi/model.rb:913 + sig { returns(T::Boolean) } + def private?; end + + # pkg:gem/rbi#lib/rbi/model.rb:908 + sig { returns(T::Boolean) } + def protected?; end + + # pkg:gem/rbi#lib/rbi/model.rb:903 + sig { returns(T::Boolean) } + def public?; end + + # pkg:gem/rbi#lib/rbi/model.rb:887 + 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:108 + sig { params(nodes: T::Array[::RBI::Node]).void } + def visit_all(nodes); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:113 + sig { params(file: ::RBI::File).void } + def visit_file(file); end + + private + + # pkg:gem/rbi#lib/rbi/visitor.rb:198 + sig { params(node: ::RBI::Arg).void } + def visit_arg(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:147 + sig { params(node: ::RBI::AttrAccessor).void } + def visit_attr_accessor(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:150 + sig { params(node: ::RBI::AttrReader).void } + def visit_attr_reader(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:153 + sig { params(node: ::RBI::AttrWriter).void } + def visit_attr_writer(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:126 + sig { params(node: ::RBI::BlankLine).void } + def visit_blank_line(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:177 + sig { params(node: ::RBI::BlockParam).void } + def visit_block_param(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:132 + sig { params(node: ::RBI::Class).void } + def visit_class(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:120 + sig { params(node: ::RBI::Comment).void } + def visit_comment(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:246 + sig { params(node: ::RBI::ConflictTree).void } + def visit_conflict_tree(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:144 + sig { params(node: ::RBI::Const).void } + def visit_const(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:183 + sig { params(node: ::RBI::Extend).void } + def visit_extend(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:240 + sig { params(node: ::RBI::Group).void } + def visit_group(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:228 + sig { params(node: ::RBI::Helper).void } + def visit_helper(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:180 + sig { params(node: ::RBI::Include).void } + def visit_include(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:201 + sig { params(node: ::RBI::KwArg).void } + def visit_kw_arg(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:171 + sig { params(node: ::RBI::KwOptParam).void } + def visit_kw_opt_param(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:168 + sig { params(node: ::RBI::KwParam).void } + def visit_kw_param(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:174 + sig { params(node: ::RBI::KwRestParam).void } + def visit_kw_rest_param(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:156 + sig { params(node: ::RBI::Method).void } + def visit_method(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:234 + sig { params(node: ::RBI::MixesInClassMethods).void } + def visit_mixes_in_class_methods(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:129 + sig { params(node: ::RBI::Module).void } + def visit_module(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:162 + sig { params(node: ::RBI::OptParam).void } + def visit_opt_param(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:192 + sig { params(node: ::RBI::Private).void } + def visit_private(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:189 + sig { params(node: ::RBI::Protected).void } + def visit_protected(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:186 + sig { params(node: ::RBI::Public).void } + def visit_public(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:123 + sig { params(node: ::RBI::RBSComment).void } + def visit_rbs_comment(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:159 + sig { params(node: ::RBI::ReqParam).void } + def visit_req_param(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:237 + sig { params(node: ::RBI::RequiresAncestor).void } + def visit_requires_ancestor(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:165 + sig { params(node: ::RBI::RestParam).void } + def visit_rest_param(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:249 + sig { params(node: ::RBI::ScopeConflict).void } + def visit_scope_conflict(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:195 + sig { params(node: ::RBI::Send).void } + def visit_send(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:204 + sig { params(node: ::RBI::Sig).void } + def visit_sig(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:207 + sig { params(node: ::RBI::SigParam).void } + def visit_sig_param(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:135 + sig { params(node: ::RBI::SingletonClass).void } + def visit_singleton_class(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:138 + sig { params(node: ::RBI::Struct).void } + def visit_struct(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:219 + sig { params(node: ::RBI::TEnum).void } + def visit_tenum(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:222 + sig { params(node: ::RBI::TEnumBlock).void } + def visit_tenum_block(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:225 + sig { params(node: ::RBI::TEnumValue).void } + def visit_tenum_value(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:141 + sig { params(node: ::RBI::Tree).void } + def visit_tree(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:210 + sig { params(node: ::RBI::TStruct).void } + def visit_tstruct(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:213 + sig { params(node: ::RBI::TStructConst).void } + def visit_tstruct_const(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:216 + sig { params(node: ::RBI::TStructProp).void } + def visit_tstruct_prop(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:231 + sig { params(node: ::RBI::TypeMember).void } + def visit_type_member(node); end + + # pkg:gem/rbi#lib/rbi/visitor.rb:243 + 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.0.3.rbi b/sorbet/rbi/gems/rbs@4.0.3.rbi new file mode 100644 index 0000000..fd7971e --- /dev/null +++ b/sorbet/rbi/gems/rbs@4.0.3.rbi @@ -0,0 +1,6908 @@ +# 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`. + + +# pkg:gem/rbs#lib/rbs/version.rb:3 +module RBS + class << self + # pkg:gem/rbs#lib/rbs.rb:80 + def logger; end + + # pkg:gem/rbs#lib/rbs.rb:77 + def logger_level; end + + # pkg:gem/rbs#lib/rbs.rb:89 + def logger_level=(level); end + + # pkg:gem/rbs#lib/rbs.rb:78 + def logger_output; end + + # pkg:gem/rbs#lib/rbs.rb:84 + def logger_output=(val); end + + # pkg:gem/rbs#lib/rbs.rb:94 + 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:356 +class RBS::AST::Ruby::Annotations::BlockParamTypeAnnotation < ::RBS::AST::Ruby::Annotations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:359 + 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:357 + def ampersand_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:370 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:384 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:357 + def name_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:388 + def optional?; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:357 + def question_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:392 + def required?; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:357 + def type; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:396 + def type_fingerprint; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/annotations.rb:357 + 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: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:226 + 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:211 + def comments; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:98 + def each_paragraph(variables, &block); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:50 + def end_line; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:36 + def leading?; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:215 + def leading_annotation?(index); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:174 + def line_location(start_line, end_line); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:54 + def line_starts; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:180 + 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:187 + def parse_annotation_lines(start_line, end_line, variables); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:46 + def start_line; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:169 + def text(comment_index); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:41 + def trailing?; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:197 + def trailing_annotation(variables); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:130 + def yield_annotation(start_line, end_line, current_line, variables, &block); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:110 + def yield_paragraph(start_line, current_line, variables, &block); end + + class << self + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:60 + def build(buffer, comments); end + end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:96 +class RBS::AST::Ruby::CommentBlock::AnnotationSyntaxError < ::Struct + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:96 + def error; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:96 + def error=(_); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:96 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:96 + def location=(_); end + + class << self + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:96 + def [](*_arg0); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:96 + def inspect; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:96 + def keyword_init?; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:96 + def members; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/comment_block.rb:96 + 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:223 +class RBS::AST::Ruby::Declarations::ClassModuleAliasDecl < ::RBS::AST::Ruby::Declarations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:230 + def initialize(buffer, node, new_name, infered_old_name, leading_comment, annotation); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:228 + def annotation; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:264 + def comment; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:227 + def infered_old_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:225 + def leading_comment; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:239 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:243 + def name_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:226 + def new_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:224 + def node; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:252 + def old_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:268 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:161 +class RBS::AST::Ruby::Declarations::ConstantDecl < ::RBS::AST::Ruby::Declarations::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:167 + def initialize(buffer, constant_name, node, leading_comment, type_annotation); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:209 + def comment; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:163 + def constant_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:162 + def leading_comment; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:175 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:179 + def name_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:164 + def node; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:188 + def type; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:165 + def type_annotation; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/declarations.rb:213 + 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:142 + 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:146 + 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:150 + 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:690 +class RBS::AST::Ruby::Members::AttrAccessorMember < ::RBS::AST::Ruby::Members::AttributeMember; end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:684 +class RBS::AST::Ruby::Members::AttrReaderMember < ::RBS::AST::Ruby::Members::AttributeMember; end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:687 +class RBS::AST::Ruby::Members::AttrWriterMember < ::RBS::AST::Ruby::Members::AttributeMember; end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:639 +class RBS::AST::Ruby::Members::AttributeMember < ::RBS::AST::Ruby::Members::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:645 + def initialize(buffer, node, name_nodes, leading_comment, type_annotation); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:643 + def leading_comment; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:659 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:663 + def name_locations; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:641 + def name_nodes; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:653 + def names; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:640 + def node; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:669 + def type; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:642 + def type_annotation; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:673 + 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:555 + def initialize(buffer, name, node, method_type, leading_comment); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:575 + def annotations; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:553 + def leading_comment; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:563 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:552 + 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:579 + 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:571 + def overloading?; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:567 + def overloads; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:583 + 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:633 +class RBS::AST::Ruby::Members::ExtendMember < ::RBS::AST::Ruby::Members::MixinMember; end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:630 +class RBS::AST::Ruby::Members::IncludeMember < ::RBS::AST::Ruby::Members::MixinMember; end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:693 +class RBS::AST::Ruby::Members::InstanceVariableMember < ::RBS::AST::Ruby::Members::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:696 + def initialize(buffer, annotation); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:694 + def annotation; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:709 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:701 + def name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:705 + def type; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:713 + 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:593 +class RBS::AST::Ruby::Members::MixinMember < ::RBS::AST::Ruby::Members::Base + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:598 + def initialize(buffer, node, module_name, annotation); end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:596 + def annotation; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:605 + def location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:595 + def module_name; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:609 + def name_location; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:594 + def node; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:616 + def type_args; end + + # pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:620 + def type_fingerprint; end +end + +# pkg:gem/rbs#lib/rbs/ast/ruby/members.rb:636 +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:131 + def absolute_position(position); end + + # pkg:gem/rbs#lib/rbs/buffer.rb:6 + def content; end + + # pkg:gem/rbs#lib/rbs/buffer.rb:148 + 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:116 + def parent_buffer; end + + # pkg:gem/rbs#lib/rbs/buffer.rb:122 + 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:90 + def rbs_location(location, loc2 = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/buffer.rb:98 + def sub_buffer(lines:); end + + # pkg:gem/rbs#lib/rbs/buffer.rb:140 + 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(*_arg0, **_arg1, &_arg2); 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:48 + def initialize(config:, definition:, with_lockfile:); end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:40 + def config; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:40 + def definition; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:40 + def existing_lockfile; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:40 + def gem_entries; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:40 + def gem_hash; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:76 + def generate; end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:40 + def lockfile; end + + private + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:109 + def assign_gem(name:, version:, skip: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:175 + def assign_stdlib(name:, from_gem: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:246 + def find_best_version(version:, versions:); end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:240 + def find_source(name:); end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:101 + def validate_gemfile_lock_path!(lock:, gemfile_lock_path:); end + + class << self + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:42 + 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:24 +class RBS::Collection::Config::LockfileGenerator::GemfileLockMismatchError < ::StandardError + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:25 + def initialize(expected:, actual:); end + + # pkg:gem/rbs#lib/rbs/collection/config/lockfile_generator.rb:30 + def message; end +end + +# 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:224 + 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:208 + 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:173 + 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:216 + 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:184 + 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:169 + def gem_repo_dir; end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:230 + def gems_versions; end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:188 + def git(*cmd, **opt); end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:192 + def git?(*cmd, **opt); end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:159 + def git_dir; end + + # pkg:gem/rbs#lib/rbs/collection/sources/git.rb:153 + 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:198 + 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:195 + 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:327 + def build_singleton(type_name); end + + # Builds a definition for singleton without .new method. + # + # pkg:gem/rbs#lib/rbs/definition_builder.rb:257 + 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:695 + 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:983 + def expand_alias(type_name); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:987 + def expand_alias1(type_name); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:994 + def expand_alias2(type_name, args); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:634 + def import_methods(definition, module_name, module_methods, interfaces_methods, subst, self_type_methods); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:583 + 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:453 + 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:483 + def source_location(source, decl); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:973 + 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:979 + def try_cache(type_name, cache:); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:1018 + def update(env:, except:, ancestor_builder:); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:473 + def validate_params_with(type_params, result:); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:1047 + def validate_type_name(name, location); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:501 + def validate_type_params(definition, ancestors:, methods:); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:1036 + def validate_type_presence(type); end + + # pkg:gem/rbs#lib/rbs/definition_builder.rb:594 + 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:664 + def fill_ancestor_source(ancestor, name:, source:, &block); end + + # pkg:gem/rbs#lib/rbs/definition_builder/ancestor_builder.rb:492 + 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:628 + 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:474 + 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:350 + 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:192 + 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:331 + 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:277 + 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:573 + 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:211 + def build_alias(methods, type, member:); end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:216 + 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:191 + def build_interface(type_name); end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:250 + def build_method(methods, type, member:, accessibility:); end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:232 + def build_ruby_attribute(methods, type, member:, accessibility:); end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:162 + def build_singleton(type_name); end + + # pkg:gem/rbs#lib/rbs/definition_builder/method_builder.rb:261 + 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:274 + 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), **_arg1); 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:981 + def absolute_type(resolver, map, type, context:); end + + # pkg:gem/rbs#lib/rbs/environment.rb:976 + 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:992 + 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:987 + 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:862 + def resolve_member(resolver, map, member, context:); end + + # pkg:gem/rbs#lib/rbs/environment.rb:962 + 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:970 + 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:996 + 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: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: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:49 + 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:472 + 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:315 + def parse_attribute_call(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:375 + def parse_constant_declaration(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:259 + def parse_mixin_call(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:508 + 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:480 + def report_unused_annotation(*annotations); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:495 + 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:217 + 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:253 + def visit_constant_path_write_node(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:246 + def visit_constant_write_node(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:178 + def visit_def_node(node); end + + # pkg:gem/rbs#lib/rbs/inline_parser.rb:156 + 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 + +# pkg:gem/rbs#lib/rbs.rb:71 +class RBS::Location + # pkg:gem/rbs#lib/rbs.rb:71 + def initialize(_arg0, _arg1, _arg2); end + + # pkg:gem/rbs#lib/rbs/location_aux.rb:79 + def ==(other); end + + # pkg:gem/rbs#lib/rbs.rb:71 + def [](_arg0); end + + # pkg:gem/rbs#lib/rbs.rb:71 + def _add_optional_child(_arg0, _arg1, _arg2); end + + # pkg:gem/rbs#lib/rbs.rb:71 + def _add_optional_no_child(_arg0); end + + # pkg:gem/rbs#lib/rbs.rb:71 + def _add_required_child(_arg0, _arg1, _arg2); end + + # pkg:gem/rbs#lib/rbs.rb:71 + def _end_pos; end + + # pkg:gem/rbs#lib/rbs.rb:71 + def _optional_keys; end + + # pkg:gem/rbs#lib/rbs.rb:71 + def _required_keys; end + + # pkg:gem/rbs#lib/rbs.rb:71 + 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:71 + 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:71 + 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:20 + def +(other); end + + # pkg:gem/rbs#lib/rbs/namespace.rb:59 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/namespace.rb:47 + def absolute!; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:39 + def absolute?; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:28 + def append(component); end + + # pkg:gem/rbs#lib/rbs/namespace.rb:101 + def ascend; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:55 + def empty?; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:63 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/namespace.rb:65 + def hash; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:32 + def parent; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:5 + def path; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:51 + def relative!; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:43 + def relative?; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:69 + def split; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:75 + def to_s; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:84 + def to_type_name; end + + class << self + # pkg:gem/rbs#lib/rbs/namespace.rb:12 + def empty; end + + # pkg:gem/rbs#lib/rbs/namespace.rb:93 + def parse(string); end + + # pkg:gem/rbs#lib/rbs/namespace.rb:16 + def root; end + end +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 + +# pkg:gem/rbs#lib/rbs.rb:71 +class RBS::Parser + class << self + # pkg:gem/rbs#lib/rbs.rb:71 + def _lex(_arg0, _arg1); end + + # pkg:gem/rbs#lib/rbs.rb:71 + def _parse_inline_leading_annotation(_arg0, _arg1, _arg2, _arg3); end + + # pkg:gem/rbs#lib/rbs.rb:71 + def _parse_inline_trailing_annotation(_arg0, _arg1, _arg2, _arg3); end + + # pkg:gem/rbs#lib/rbs.rb:71 + def _parse_method_type(_arg0, _arg1, _arg2, _arg3, _arg4); end + + # pkg:gem/rbs#lib/rbs.rb:71 + def _parse_signature(_arg0, _arg1, _arg2); end + + # pkg:gem/rbs#lib/rbs.rb:71 + def _parse_type(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7); end + + # pkg:gem/rbs#lib/rbs.rb:71 + def _parse_type_params(_arg0, _arg1, _arg2, _arg3); end + + # pkg:gem/rbs#lib/rbs/parser_aux.rb:79 + def buffer(source); end + + # pkg:gem/rbs#lib/rbs/parser_aux.rb:132 + 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:127 + 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:153 + 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:177 + def args_from_node(args_node); end + + # pkg:gem/rbs#lib/rbs/prototype/helpers.rb:65 + def block_from_body(node); end + + # pkg:gem/rbs#lib/rbs/prototype/helpers.rb:141 + def each_child(node, &block); end + + # pkg:gem/rbs#lib/rbs/prototype/helpers.rb:145 + def each_node(nodes); end + + # pkg:gem/rbs#lib/rbs/prototype/helpers.rb:165 + def keyword_hash?(node); end + + # pkg:gem/rbs#lib/rbs/prototype/helpers.rb:10 + def parse_comments(string, include_trailing:); end + + # pkg:gem/rbs#lib/rbs/prototype/helpers.rb:181 + def symbol_literal_node?(node); end + + # pkg:gem/rbs#lib/rbs/prototype/helpers.rb:192 + 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:12 + def initialize; end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:545 + def call_node?(node, name:, receiver: T.unsafe(nil), args: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:549 + def const_to_name(node); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:71 + def current_module; end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:75 + def current_module!; end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:27 + def current_namespace; end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:8 + def decls; end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:585 + def each_arg(array, &block); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:599 + def each_child(node); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:93 + def join_comments(nodes, comments); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:10 + def last_sig; end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:262 + 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:23 + def nested_name(name); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:607 + def node_to_hash(node); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:18 + def parse(string); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:335 + def parse_params(args_node, args, method_type, variables:, overloads:); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:87 + def pop_sig; end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:537 + def proc_type?(type_node); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:98 + def process(node, comments:, outer: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:33 + def push_class(name, super_class, comment:); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:52 + def push_module(name, comment:); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:79 + def push_sig(node); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:460 + def type_of(type_node, variables:); end + + # pkg:gem/rbs#lib/rbs/prototype/rbi.rb:473 + def type_of0(type_node, variables:); 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:662 + def block_from_ast_of(method); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:109 + def builder; end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:117 + 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:591 + 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:496 + def generate_class(mod); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:433 + def generate_constants(mod, decls); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:309 + def generate_methods(mod, module_name, members); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:573 + def generate_mixin(mod, decl, type_name, type_name_absolute); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:535 + def generate_module(mod); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:481 + 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:248 + def merge_rbs(module_name, members, instance: T.unsafe(nil), singleton: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:179 + 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:113 + def parse(file); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:72 + def patterns; end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:92 + def target?(const); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:296 + 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:105 + def todo_object; end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:645 + def type_args(type_name); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:653 + def type_params(mod); end + + private + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:423 + def can_alias?(mod, method); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:137 + def each_mixined_module(type_name, mod); end + + # pkg:gem/rbs#lib/rbs/prototype/runtime.rb:146 + 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:229 + 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:237 + def build_s_new; end + + # pkg:gem/rbs#lib/rbs/prototype/runtime/value_object_generator.rb:225 + 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:82 + 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:76 + def has_type_name?(full_name); end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:121 + def normalize_namespace(type_name, rhs, context, visited); end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:39 + def resolve(type_name, context:); end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:104 + def resolve_head_namespace(head, context); end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:62 + def resolve_namespace(type_name, context:); end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:136 + def resolve_namespace0(type_name, context, visited); end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:88 + def resolve_type_name(type_name, context); end + + # pkg:gem/rbs#lib/rbs/resolver/type_name_resolver.rb:32 + def try_cache(query); 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/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:79 + def +(other); end + + # pkg:gem/rbs#lib/rbs/type_name.rb:25 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/type_name.rb:55 + def absolute!; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:59 + def absolute?; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:51 + def alias?; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:47 + def class?; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:29 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/type_name.rb:31 + def hash; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:67 + 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:63 + def relative!; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:75 + def split; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:39 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/type_name.rb:43 + def to_namespace; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:35 + def to_s; end + + # pkg:gem/rbs#lib/rbs/type_name.rb:71 + def with_prefix(namespace); end + + class << self + # pkg:gem/rbs#lib/rbs/type_name.rb:90 + 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:1348 +class RBS::Types::Block + # pkg:gem/rbs#lib/rbs/types.rb:1354 + def initialize(type:, required:, location: T.unsafe(nil), self_type: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1361 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:1352 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:1386 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1350 + def required; end + + # pkg:gem/rbs#lib/rbs/types.rb:1351 + def self_type; end + + # pkg:gem/rbs#lib/rbs/types.rb:1376 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/types.rb:1368 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1349 + 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:971 + def initialize(required_positionals:, optional_positionals:, rest_positionals:, trailing_positionals:, required_keywords:, optional_keywords:, rest_keywords:, return_type:); end + + # pkg:gem/rbs#lib/rbs/types.rb:982 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:1053 + def amap(array, &block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1192 + def drop_head; end + + # pkg:gem/rbs#lib/rbs/types.rb:1209 + def drop_tail; end + + # pkg:gem/rbs#lib/rbs/types.rb:1090 + def each_param(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1075 + def each_type; end + + # pkg:gem/rbs#lib/rbs/types.rb:1163 + def empty?; end + + # pkg:gem/rbs#lib/rbs/types.rb:994 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:1008 + def free_variables(set = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1234 + def has_classish_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1222 + def has_keyword?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1230 + def has_self_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:996 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:1061 + def hmapv(hash, &block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1036 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1069 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:967 + def optional_keywords; end + + # pkg:gem/rbs#lib/rbs/types.rb:963 + def optional_positionals; end + + # pkg:gem/rbs#lib/rbs/types.rb:1173 + def param_to_s; end + + # pkg:gem/rbs#lib/rbs/types.rb:966 + def required_keywords; end + + # pkg:gem/rbs#lib/rbs/types.rb:962 + def required_positionals; end + + # pkg:gem/rbs#lib/rbs/types.rb:968 + def rest_keywords; end + + # pkg:gem/rbs#lib/rbs/types.rb:964 + def rest_positionals; end + + # pkg:gem/rbs#lib/rbs/types.rb:1188 + def return_to_s; end + + # pkg:gem/rbs#lib/rbs/types.rb:969 + def return_type; end + + # pkg:gem/rbs#lib/rbs/types.rb:1117 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/types.rb:1104 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:965 + def trailing_positionals; end + + # pkg:gem/rbs#lib/rbs/types.rb:1149 + 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), return_type: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1238 + def with_nonreturn_void?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1136 + def with_return_type(type); end + + class << self + # pkg:gem/rbs#lib/rbs/types.rb:1123 + def empty(return_type); end + 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:1530 +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:1534 + def initialize(literal:, location:); end + + # pkg:gem/rbs#lib/rbs/types.rb:1539 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:1543 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:1566 + def has_classish_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1562 + def has_self_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1545 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:1531 + def literal; end + + # pkg:gem/rbs#lib/rbs/types.rb:1532 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:1554 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1558 + def to_s(level = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1570 + def with_nonreturn_void?; end + + class << self + # pkg:gem/rbs#lib/rbs/types.rb:1590 + def unescape_string(string, is_double_quote); end + end +end + +# pkg:gem/rbs#lib/rbs/types.rb:1574 +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(&_arg0); 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:1407 +class RBS::Types::Proc + # pkg:gem/rbs#lib/rbs/types.rb:1413 + def initialize(location:, type:, block:, self_type: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1420 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:1409 + def block; end + + # pkg:gem/rbs#lib/rbs/types.rb:1474 + def each_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1424 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:1430 + def free_variables(set = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1513 + def has_classish_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1509 + def has_self_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1426 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:1411 + def location; end + + # pkg:gem/rbs#lib/rbs/types.rb:1496 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1487 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1410 + def self_type; end + + # pkg:gem/rbs#lib/rbs/types.rb:1447 + def sub(s); end + + # pkg:gem/rbs#lib/rbs/types.rb:1437 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1458 + def to_s(level = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1408 + def type; end + + # pkg:gem/rbs#lib/rbs/types.rb:1517 + 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:1395 +module RBS::Types::SelfTypeBindingHelper + private + + # pkg:gem/rbs#lib/rbs/types.rb:1398 + def self_type_binding_to_s(t); end + + class << self + # pkg:gem/rbs#lib/rbs/types.rb:1398 + 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:1251 +class RBS::Types::UntypedFunction + # pkg:gem/rbs#lib/rbs/types.rb:1254 + def initialize(return_type:); end + + # pkg:gem/rbs#lib/rbs/types.rb:1336 + def ==(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:1284 + def each_param(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1276 + def each_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1312 + def empty?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1340 + def eql?(other); end + + # pkg:gem/rbs#lib/rbs/types.rb:1258 + def free_variables(acc = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1320 + def has_classish_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1316 + def has_self_type?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1342 + def hash; end + + # pkg:gem/rbs#lib/rbs/types.rb:1262 + def map_type(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1270 + def map_type_name(&block); end + + # pkg:gem/rbs#lib/rbs/types.rb:1328 + def param_to_s; end + + # pkg:gem/rbs#lib/rbs/types.rb:1332 + def return_to_s; end + + # pkg:gem/rbs#lib/rbs/types.rb:1252 + def return_type; end + + # pkg:gem/rbs#lib/rbs/types.rb:1298 + def sub(subst); end + + # pkg:gem/rbs#lib/rbs/types.rb:1292 + def to_json(state = T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1308 + def update(return_type: T.unsafe(nil)); end + + # pkg:gem/rbs#lib/rbs/types.rb:1324 + def with_nonreturn_void?; end + + # pkg:gem/rbs#lib/rbs/types.rb:1304 + 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/regexp_parser@2.12.0.rbi b/sorbet/rbi/gems/regexp_parser@2.12.0.rbi new file mode 100644 index 0000000..20c5398 --- /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(*_arg0); 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::V3_2_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.4.1.rbi b/sorbet/rbi/gems/require-hooks@0.4.1.rbi new file mode 100644 index 0000000..1e536b2 --- /dev/null +++ b/sorbet/rbi/gems/require-hooks@0.4.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..c9ceeda --- /dev/null +++ b/sorbet/rbi/gems/rspec-core@3.13.6.rbi @@ -0,0 +1,9720 @@ +# 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, **_arg2); 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(*_arg0); 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 + + # 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 deep_merge(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def deep_merge!(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def deep_merge?(*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 except!(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/metadata.rb:367 + def extract!(*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!(*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(*_arg0); 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 + + # 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: + # @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. + # + # 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(*_arg0); 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 beep(*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 check_winsize_changed(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def clear_screen(*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 console_mode(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def console_mode=(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def cooked(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def cooked!(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def cursor(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def cursor=(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def cursor_down(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def cursor_left(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def cursor_right(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def cursor_up(*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 echo=(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def echo?(*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 erase_line(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def erase_screen(*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 getch(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def getpass(*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 goto(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def goto_column(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def iflush(*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 ioflush(*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 noecho(*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 + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def nread(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def oflush(*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 pressed?(*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 raw(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def raw!(*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 ready?(*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 scroll_backward(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def scroll_forward(*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 ttyname(*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 winsize(*args, &block); end + + # pkg:gem/rspec-core#lib/rspec/core/output_wrapper.rb:23 + def winsize=(*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..cd68dbc --- /dev/null +++ b/sorbet/rbi/gems/rspec-expectations@3.13.5.rbi @@ -0,0 +1,6066 @@ +# 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(*_arg0); 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, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_block_outputting(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_block_raising(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_block_throwing(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_block_yielding_control(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_block_yielding_successive_args(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_block_yielding_with_args(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_block_yielding_with_no_args(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_collection_containing_exactly(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_collection_ending_with(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_collection_including(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_collection_starting_with(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_falsey_value(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_falsy_value(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_hash_including(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_kind_of(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_nil_value(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_range_covering(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_string_ending_with(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_string_including(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_string_matching(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_string_starting_with(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_truthy_value(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_value(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_value_between(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def a_value_within(*args, **_arg1, &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, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_instance_of(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_object_eq_to(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_object_eql_to(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_object_equal_to(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_object_existing(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_object_having_attributes(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_object_matching(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_object_responding_to(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def an_object_satisfying(*args, **_arg1, &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, **_arg1, &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, **_arg1, &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, **_arg1, &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, **_arg1, &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, **_arg1, &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, **_arg1, &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, **_arg1, &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, **_arg1, &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, **_arg1, &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, **_arg1, &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, **_arg1, &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, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def matching(*args, **_arg1, &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, **_arg1, &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, **_arg1, &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, **_arg1, &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, **_arg1, &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, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def within(*args, **_arg1, &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, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def yielding_successive_args(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def yielding_with_args(*args, **_arg1, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:251 + def yielding_with_no_args(*args, **_arg1, &block); end + + private + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:961 + def method_missing(method, *args, **_arg2, &block); end + + # pkg:gem/rspec-expectations#lib/rspec/matchers.rb:974 + def respond_to_missing?(method, *_arg1); 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(*_arg0); 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 + # @private + # + # pkg:gem/rspec-expectations#lib/rspec/matchers/built_in/base_matcher.rb:107 + def matcher_name; end + + # @private + # @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(*_arg0); 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(*_arg0); 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, *_arg1); 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, **_arg2, &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, **_arg2, &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..6df6b6f --- /dev/null +++ b/sorbet/rbi/gems/rspec-mocks@3.13.8.rbi @@ -0,0 +1,4787 @@ +# 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, **_arg1, &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, **_arg1, &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, **_arg1); 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, **_arg1); 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, **_arg1, &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 + # @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 + # @private + # + # pkg:gem/rspec-mocks#lib/rspec/mocks/instance_method_stasher.rb:61 + def restore; end + + # @private + # @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, **_arg1, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def and_invoke(*args, **_arg1, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def and_raise(*args, **_arg1, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def and_return(*args, **_arg1, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def and_throw(*args, **_arg1, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def and_wrap_original(*args, **_arg1, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def and_yield(*args, **_arg1, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def at_least(*args, **_arg1, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def at_most(*args, **_arg1, &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, **_arg1, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def inspect(*args, **_arg1, &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, **_arg1, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def once(*args, **_arg1, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def ordered(*args, **_arg1, &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, **_arg1, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def time(*args, **_arg1, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def times(*args, **_arg1, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def to_s(*args, **_arg1, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def twice(*args, **_arg1, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/matchers/receive.rb:62 + def with(*args, **_arg1, &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, **_arg1, &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, **_arg2, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:492 + def invoke_without_incrementing_received_count(parent_stub, *args, **_arg2, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:468 + def matches?(message, *args, **_arg2); 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, **_arg2, &block); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/message_expectation.rb:487 + def safe_invoke_without_incrementing_received_count(parent_stub, *args, **_arg2, &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, **_arg4, &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, **_arg2, &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. +# 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, **_arg2, &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, **_arg2, &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, **_arg2, &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, **_arg2); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:301 + def find_almost_matching_stub(method_name, *args, **_arg2); 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, **_arg2); end + + # pkg:gem/rspec-mocks#lib/rspec/mocks/proxy.rb:296 + def find_matching_method_stub(method_name, *args, **_arg2); 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, **_arg2, &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, **_arg2, &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, **_arg1, &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, **_arg2, &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..4a37372 --- /dev/null +++ b/sorbet/rbi/gems/rspec-support@3.13.7.rbi @@ -0,0 +1,1274 @@ +# 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 + # @api private + # + # pkg:gem/rspec-support#lib/rspec/support.rb:140 + def warning_notifier; end + + # @api private + # @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, **_arg2, &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, **_arg2, &block); end + end +end diff --git a/sorbet/rbi/gems/rspec@3.10.0.rbi b/sorbet/rbi/gems/rspec@3.10.0.rbi deleted file mode 100644 index 212cae3..0000000 --- a/sorbet/rbi/gems/rspec@3.10.0.rbi +++ /dev/null @@ -1,13 +0,0 @@ -# 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 sync`. - -# typed: true - -module RSpec -end - -module RSpec - module Matchers - 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..053fe24 --- /dev/null +++ b/sorbet/rbi/gems/rubocop-ast@1.50.0.rbi @@ -0,0 +1,7258 @@ +# 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 &(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def *(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def +(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def -(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def <<(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def [](*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def []=(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def all?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def any?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def append(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def assoc(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def at(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def bsearch(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def bsearch_index(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def chain(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def chunk(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def chunk_while(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def clear(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def collect(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def collect!(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def collect_concat(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def combination(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def compact(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def compact!(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def concat(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def count(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def cycle(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def deconstruct(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def delete(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def delete_at(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def delete_if(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def detect(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def difference(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def dig(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def drop(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def drop_while(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def each(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def each_cons(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def each_entry(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def each_index(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def each_slice(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def each_with_index(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def each_with_object(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def empty?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def entries(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def fetch(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def fetch_values(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def fill(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def filter(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def filter!(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def filter_map(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def find(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def find_all(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def find_index(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def first(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def flat_map(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def flatten(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def flatten!(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def grep(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def grep_v(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def group_by(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def include?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def index(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def inject(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def insert(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def intersect?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def intersection(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def join(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def keep_if(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def last(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def lazy(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def length(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def map(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def map!(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def max(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def max_by(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def member?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def min(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def min_by(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def minmax(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def minmax_by(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def none?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def one?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def pack(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def partition(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def permutation(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def pop(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def prepend(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def product(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def push(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def rassoc(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def reduce(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def reject(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def reject!(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def repeated_combination(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def repeated_permutation(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def replace(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def reverse(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def reverse!(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def reverse_each(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def rindex(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def rotate(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def rotate!(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def sample(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def select(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def select!(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def shelljoin(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def shift(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def shuffle(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def shuffle!(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def size(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def slice(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def slice!(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def slice_after(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def slice_before(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def slice_when(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def sort(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def sort!(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def sort_by(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def sort_by!(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def sum(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def take(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def take_while(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def tally(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def to_ary(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def to_h(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def to_set(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def transpose(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def union(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def uniq(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def uniq!(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def unshift(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def values_at(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def zip(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node/mixin/collection_node.rb:13 + def |(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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:17 +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(*_arg0, **_arg1, &_arg2); 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?(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:46 + def emit_call(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:46 + def emit_capture(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:46 + def emit_list(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:46 + def emit_unary_op(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/parser.rb:46 + def emit_union(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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_ANY_CLASS_OF_ETC = 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 = 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_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_EXTEND_INCLUDE = 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_IF_UNLESS = 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_INCLUDE_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_A_KIND_OF = 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_LAMBDA_PROC = 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_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_PROP_CONST = 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_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 = 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_SIG_HELPERS = 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_STRUCT_IMMUTABLESTRUCT = T.let(T.unsafe(nil), Set) + +# pkg:gem/rubocop-ast#lib/rubocop/ast/node_pattern/sets.rb:10 +RuboCop::AST::NodePattern::Sets::SET_STRUCT_IMMUTABLESTRUCT_INEXACTSTRUCT = 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_TESTS_ALWAYS = 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.3.0.rbi b/sorbet/rbi/gems/rubocop-gusto@11.3.0.rbi new file mode 100644 index 0000000..6518dd4 --- /dev/null +++ b/sorbet/rbi/gems/rubocop-gusto@11.3.0.rbi @@ -0,0 +1,1664 @@ +# 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) + +# 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) + +# 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) + +# 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) + +# 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:54 +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:83 + def definition_name(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:133 + def on_send(node); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:193 + def absorbable_comment?(source_line); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:198 + def blank_line?(source_line); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:218 + def consumes_shared_examples?; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:277 + def definition_name_argument?(sym_node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:243 + 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:228 + 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:158 + def exempt_from_deletion?(name, block); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:202 + def let_or_subject_line?(source_line); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:239 + def overridden?(name); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:206 + def preceding_sig(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:250 + 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:263 + 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:174 + def removal_range(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:214 + def within_shared_definition?(node); end + + class << self + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:121 + 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:90 + def framework_let_names; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:106 + def git_tracked_support_files; end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:126 + def read_source(path); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:115 + def scan_framework_let_names(paths); end + + # Enumerate `spec/support/**/*.rb`. Prefer `git ls-files` (reads the git index, skipping + # untracked trees like `node_modules`): a leading-`**` `Dir.glob` walks the entire + # repository and costs seconds, while reading the index costs tens of milliseconds. Fall + # back to `Dir.glob` when not in a git work tree or `git` is unavailable. + # + # Tradeoff: an untracked (brand-new, uncommitted) `spec/support/*.rb` override is invisible + # to `git ls-files`. In that narrow window its contract names are not exempted; once + # committed it is seen like any other support file. + # + # pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:102 + def support_file_paths; end + end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:58 +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:66 +RuboCop::Cop::Gusto::UnreferencedLet::DYNAMIC_DISPATCH_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:67 +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:62 +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:71 +RuboCop::Cop::Gusto::UnreferencedLet::IDENTIFIER_IN_STRING = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:72 +RuboCop::Cop::Gusto::UnreferencedLet::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:73 +RuboCop::Cop::Gusto::UnreferencedLet::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# The glob and the pathspec encode the SAME set of files two ways: `Dir.glob` (fallback) and +# a regexp filter over `git ls-files` output. Keep them in sync if either changes. +# +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:76 +RuboCop::Cop::Gusto::UnreferencedLet::SUPPORT_FILES_GLOB = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/gusto/unreferenced_let.rb:77 +RuboCop::Cop::Gusto::UnreferencedLet::SUPPORT_FILES_PATHSPEC = T.let(T.unsafe(nil), Regexp) + +# 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) +# +# # 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 (only checks previously pre-stubbed objects) +# expect(Foo).to have_received(:perform_async) +# +# @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. 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:34 +class RuboCop::Cop::Sidekiq::PerformAsyncStub < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/sidekiq/perform_async_stub.rb:72 + def on_csend(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/sidekiq/perform_async_stub.rb:47 + def on_send(node); end + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/sidekiq/perform_async_stub.rb:43 + def stub_perform_async?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-gusto#lib/rubocop/cop/sidekiq/perform_async_stub.rb:76 + def message_expectation_chain_tail(node); end +end + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/sidekiq/perform_async_stub.rb:37 +RuboCop::Cop::Sidekiq::PerformAsyncStub::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/sidekiq/perform_async_stub.rb:38 +RuboCop::Cop::Sidekiq::PerformAsyncStub::MSG_RECEIVE = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-gusto#lib/rubocop/cop/sidekiq/perform_async_stub.rb:39 +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-packs@0.0.45.rbi b/sorbet/rbi/gems/rubocop-packs@0.0.45.rbi new file mode 100644 index 0000000..dc988d6 --- /dev/null +++ b/sorbet/rbi/gems/rubocop-packs@0.0.45.rbi @@ -0,0 +1,433 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rubocop-packs` gem. +# Please instead update this file by running `bin/tapioca gem rubocop-packs`. + + +# The original code is from https://github.com/rubocop/rubocop-rspec/blob/master/lib/rubocop/rspec/inject.rb +# See https://github.com/rubocop/rubocop-rspec/blob/master/MIT-LICENSE.md +# +# pkg:gem/rubocop-packs#lib/rubocop/packs/private/configuration.rb:4 +module RuboCop; end + +# pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/private.rb:4 +module RuboCop::Cop; end + +# pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api.rb:5 +module RuboCop::Cop::Packs; end + +# This cop states that public API should live on class methods, which are more easily statically analyzable, +# searchable, and typically hold less state. +# +# Options: +# +# * `AcceptableParentClasses`: A list of classes that, if inherited from, non-class methods are permitted (useful when value objects are a part of your public API) +# * `AcceptableMixins`: A list of modules that, if included, non-class methods are permitted +# +# @example +# +# # bad +# # packs/foo/app/public/foo.rb +# module Foo +# def blah +# end +# end +# +# # good +# # packs/foo/app/public/foo.rb +# module Foo +# def self.blah +# end +# end +# +# pkg:gem/rubocop-packs#lib/rubocop/cop/packs/class_methods_as_public_apis.rb:31 +class RuboCop::Cop::Packs::ClassMethodsAsPublicApis < ::RuboCop::Cop::Base + # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/class_methods_as_public_apis.rb:40 + sig { params(node: T.untyped).void } + def on_def(node); end + + # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/class_methods_as_public_apis.rb:35 + sig { returns(T::Boolean) } + def support_autocorrect?; end + + private + + # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/class_methods_as_public_apis.rb:70 + sig { params(node: T.untyped).returns(T::Boolean) } + def node_includes_acceptable_mixin?(node); end +end + +# This cop helps ensure that each pack has a documented public API +# The following examples assume this basic setup. +# +# @example +# +# # bad +# # packs/foo/app/public/foo.rb +# class Foo +# def bar; end +# end +# +# # good +# # packs/foo/app/public/foo.rb +# class Foo +# # This is a documentation comment. +# def bar; end +# end +# +# # good +# # packs/foo/app/public/foo.rb +# class Foo +# # This is a documentation comment. +# # It should appear above a sorbet type signature +# sig { void } +# def bar; end +# end +# +# pkg:gem/rubocop-packs#lib/rubocop/cop/packs/documented_public_apis.rb:33 +class RuboCop::Cop::Packs::DocumentedPublicApis < ::RuboCop::Cop::Style::DocumentationMethod + # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/documented_public_apis.rb:51 + sig { params(node: T.untyped).void } + def check(node); end + + # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/documented_public_apis.rb:74 + sig { params(node: T.untyped).returns(T::Boolean) } + def node_is_sorbet_signature?(node); end + + # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/documented_public_apis.rb:46 + sig { returns(T::Boolean) } + def support_autocorrect?; end +end + +# This cop helps ensure that each pack exposes one namespace. +# Note that this cop doesn't necessarily expect you to be using packs-rails (https://github.com/rubyatscale/packs-rails), +# but it does expect packs to live in the organizational structure as described in the README.md of that gem. +# +# This allows packs to opt in and also prevent *other* files from sitting in their namespace. +# +# @example +# +# # bad +# # packs/foo/app/services/blah/bar.rb +# class Blah::Bar; end +# +# # good +# # packs/foo/app/services/foo/blah/bar.rb +# class Foo::Blah::Bar; end +# +# pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api.rb:6 +class RuboCop::Cop::Packs::RootNamespaceIsPackName < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + + # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name.rb:32 + sig { void } + def on_new_investigation; end + + # In the future, we'd love this to support auto-correct. + # Perhaps by automatically renamespacing the file and changing its location? + # + # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name.rb:79 + sig { returns(T::Boolean) } + def support_autocorrect?; end + + private + + # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name.rb:86 + sig { returns(::RuboCop::Cop::Packs::RootNamespaceIsPackName::DesiredZeitwerkApi) } + def desired_zeitwerk_api; end +end + +# This is a private class that represents API that we would prefer to be available somehow in Zeitwerk. +# However, the boundaries between systems (packwerk/zeitwerk, rubocop/zeitwerk) are poor in this class, so +# that would need to be separated prior to proposing any API changes in zeitwerk. +# +# pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api.rb:12 +class RuboCop::Cop::Packs::RootNamespaceIsPackName::DesiredZeitwerkApi + # For now, this API includes `package_for_path` + # If this were truly zeitwerk API, it wouldn't include any mention of packs and it would likely not need the package at all + # Since it could get the actual namespace without knowing anything about packs. + # However, we would need to pass to it the desired namespace based on the pack name for it to be able to suggest + # a desired filepath. + # Likely this means that our own cop should determine the desired namespace and pass that in + # and this can determine actual namespace and how to get to expected. + # + # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api.rb:32 + sig do + params( + relative_filename: ::String, + package_for_path: ::Packs::Pack + ).returns(T.nilable(::RuboCop::Cop::Packs::RootNamespaceIsPackName::DesiredZeitwerkApi::NamespaceContext)) + end + def for_file(relative_filename, package_for_path); end + + # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api.rb:86 + sig { params(pack: ::Packs::Pack).returns(::String) } + def get_pack_based_namespace(pack); end + + private + + # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api.rb:98 + sig { params(remaining_file_path: ::String, package_name: ::String).returns(::String) } + def get_actual_namespace(remaining_file_path, package_name); end + + # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api.rb:93 + sig { returns(::Pathname) } + def root_pathname; end +end + +# pkg:gem/rubocop-packs#lib/rubocop/cop/packs/root_namespace_is_pack_name/desired_zeitwerk_api.rb:15 +class RuboCop::Cop::Packs::RootNamespaceIsPackName::DesiredZeitwerkApi::NamespaceContext < ::T::Struct + const :current_namespace, ::String + const :current_fully_qualified_constant, ::String + const :expected_namespace, ::String + const :expected_filepath, ::String +end + +# This cop helps ensure that each pack's public API is strictly typed, enforcing strong boundaries. +# +# @example +# +# # bad +# # packs/foo/app/public/foo.rb +# module Foo; end +# +# # good +# # packs/foo/app/public/foo.rb +# module Foo; end +# +# pkg:gem/rubocop-packs#lib/rubocop/cop/packs/typed_public_apis.rb:22 +class RuboCop::Cop::Packs::TypedPublicApis < ::RuboCop::Cop::Sorbet::StrictSigil + # pkg:gem/rubocop-packs#lib/rubocop/cop/packs/typed_public_apis.rb:38 + sig { void } + def on_new_investigation; end +end + +# pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/private.rb:5 +module RuboCop::Cop::PackwerkLite; end + +# This is a private class that represents API that we would prefer to be available somehow in Zeitwerk. +# However, the boundaries between systems (packwerk/zeitwerk, rubocop/zeitwerk) are poor in this class, so +# that would need to be separated prior to proposing any API changes in zeitwerk. +# +# pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/constant_resolver.rb:11 +class RuboCop::Cop::PackwerkLite::ConstantResolver; end + +# pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/constant_resolver.rb:14 +class RuboCop::Cop::PackwerkLite::ConstantResolver::ConstantReference < ::T::Struct + const :constant_name, ::String + const :global_namespace, ::String + const :source_package, ::ParsePackwerk::Package + const :constant_definition_location, ::Pathname + const :referencing_file, ::Pathname + + # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/constant_resolver.rb:29 + sig { returns(T::Boolean) } + def public_api?; end + + # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/constant_resolver.rb:24 + sig { returns(::ParsePackwerk::Package) } + def referencing_package; end + + class << self + # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/constant_resolver.rb:37 + sig do + params( + node: ::RuboCop::AST::ConstNode, + processed_source: ::RuboCop::AST::ProcessedSource + ).returns(T.nilable(::RuboCop::Cop::PackwerkLite::ConstantResolver::ConstantReference)) + end + def resolve(node, processed_source); end + end +end + +# This cop helps ensure that packs are depending on packs explicitly. +# +# @example +# +# # bad +# # packs/foo/app/services/foo.rb +# class Foo +# def bar +# Bar +# end +# end +# +# # packs/foo/package.yml +# # enforces_dependencies: true +# # enforces_privacy: false +# # dependencies: +# # - packs/baz +# +# # good +# # packs/foo/app/services/foo.rb +# class Foo +# def bar +# Bar +# end +# end +# +# # packs/foo/package.yml +# # enforces_dependencies: true +# # enforces_privacy: false +# # dependencies: +# # - packs/baz +# # - packs/bar +# +# pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/dependency_checker.rb:39 +class RuboCop::Cop::PackwerkLite::Dependency < ::RuboCop::Cop::Base + # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/dependency_checker.rb:48 + sig { params(node: ::RuboCop::AST::ConstNode).void } + def on_const(node); end + + # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/dependency_checker.rb:43 + sig { returns(T::Boolean) } + def support_autocorrect?; end +end + +# This cop helps ensure that packs are using public API of other systems +# The following examples assume this basic setup. +# +# @example +# # packs/bar/app/public/bar.rb +# class Bar +# def my_public_api; end +# end +# +# # packs/bar/app/services/private.rb +# class Private +# def my_private_api; end +# end +# +# # packs/bar/package.yml +# # enforces_dependencies: false +# # enforces_privacy: true +# +# # bad +# # packs/foo/app/services/foo.rb +# class Foo +# def bar +# Private.my_private_api +# end +# end +# +# # good +# # packs/foo/app/services/foo.rb +# class Bar +# def bar +# Bar.my_public_api +# end +# end +# +# pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/privacy_checker.rb:40 +class RuboCop::Cop::PackwerkLite::Privacy < ::RuboCop::Cop::Base + # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/privacy_checker.rb:49 + sig { params(node: ::RuboCop::AST::ConstNode).void } + def on_const(node); end + + # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/privacy_checker.rb:44 + sig { returns(T::Boolean) } + def support_autocorrect?; end +end + +# pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/private.rb:6 +module RuboCop::Cop::PackwerkLite::Private + class << self + # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/private.rb:10 + sig { params(node: ::RuboCop::AST::ConstNode).returns(T::Boolean) } + def partial_const_reference?(node); end + + # pkg:gem/rubocop-packs#lib/rubocop/cop/packwerk_lite/private.rb:27 + sig do + params( + constant_reference: ::RuboCop::Cop::PackwerkLite::ConstantResolver::ConstantReference, + type: ::String + ).returns(T::Boolean) + end + def violation_in_package_todo_yml?(constant_reference, type: T.unsafe(nil)); end + end +end + +# pkg:gem/rubocop-packs#lib/rubocop/packs/private/configuration.rb:5 +module RuboCop::Packs + class << self + # pkg:gem/rubocop-packs#lib/rubocop/packs.rb:16 + sig { void } + def bust_cache!; end + + # pkg:gem/rubocop-packs#lib/rubocop/packs.rb:27 + sig { returns(::RuboCop::Packs::Private::Configuration) } + def config; end + + # pkg:gem/rubocop-packs#lib/rubocop/packs.rb:22 + sig { params(blk: T.proc.params(arg0: ::RuboCop::Packs::Private::Configuration).void).void } + def configure(&blk); end + end +end + +# pkg:gem/rubocop-packs#lib/rubocop/packs.rb:11 +RuboCop::Packs::CONFIG_DEFAULT = T.let(T.unsafe(nil), Pathname) + +# Because RuboCop doesn't yet support plugins, we have to monkey patch in a +# bit of our configuration. +# +# pkg:gem/rubocop-packs#lib/rubocop/packs/inject.rb:10 +module RuboCop::Packs::Inject + class << self + # pkg:gem/rubocop-packs#lib/rubocop/packs/inject.rb:14 + sig { void } + def defaults!; end + end +end + +# pkg:gem/rubocop-packs#lib/rubocop/packs.rb:10 +RuboCop::Packs::PROJECT_ROOT = T.let(T.unsafe(nil), Pathname) + +# pkg:gem/rubocop-packs#lib/rubocop/packs/private/configuration.rb:6 +module RuboCop::Packs::Private + class << self + # pkg:gem/rubocop-packs#lib/rubocop/packs/private.rb:13 + sig { void } + def bust_cache!; end + + # pkg:gem/rubocop-packs#lib/rubocop/packs/private.rb:18 + sig { void } + def load_client_configuration; end + end +end + +# pkg:gem/rubocop-packs#lib/rubocop/packs/private/configuration.rb:7 +class RuboCop::Packs::Private::Configuration + # pkg:gem/rubocop-packs#lib/rubocop/packs/private/configuration.rb:14 + sig { void } + def initialize; end + + # pkg:gem/rubocop-packs#lib/rubocop/packs/private/configuration.rb:19 + sig { void } + def bust_cache!; end + + # pkg:gem/rubocop-packs#lib/rubocop/packs/private/configuration.rb:11 + sig { returns(T::Array[::String]) } + def globally_permitted_namespaces; end + + # pkg:gem/rubocop-packs#lib/rubocop/packs/private/configuration.rb:11 + def globally_permitted_namespaces=(_arg0); end +end + +# pkg:gem/rubocop-packs#lib/rubocop/packs/private/offense.rb:6 +class RuboCop::Packs::Private::Offense < ::T::Struct + const :cop_name, ::String + const :filepath, ::String + + # pkg:gem/rubocop-packs#lib/rubocop/packs/private/offense.rb:13 + sig { returns(T.nilable(::Packs::Pack)) } + def pack; end +end + +# See docs/packwerk_lite.md +# +# pkg:gem/rubocop-packs#lib/rubocop/packwerk_lite.rb:12 +module RuboCop::PackwerkLite; end + +# pkg:gem/rubocop-packs#lib/rubocop/packwerk_lite.rb:13 +class RuboCop::PackwerkLite::Error < ::StandardError; 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-rubyfmt@0.1.1.rbi b/sorbet/rbi/gems/rubocop-rubyfmt@0.1.1.rbi new file mode 100644 index 0000000..07c1984 --- /dev/null +++ b/sorbet/rbi/gems/rubocop-rubyfmt@0.1.1.rbi @@ -0,0 +1,85 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rubocop-rubyfmt` gem. +# Please instead update this file by running `bin/tapioca gem rubocop-rubyfmt`. + + +# pkg:gem/rubocop-rubyfmt#lib/rubocop/rubyfmt/version.rb:3 +module RuboCop; end + +# pkg:gem/rubocop-rubyfmt#lib/rubocop/cop/rubyfmt/no_end_of_line_rubocop_disables.rb:6 +module RuboCop::Cop; end + +# pkg:gem/rubocop-rubyfmt#lib/rubocop/cop/rubyfmt/no_end_of_line_rubocop_disables.rb:7 +module RuboCop::Cop::Rubyfmt; end + +# `rubyfmt` always places comments at the beginning of lines, so end-of-line +# disables cannot be used. The autocorrect for this lint +# +# @safety +# This cop should only be moving comments and thus should be safe. +# However, this is largely intended as a migration mechanism when first +# adopting rubyfmt, so this is best-effort and may require some manual fixups. +# That said, since it's moving comments only, those fixups should be pretty much entirely +# caught by Rubocop, and most of the fixups should just be moving comments such that they +# appropriately wrap the offending code. +# +# +# ```ruby +# # good +# bad_call! +# +# # bad +# ```` +# +# pkg:gem/rubocop-rubyfmt#lib/rubocop/cop/rubyfmt/no_end_of_line_rubocop_disables.rb:33 +class RuboCop::Cop::Rubyfmt::NoEndOfLineRubocopDisables < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-rubyfmt#lib/rubocop/cop/rubyfmt/no_end_of_line_rubocop_disables.rb:39 + def on_new_investigation; end + + private + + # pkg:gem/rubocop-rubyfmt#lib/rubocop/cop/rubyfmt/no_end_of_line_rubocop_disables.rb:61 + def autocorrect(corrector, comment); end + + # pkg:gem/rubocop-rubyfmt#lib/rubocop/cop/rubyfmt/no_end_of_line_rubocop_disables.rb:51 + def comment_only_line?(comment); end + + # pkg:gem/rubocop-rubyfmt#lib/rubocop/cop/rubyfmt/no_end_of_line_rubocop_disables.rb:55 + def register_offense(comment); end + + # pkg:gem/rubocop-rubyfmt#lib/rubocop/cop/rubyfmt/no_end_of_line_rubocop_disables.rb:47 + def same_line_directive?(comment); end +end + +# pkg:gem/rubocop-rubyfmt#lib/rubocop/cop/rubyfmt/no_end_of_line_rubocop_disables.rb:37 +RuboCop::Cop::Rubyfmt::NoEndOfLineRubocopDisables::DISABLE_PATTERN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-rubyfmt#lib/rubocop/cop/rubyfmt/no_end_of_line_rubocop_disables.rb:36 +RuboCop::Cop::Rubyfmt::NoEndOfLineRubocopDisables::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-rubyfmt#lib/rubocop/rubyfmt/version.rb:4 +module RuboCop::Rubyfmt; end + +# pkg:gem/rubocop-rubyfmt#lib/rubocop/rubyfmt.rb:7 +class RuboCop::Rubyfmt::Error < ::StandardError; end + +# A plugin that integrates rubocop-rubyfmt with RuboCop's plugin system. +# +# pkg:gem/rubocop-rubyfmt#lib/rubocop/rubyfmt/plugin.rb:8 +class RuboCop::Rubyfmt::Plugin < ::LintRoller::Plugin + # pkg:gem/rubocop-rubyfmt#lib/rubocop/rubyfmt/plugin.rb:9 + def about; end + + # pkg:gem/rubocop-rubyfmt#lib/rubocop/rubyfmt/plugin.rb:22 + def rules(_context); end + + # pkg:gem/rubocop-rubyfmt#lib/rubocop/rubyfmt/plugin.rb:18 + def supported?(context); end +end + +# pkg:gem/rubocop-rubyfmt#lib/rubocop/rubyfmt/version.rb:5 +RuboCop::Rubyfmt::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/rubocop-sorbet@0.13.2.rbi b/sorbet/rbi/gems/rubocop-sorbet@0.13.2.rbi new file mode 100644 index 0000000..eb81a8e --- /dev/null +++ b/sorbet/rbi/gems/rubocop-sorbet@0.13.2.rbi @@ -0,0 +1,2838 @@ +# 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`. + + +# pkg:gem/rubocop-sorbet#lib/rubocop/sorbet/version.rb:3 +module RuboCop; end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb:4 +module RuboCop::Cop; end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb:5 +module RuboCop::Cop::Sorbet; end + +# Disallows using `.override(allow_incompatible: true)`. +# Using `allow_incompatible` suggests a violation of the Liskov +# Substitution Principle, meaning that a subclass is not a valid +# subtype of its superclass. This Cop prevents these design smells +# from occurring. +# +# @example +# +# # bad +# sig.override(allow_incompatible: true) +# +# # good +# sig.override +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb:21 +class RuboCop::Cop::Sorbet::AllowIncompatibleOverride < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb:55 + def on_block(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb:72 + def on_numblock(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb:49 + def on_send(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb:41 + def override?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb:36 + def sig?(param0); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb:27 + def sig_dot_override?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb:22 +RuboCop::Cop::Sorbet::AllowIncompatibleOverride::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb:24 +RuboCop::Cop::Sorbet::AllowIncompatibleOverride::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallows binding the return value of `T.any`, `T.all`, `T.enum` +# to a constant directly. To bind the value, one must use `T.type_alias`. +# +# @example +# +# # bad +# FooOrBar = T.any(Foo, Bar) +# +# # good +# FooOrBar = T.type_alias { T.any(Foo, Bar) } +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb:18 +class RuboCop::Cop::Sorbet::BindingConstantWithoutTypeAlias < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb:65 + def on_casgn(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb:48 + def requires_type_alias?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb:38 + def type_alias_with_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb:29 + def type_alias_without_block(param0 = T.unsafe(nil)); end + + private + + # Given nested send nodes, returns the leaf with explicit receiver. + # + # i.e. in Ruby + # + # a.b.c.d.e.f + # ^^^ + # + # i.e. in AST + # + # (send (send (send (send (send (send nil :a) :b) :c) :d) :e) :f) + # ^^^^^^^^^^^^^^^^^^^^^^^ + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb:98 + def send_leaf(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb:21 +RuboCop::Cop::Sorbet::BindingConstantWithoutTypeAlias::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb:23 +RuboCop::Cop::Sorbet::BindingConstantWithoutTypeAlias::WITHOUT_BLOCK_MSG = T.let(T.unsafe(nil), String) + +# Disallow defining methods in blocks, to prevent running into issues +# caused by https://github.com/sorbet/sorbet/issues/3609. +# +# As a workaround, use `define_method` instead. +# +# The one exception is for `Class.new` blocks, as long as the result is +# assigned to a constant (i.e. as long as it is not an anonymous class). +# Another exception is for ActiveSupport::Concern `class_methods` blocks. +# +# @example +# # bad +# yielding_method do +# def bad(args) +# # ... +# end +# end +# +# # bad +# Class.new do +# def bad(args) +# # ... +# end +# end +# +# # good +# yielding_method do +# define_method(:good) do |args| +# # ... +# end +# end +# +# # good +# MyClass = Class.new do +# def good(args) +# # ... +# end +# end +# +# # good +# module SomeConcern +# extend ActiveSupport::Concern +# +# class_methods do +# def good(args) +# # ... +# end +# end +# end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:55 +class RuboCop::Cop::Sorbet::BlockMethodDefinition < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:62 + def activesupport_concern_class_methods_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:71 + def module_extends_activesupport_concern?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:80 + def on_block(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:94 + def on_numblock(node); end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:186 + def adjust_for_closing_parenthesis(end_pos); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:106 + def autocorrect_method_in_block(corrector, node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:198 + def closing_parenthesis_follows(source); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:175 + def find_end_position_with_arguments(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:182 + def find_end_position_without_arguments(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:167 + def find_method_signature_end_position(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:143 + def handle_method_without_body(node, indent); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:161 + def handle_multiline_method_without_body(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:155 + def handle_single_line_method(node, indent); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:98 + def in_activesupport_concern_class_methods_block?(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:151 + def single_line_method?(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:132 + def transform_args_to_block_args(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/block_method_definition.rb:59 +RuboCop::Cop::Sorbet::BlockMethodDefinition::MSG = T.let(T.unsafe(nil), String) + +# Checks for the a mistaken variant of the "obsolete memoization pattern" that used to be required +# on every call, causing the memoized value to be discarded and recomputed on every call. +# +# This cop will correct it to read from the ivar instead of `nil`, which will memoize it correctly. +# +# The result of this correction will be the "obsolete memoization pattern", which can further be corrected by +# the `Sorbet/ObsoleteStrictMemoization` cop. +# +# See `Sorbet/ObsoleteStrictMemoization` for more details. +# +# @safety +# If the computation being memoized had side effects, calling it only once (instead of once on every call +# to the affected method) can be observed, and might be a breaking change. +# +# @example +# # bad +# sig { returns(Foo) } +# def foo +# # This `nil` is likely a mistake, causing the memoized value to be discarded and recomputed on every call. +# @foo = T.let(nil, T.nilable(Foo)) +# @foo ||= some_computation +# end +# +# # good +# sig { returns(Foo) } +# def foo +# # This will now memoize the value as was likely intended, so `some_computation` is only ever called once. +# # ⚠️If `some_computation` has side effects, this might be a breaking change! +# @foo = T.let(@foo, T.nilable(Foo)) +# @foo ||= some_computation +# end +# +# @see Sorbet/ObsoleteStrictMemoization +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb:42 +class RuboCop::Cop::Sorbet::BuggyObsoleteStrictMemoization < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::MatchRange + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::LineLengthHelp + include ::RuboCop::Cop::Sorbet::TargetSorbetVersion + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb:55 + def buggy_legacy_memoization_pattern?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb:66 + def on_begin(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb:77 + def relevant_file?(file); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb:51 +RuboCop::Cop::Sorbet::BuggyObsoleteStrictMemoization::MSG = T.let(T.unsafe(nil), String) + +# Ensures that callback conditionals are bound to the right type +# so that they are type checked properly. +# +# @safety +# Auto-correction is unsafe because other libraries define similar style callbacks as Rails, but don't always need +# binding to the attached class. Auto-correcting those usages can lead to false positives and auto-correction +# introduces new typing errors. +# +# @example +# +# # bad +# class Post < ApplicationRecord +# before_create :do_it, if: -> { should_do_it? } +# +# def should_do_it? +# true +# end +# end +# +# # good +# class Post < ApplicationRecord +# before_create :do_it, if: -> { +# T.bind(self, Post) +# should_do_it? +# } +# +# def should_do_it? +# true +# end +# end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/callback_conditionals_binding.rb:36 +class RuboCop::Cop::Sorbet::CallbackConditionalsBinding < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/callback_conditionals_binding.rb:82 + def argumentless_unbound_callable_callback_conditional?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/callback_conditionals_binding.rb:92 + def on_send(node); end + + private + + # Find the immediately enclosing class or module name. + # Returns `nil`` if the immediate parent (skipping begin if present) is not a class or module. + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/callback_conditionals_binding.rb:129 + def immediately_enclosing_module_name(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/callback_conditionals_binding.rb:40 +RuboCop::Cop::Sorbet::CallbackConditionalsBinding::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/callback_conditionals_binding.rb:42 +RuboCop::Cop::Sorbet::CallbackConditionalsBinding::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Ensure type parameters used in generic methods are always capitalized. +# +# @example +# +# # bad +# sig { type_parameters(:x).params(a: T.type_parameter(:x)).void } +# def foo(a); end +# +# # good +# sig { type_parameters(:X).params(a: T.type_parameter(:X)).void } +# def foo(a: 1); end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb:17 +class RuboCop::Cop::Sorbet::CapitalizedTypeParameters < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Sorbet::SignatureHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb:51 + def on_csend(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb:47 + def on_send(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb:35 + def on_signature(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb:31 + def t_type_parameter?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb:26 + def type_parameters?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb:57 + def check_type_parameters_case(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb:21 +RuboCop::Cop::Sorbet::CapitalizedTypeParameters::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb:23 +RuboCop::Cop::Sorbet::CapitalizedTypeParameters::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallows the usage of `checked(true)`. This usage could cause +# confusion; it could lead some people to believe that a method would be checked +# even if runtime checks have not been enabled on the class or globally. +# Additionally, in the event where checks are enabled, `checked(true)` would +# be redundant; only `checked(false)` or `soft` would change the behaviour. +# +# @example +# +# # bad +# sig { void.checked(true) } +# +# # good +# sig { void } +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb:19 +class RuboCop::Cop::Sorbet::CheckedTrueInSignature < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::Sorbet::SignatureHelp + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb:24 + def offending_node(param0); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb:35 + def on_signature(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb:28 +RuboCop::Cop::Sorbet::CheckedTrueInSignature::MESSAGE = T.let(T.unsafe(nil), String) + +# Shared helper for cops that unwrap a `T.let` on a constant assignment. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/constant_scope.rb:7 +module RuboCop::Cop::Sorbet::ConstantScope + private + + # True when the constant is assigned directly in a class, module, or + # constants assigned elsewhere (inside a conditional, loop, block, or + # method — error 7027), so removing the annotation there would break + # typechecking. + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/constant_scope.rb:15 + def statically_scoped?(node); end +end + +# Disallows the calls that are used to get constants fom Strings +# such as +constantize+, +const_get+, and +constants+. +# +# The goal of this cop is to make the code easier to statically analyze, +# more IDE-friendly, and more predictable. It leads to code that clearly +# expresses which values the constant can have. +# +# @example +# +# # bad +# class_name.constantize +# +# # bad +# constants.detect { |c| c.name == "User" } +# +# # bad +# const_get(class_name) +# +# # good +# case class_name +# when "User" +# User +# else +# raise ArgumentError +# end +# +# # good +# { "User" => User }.fetch(class_name) +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/constants_from_strings.rb:36 +class RuboCop::Cop::Sorbet::ConstantsFromStrings < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/constants_from_strings.rb:50 + def on_csend(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/constants_from_strings.rb:47 + def on_send(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/constants_from_strings.rb:37 +RuboCop::Cop::Sorbet::ConstantsFromStrings::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/constants_from_strings.rb:40 +RuboCop::Cop::Sorbet::ConstantsFromStrings::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for blank lines after signatures. +# +# @example +# # bad +# sig { void } +# +# def foo; end +# +# # good +# sig { void } +# def foo; end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb:17 +class RuboCop::Cop::Sorbet::EmptyLineAfterSig < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::Sorbet::SignatureHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb:33 + def on_signature(sig); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb:25 + def sig_or_signable_method_definition?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb:62 + def contains_only_rubocop_directives?(range); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb:66 + def lines_between(node1, node2, buffer: T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb:58 + def next_sibling(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb:22 +RuboCop::Cop::Sorbet::EmptyLineAfterSig::MSG = T.let(T.unsafe(nil), String) + +# Checks that the Sorbet sigil comes as the first magic comment in the file, after the encoding comment if any. +# +# The expected order for magic comments is: (en)?coding, typed, warn_indent then frozen_string_literal. +# +# The ordering is for consistency only, except for the encoding comment which must be first, if present. +# +# For example, the following bad ordering: +# +# ```ruby +# class Foo; end +# ``` +# +# Will be corrected as: +# +# ```ruby +# class Foo; end +# ``` +# +# Only `(en)?coding`, `typed`, `warn_indent` and `frozen_string_literal` magic comments are considered, +# other comments or magic comments are left in the same place. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb:32 +class RuboCop::Cop::Sorbet::EnforceSigilOrder < ::RuboCop::Cop::Sorbet::ValidSigil + include ::RuboCop::Cop::RangeHelp + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb:35 + def on_new_investigation; end + + protected + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb:93 + def autocorrect(corrector); end + + # checks + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb:70 + def check_magic_comments_order(tokens); end + + # Get all the tokens in `processed_source` that match `MAGIC_REGEX` + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb:62 + def extract_magic_comments(processed_source); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb:46 +RuboCop::Cop::Sorbet::EnforceSigilOrder::CODING_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb:48 +RuboCop::Cop::Sorbet::EnforceSigilOrder::FROZEN_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb:47 +RuboCop::Cop::Sorbet::EnforceSigilOrder::INDENT_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb:57 +RuboCop::Cop::Sorbet::EnforceSigilOrder::MAGIC_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb:50 +RuboCop::Cop::Sorbet::EnforceSigilOrder::PREFERRED_ORDER = T.let(T.unsafe(nil), Hash) + +# Checks that every method definition and attribute accessor has a Sorbet signature. +# +# It also suggest an autocorrect with placeholders so the following code: +# +# ``` +# def foo(a, b, c); end +# ``` +# +# Will be corrected as: +# +# ``` +# sig { params(a: T.untyped, b: T.untyped, c: T.untyped).returns(T.untyped) +# def foo(a, b, c); end +# ``` +# +# You can configure the placeholders used by changing the following options: +# +# * `ParameterTypePlaceholder`: placeholders used for parameter types (default: 'T.untyped') +# * `ReturnTypePlaceholder`: placeholders used for return types (default: 'T.untyped') +# * `Style`: signature style to enforce - 'sig' for sig blocks, 'rbs' for RBS comments, 'both' to allow either (default: 'sig') +# * `AutocorrectStyle`: signature style to use when autocorrecting - 'sig' for sig blocks, 'rbs' for RBS comments (default: 'sig'). Only used when `Style` is 'both'. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:27 +class RuboCop::Cop::Sorbet::EnforceSignatures < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Sorbet::SignatureHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:40 + def accessor?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:44 + def on_def(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:48 + def on_defs(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:60 + def on_new_investigation; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:52 + def on_send(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:56 + def on_signature(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:66 + def scope(node); end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:190 + def add_accessor_parameter_if_needed(suggest, symbol, method); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:212 + def allow_rbs?; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:231 + def autocorrect_style; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:120 + def autocorrect_with_signature_type(corrector, node, type); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:75 + def check_node(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:133 + def create_signature_suggestion(node, type); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:166 + def in_sclass_context?(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:162 + def instance_initialize?(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:127 + def leftmost_send_ancestor(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:204 + def param_type_placeholder; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:177 + def populate_accessor_suggestion(suggest, node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:150 + def populate_method_definition_suggestion(suggest, node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:142 + def populate_signature_suggestion(suggest, node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:116 + def rbs_checker; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:208 + def return_type_placeholder; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:196 + def set_void_return_for_writer(suggest, method); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:112 + def sig_checker; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:216 + def signature_style; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:200 + def writer_or_accessor?(method); end +end + +# Represents a method parameter with its name and AST node kind. +# @kind is the RuboCop AST node type (:arg, :optarg, :restarg, :kwarg, +# :kwoptarg, :kwrestarg, :forward_arg, :blockarg). +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:37 +class RuboCop::Cop::Sorbet::EnforceSignatures::Param < ::Struct + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:37 + def kind; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:37 + def kind=(_); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:37 + def name; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:37 + def name=(_); end + + class << self + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:37 + def [](*_arg0); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:37 + def inspect; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:37 + def keyword_init?; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:37 + def members; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:37 + def new(*_arg0); end + end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:254 +class RuboCop::Cop::Sorbet::EnforceSignatures::RBSSignatureChecker < ::RuboCop::Cop::Sorbet::EnforceSignatures::SignatureChecker + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:257 + def signature_node(node); end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:270 + def find_non_send_ancestor(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:255 +RuboCop::Cop::Sorbet::EnforceSignatures::RBSSignatureChecker::RBS_COMMENT_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:330 +class RuboCop::Cop::Sorbet::EnforceSignatures::RBSSuggestion + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:333 + def initialize(indent); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:331 + def attribute; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:331 + def attribute=(_arg0); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:331 + def has_block; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:331 + def has_block=(_arg0); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:331 + def params; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:331 + def params=(_arg0); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:331 + def returns; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:331 + def returns=(_arg0); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:341 + def to_autocorrect; end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:347 + def generate_signature; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:365 + def rbs_param(param); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:276 +class RuboCop::Cop::Sorbet::EnforceSignatures::SigSignatureChecker < ::RuboCop::Cop::Sorbet::EnforceSignatures::SignatureChecker + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:277 + def initialize(processed_source); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:290 + def clear_signature(scope); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:286 + def on_signature(node, scope); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:282 + def signature_node(scope); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:295 +class RuboCop::Cop::Sorbet::EnforceSignatures::SigSuggestion + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:298 + def initialize(indent, param_placeholder, return_placeholder); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:296 + def params; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:296 + def params=(_arg0); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:296 + def returns; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:296 + def returns=(_arg0); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:306 + def to_autocorrect; end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:312 + def generate_params; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:319 + def generate_return; end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:240 +class RuboCop::Cop::Sorbet::EnforceSignatures::SignatureChecker + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:241 + def initialize(processed_source); end + + protected + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:249 + def preceding_comments(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:247 + def processed_source; end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:32 +RuboCop::Cop::Sorbet::EnforceSignatures::VALID_AUTOCORRECT_STYLES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb:31 +RuboCop::Cop::Sorbet::EnforceSignatures::VALID_STYLES = T.let(T.unsafe(nil), Array) + +# Checks that there is only one Sorbet sigil in a given file +# +# For example, the following class with two sigils +# +# ```ruby +# class Foo; end +# ``` +# +# Will be corrected as: +# +# ```ruby +# class Foo; end +# ``` +# +# Other comments or magic comments are left in place. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb:26 +class RuboCop::Cop::Sorbet::EnforceSingleSigil < ::RuboCop::Cop::Sorbet::ValidSigil + include ::RuboCop::Cop::RangeHelp + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb:29 + def on_new_investigation; end + + protected + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb:50 + def autocorrect(corrector); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb:44 + def extract_all_sigils(processed_source); end +end + +# Makes the Sorbet `false` sigil mandatory in all files. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/false_sigil.rb:10 +class RuboCop::Cop::Sorbet::FalseSigil < ::RuboCop::Cop::Sorbet::HasSigil + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/false_sigil.rb:11 + def minimum_strictness; end +end + +# Disallow including the `Comparable` module in `T::Enum`. +# +# @example +# +# # bad +# class Priority < T::Enum +# include Comparable +# +# enums do +# High = new(3) +# Medium = new(2) +# Low = new(1) +# end +# +# def <=>(other) +# serialize <=> other.serialize +# end +# end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/t_enum/forbid_comparable_t_enum.rb:24 +class RuboCop::Cop::Sorbet::ForbidComparableTEnum < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Sorbet::TEnum + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/t_enum/forbid_comparable_t_enum.rb:32 + def mix_in_comparable?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/t_enum/forbid_comparable_t_enum.rb:36 + def on_send(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/t_enum/forbid_comparable_t_enum.rb:27 +RuboCop::Cop::Sorbet::ForbidComparableTEnum::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/t_enum/forbid_comparable_t_enum.rb:29 +RuboCop::Cop::Sorbet::ForbidComparableTEnum::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Ensures RBI shims do not include a call to extend T::Sig +# or to extend T::Helpers +# +# @example +# +# # bad +# module SomeModule +# extend T::Sig +# extend T::Helpers +# +# sig { returns(String) } +# def foo; end +# end +# +# # good +# module SomeModule +# sig { returns(String) } +# def foo; end +# end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb:25 +class RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb:33 + def extend_t_sig_or_helpers?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb:37 + def on_send(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb:29 +RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb:30 +RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Correct `send` expressions in include statements by constant literals. +# +# Sorbet, the static checker, is not (yet) able to support constructs on the +# following form: +# +# ```ruby +# class MyClass +# include send_expr +# end +# ``` +# +# Multiple occurences of this can be found in Shopify's code base like: +# +# ```ruby +# include Rails.application.routes.url_helpers +# ``` +# or +# ```ruby +# include Polaris::Engine.helpers +# ``` +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_include_const_literal.rb:29 +class RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_include_const_literal.rb:36 + def dynamic_inclusion?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_include_const_literal.rb:40 + def on_send(node); end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_include_const_literal.rb:52 + def neither_const_nor_self?(node); end + + # Returns true if the node is within a module declaration that is not anonymous. + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_include_const_literal.rb:57 + def within_onymous_module?(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_include_const_literal.rb:32 +RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_include_const_literal.rb:33 +RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Check that code does not call `mixes_in_class_methods` from Sorbet `T::Helpers`. +# +# Good: +# +# ``` +# module M +# extend ActiveSupport::Concern +# +# class_methods do +# ... +# end +# end +# ``` +# +# Bad: +# +# ``` +# module M +# extend T::Helpers +# +# module ClassMethods +# ... +# end +# +# mixes_in_class_methods(ClassMethods) +# end +# ``` +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_mixes_in_class_methods.rb:33 +class RuboCop::Cop::Sorbet::ForbidMixesInClassMethods < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_mixes_in_class_methods.rb:38 + def mixes_in_class_methods?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_mixes_in_class_methods.rb:45 + def on_csend(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_mixes_in_class_methods.rb:42 + def on_send(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_mixes_in_class_methods.rb:34 +RuboCop::Cop::Sorbet::ForbidMixesInClassMethods::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_mixes_in_class_methods.rb:35 +RuboCop::Cop::Sorbet::ForbidMixesInClassMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Makes sure that RBI files are always located under the defined allowed paths. +# +# Options: +# +# * `AllowedPaths`: A list of the paths where RBI files are allowed (default: ["rbi/**", "sorbet/rbi/**"]) +# +# @example +# # bad +# # lib/some_file.rbi +# # other_file.rbi +# +# # good +# # rbi/external_interface.rbi +# # sorbet/rbi/some_file.rbi +# # sorbet/rbi/any/path/for/file.rbi +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb:23 +class RuboCop::Cop::Sorbet::ForbidRBIOutsideOfAllowedPaths < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb:26 + def on_new_investigation; end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb:48 + def allowed_paths; end +end + +# Check that definitions do not use a `sig` block. +# +# Good: +# +# ``` +# #: -> void +# def foo; end +# ``` +# +# Bad: +# +# ``` +# sig { void } +# def foo; end +# ``` +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/forbid_sig.rb:23 +class RuboCop::Cop::Sorbet::ForbidSig < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Sorbet::SignatureHelp + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/forbid_sig.rb:28 + def on_signature(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/forbid_sig.rb:26 +RuboCop::Cop::Sorbet::ForbidSig::MSG = T.let(T.unsafe(nil), String) + +# Check that definitions do not use a `sig` block. +# +# Good: +# +# ``` +# #: -> void +# def foo; end +# ``` +# +# Bad: +# +# ``` +# T::Sig.sig { void } +# def foo; end +# ``` +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/forbid_sig_with_runtime.rb:23 +class RuboCop::Cop::Sorbet::ForbidSigWithRuntime < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Sorbet::SignatureHelp + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/forbid_sig_with_runtime.rb:28 + def on_signature(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/forbid_sig_with_runtime.rb:26 +RuboCop::Cop::Sorbet::ForbidSigWithRuntime::MSG = T.let(T.unsafe(nil), String) + +# Check that `sig` is used instead of `T::Sig::WithoutRuntime.sig`. +# +# Good: +# +# ``` +# sig { void } +# def foo; end +# ``` +# +# Bad: +# +# ``` +# T::Sig::WithoutRuntime.sig { void } +# def foo; end +# ``` +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/forbid_sig_without_runtime.rb:23 +class RuboCop::Cop::Sorbet::ForbidSigWithoutRuntime < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Sorbet::SignatureHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/forbid_sig_without_runtime.rb:29 + def on_signature(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/forbid_sig_without_runtime.rb:27 +RuboCop::Cop::Sorbet::ForbidSigWithoutRuntime::MSG = T.let(T.unsafe(nil), String) + +# Correct superclass `send` expressions by constant literals. +# +# Sorbet, the static checker, is not (yet) able to support constructs on the +# following form: +# +# ```ruby +# class Foo < send_expr; end +# ``` +# +# Multiple occurences of this can be found in Shopify's code base like: +# +# ```ruby +# class ShopScope < Component::TrustedIdScope[ShopIdentity::ShopId] +# ``` +# or +# ```ruby +# class ApiClientEligibility < Struct.new(:api_client, :match_results, :shop) +# ``` +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb:28 +class RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb:32 + def dynamic_superclass?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb:36 + def on_class(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb:29 +RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral::MSG = T.let(T.unsafe(nil), String) + +# Disallows using `T.absurd` anywhere. +# +# @example +# +# # bad +# T.absurd(foo) +# +# # good +# x #: absurd +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_absurd.rb:17 +class RuboCop::Cop::Sorbet::ForbidTAbsurd < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_absurd.rb:27 + def on_csend(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_absurd.rb:24 + def on_send(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_absurd.rb:22 + def t_absurd?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_absurd.rb:18 +RuboCop::Cop::Sorbet::ForbidTAbsurd::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_absurd.rb:19 +RuboCop::Cop::Sorbet::ForbidTAbsurd::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Detect and autocorrect `T.any(..., NilClass, ...)` to `T.nilable(...)` +# +# @example +# +# # bad +# T.any(String, NilClass) +# T.any(NilClass, String) +# T.any(NilClass, Symbol, String) +# +# # good +# T.nilable(String) +# T.nilable(String) +# T.nilable(T.any(Symbol, String)) +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_any_with_nil.rb:19 +class RuboCop::Cop::Sorbet::ForbidTAnyWithNil < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_any_with_nil.rb:31 + def nil_const_node?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_any_with_nil.rb:48 + def on_csend(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_any_with_nil.rb:35 + def on_send(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_any_with_nil.rb:26 + def t_any_call?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_any_with_nil.rb:52 + def build_replacement(non_nil_args); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_any_with_nil.rb:22 +RuboCop::Cop::Sorbet::ForbidTAnyWithNil::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_any_with_nil.rb:23 +RuboCop::Cop::Sorbet::ForbidTAnyWithNil::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallows using `T.bind` anywhere. +# +# @example +# +# # bad +# T.bind(self, Integer) +# +# # good +# #: self as Integer +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_bind.rb:17 +class RuboCop::Cop::Sorbet::ForbidTBind < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_bind.rb:27 + def on_csend(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_bind.rb:24 + def on_send(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_bind.rb:22 + def t_bind?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_bind.rb:18 +RuboCop::Cop::Sorbet::ForbidTBind::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_bind.rb:19 +RuboCop::Cop::Sorbet::ForbidTBind::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallows using `T.cast` anywhere. +# +# @example +# +# # bad +# T.cast(foo, Integer) +# +# # good +# foo #: as Integer +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_cast.rb:17 +class RuboCop::Cop::Sorbet::ForbidTCast < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_cast.rb:27 + def on_csend(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_cast.rb:24 + def on_send(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_cast.rb:22 + def t_cast?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_cast.rb:18 +RuboCop::Cop::Sorbet::ForbidTCast::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_cast.rb:19 +RuboCop::Cop::Sorbet::ForbidTCast::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallow using `T::Enum`. +# +# @example +# +# # bad +# class MyEnum < T::Enum +# enums do +# A = new +# B = new +# end +# end +# +# # good +# class MyEnum +# A = "a" +# B = "b" +# C = "c" +# end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_enum.rb:26 +class RuboCop::Cop::Sorbet::ForbidTEnum < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_enum.rb:34 + def on_class(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_enum.rb:30 + def t_enum?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_enum.rb:27 +RuboCop::Cop::Sorbet::ForbidTEnum::MSG = T.let(T.unsafe(nil), String) + +# Forbids `extend T::Helpers` and `include T::Helpers` in classes and modules. +# +# This is useful when using RBS or RBS-inline syntax for type signatures, +# where `T::Helpers` is not needed and including it is redundant. +# +# @example +# +# # bad +# class Example +# extend T::Helpers +# end +# +# # bad +# module Example +# include T::Helpers +# end +# +# # good +# class Example +# end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_helpers.rb:26 +class RuboCop::Cop::Sorbet::ForbidTHelpers < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_helpers.rb:40 + def on_csend(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_helpers.rb:35 + def on_send(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_helpers.rb:31 + def t_helpers?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_helpers.rb:27 +RuboCop::Cop::Sorbet::ForbidTHelpers::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_helpers.rb:28 +RuboCop::Cop::Sorbet::ForbidTHelpers::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallows using `T.let` anywhere. +# +# @example +# +# # bad +# T.let(foo, Integer) +# +# # good +# foo #: Integer +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_let.rb:17 +class RuboCop::Cop::Sorbet::ForbidTLet < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_let.rb:27 + def on_csend(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_let.rb:24 + def on_send(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_let.rb:22 + def t_let?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_let.rb:18 +RuboCop::Cop::Sorbet::ForbidTLet::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_let.rb:19 +RuboCop::Cop::Sorbet::ForbidTLet::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallows using `T.must` anywhere. +# +# @example +# +# # bad +# T.must(foo) +# +# # good +# foo #: as !nil +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_must.rb:17 +class RuboCop::Cop::Sorbet::ForbidTMust < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_must.rb:27 + def on_csend(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_must.rb:24 + def on_send(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_must.rb:22 + def t_must?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_must.rb:18 +RuboCop::Cop::Sorbet::ForbidTMust::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_must.rb:19 +RuboCop::Cop::Sorbet::ForbidTMust::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Forbids `extend T::Sig` and `include T::Sig` in classes and modules. +# +# This is useful when using RBS or RBS-inline syntax for type signatures, +# where `T::Sig` is not needed and including it is redundant. +# +# @example +# +# # bad +# class Example +# extend T::Sig +# end +# +# # bad +# module Example +# include T::Sig +# end +# +# # good +# class Example +# end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_sig.rb:26 +class RuboCop::Cop::Sorbet::ForbidTSig < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_sig.rb:40 + def on_csend(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_sig.rb:35 + def on_send(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_sig.rb:31 + def t_sig?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_sig.rb:27 +RuboCop::Cop::Sorbet::ForbidTSig::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_sig.rb:28 +RuboCop::Cop::Sorbet::ForbidTSig::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallow using `T::Struct` and `T::Props`. +# +# @example +# +# # bad +# class MyStruct < T::Struct +# const :foo, String +# prop :bar, Integer, default: 0 +# +# def some_method; end +# end +# +# # good +# class MyStruct +# extend T::Sig +# +# sig { returns(String) } +# attr_reader :foo +# +# sig { returns(Integer) } +# attr_accessor :bar +# +# sig { params(foo: String, bar: Integer) } +# def initialize(foo:, bar: 0) +# @foo = foo +# @bar = bar +# end +# +# def some_method; end +# end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:38 +class RuboCop::Cop::Sorbet::ForbidTStruct < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::CommentsHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:169 + def on_class(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:210 + def on_send(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:167 + def t_props?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:162 + def t_struct?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:218 + def initialize_method(indent, props); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:258 + def previous_line_blank?(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:47 +RuboCop::Cop::Sorbet::ForbidTStruct::MSG_PROPS = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:46 +RuboCop::Cop::Sorbet::ForbidTStruct::MSG_STRUCT = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:104 +class RuboCop::Cop::Sorbet::ForbidTStruct::Property + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:107 + def initialize(node, kind, name, type, default:, factory:); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:123 + def attr_accessor; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:119 + def attr_sig; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:105 + def default; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:105 + def factory; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:144 + def initialize_assign; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:131 + def initialize_param; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:127 + def initialize_sig_param; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:105 + def kind; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:105 + def name; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:151 + def nilable?; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:105 + def node; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:155 + def type; end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:44 +RuboCop::Cop::Sorbet::ForbidTStruct::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# This class walks down the class body of a T::Struct and collects all the properties that will need to be +# translated into `attr_reader` and `attr_accessor` methods. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:51 +class RuboCop::Cop::Sorbet::ForbidTStruct::TStructWalker + include ::RuboCop::AST::Traversal + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:57 + def initialize; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:63 + def extend_t_sig?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:55 + def has_extend_t_sig; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:72 + def on_send(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:55 + def props; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_struct.rb:68 + def t_struct_prop?(param0 = T.unsafe(nil)); end +end + +# Disallows using `T.type_alias` anywhere. +# +# @example +# +# # bad +# STRING_OR_INTEGER = T.type_alias { T.any(Integer, String) } +# +# # good +# #: type string_or_integer = Integer | String +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_type_alias.rb:17 +class RuboCop::Cop::Sorbet::ForbidTTypeAlias < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_type_alias.rb:23 + def on_block(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_type_alias.rb:26 + def on_numblock(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_type_alias.rb:21 + def t_type_alias?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_type_alias.rb:18 +RuboCop::Cop::Sorbet::ForbidTTypeAlias::MSG = T.let(T.unsafe(nil), String) + +# Disallows using `T.unsafe` anywhere. +# +# @example +# +# # bad +# T.unsafe(foo) +# +# # good +# foo +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_unsafe.rb:17 +class RuboCop::Cop::Sorbet::ForbidTUnsafe < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_unsafe.rb:27 + def on_csend(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_unsafe.rb:24 + def on_send(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_unsafe.rb:22 + def t_unsafe?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_unsafe.rb:18 +RuboCop::Cop::Sorbet::ForbidTUnsafe::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_unsafe.rb:19 +RuboCop::Cop::Sorbet::ForbidTUnsafe::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallows using `T.untyped` anywhere. +# +# @example +# +# # bad +# sig { params(my_argument: T.untyped).void } +# def foo(my_argument); end +# +# # good +# sig { params(my_argument: String).void } +# def foo(my_argument); end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_untyped.rb:20 +class RuboCop::Cop::Sorbet::ForbidTUntyped < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_untyped.rb:27 + def on_send(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_untyped.rb:25 + def t_untyped?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_untyped.rb:21 +RuboCop::Cop::Sorbet::ForbidTUntyped::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_t_untyped.rb:22 +RuboCop::Cop::Sorbet::ForbidTUntyped::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Disallows defining type aliases that contain shapes +# +# @example +# +# # bad +# Foo = T.type_alias { { foo: Integer } } +# +# # good +# class Foo +# extend T::Sig +# +# sig { params(foo: Integer).void } +# def initialize(foo) +# @foo = foo +# end +# end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb:24 +class RuboCop::Cop::Sorbet::ForbidTypeAliasedShapes < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb:36 + def on_block(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb:40 + def on_numblock(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb:28 + def shape_type_alias?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb:25 +RuboCop::Cop::Sorbet::ForbidTypeAliasedShapes::MSG = T.let(T.unsafe(nil), String) + +# Disallows use of `T.untyped` or `T.nilable(T.untyped)` +# as a prop type for `T::Struct` or `T::ImmutableStruct`. +# +# @example +# +# # bad +# class SomeClass < T::Struct +# const :foo, T.untyped +# prop :bar, T.nilable(T.untyped) +# end +# +# # good +# class SomeClass < T::Struct +# const :foo, Integer +# prop :bar, T.nilable(String) +# end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb:25 +class RuboCop::Cop::Sorbet::ForbidUntypedStructProps < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb:54 + def on_class(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb:44 + def subclass_of_t_struct?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb:39 + def t_nilable_untyped(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb:29 + def t_struct(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb:34 + def t_untyped(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb:50 + def untyped_props(param0); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb:26 +RuboCop::Cop::Sorbet::ForbidUntypedStructProps::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb:6 +module RuboCop::Cop::Sorbet::GemVersionAnnotationHelper + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb:9 + def gem_version_annotations; end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb:17 + def gem_version_annotation?(comment); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb:21 + def gem_versions(comment); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb:7 +RuboCop::Cop::Sorbet::GemVersionAnnotationHelper::VERSION_PREFIX = T.let(T.unsafe(nil), String) + +# Makes the Sorbet typed sigil mandatory in all files. +# +# Options: +# +# * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false') +# * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one +# +# If a `SuggestedStrictness` level is specified, it will be used in autocorrect. +# If a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/has_sigil.rb:18 +class RuboCop::Cop::Sorbet::HasSigil < ::RuboCop::Cop::Sorbet::ValidSigil + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/has_sigil.rb:19 + def require_sigil_on_all_files?; end +end + +# Makes the Sorbet `ignore` sigil mandatory in all files. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb:10 +class RuboCop::Cop::Sorbet::IgnoreSigil < ::RuboCop::Cop::Sorbet::HasSigil + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb:11 + def minimum_strictness; end +end + +# Disallows declaring implicit conversion methods. +# Since Sorbet is a nominal (not structural) type system, +# implicit conversion is currently unsupported. +# +# @example +# +# # bad +# def to_str; end +# +# # good +# def to_str(x); end +# +# # bad +# def self.to_str; end +# +# # good +# def self.to_str(x); end +# +# # bad +# alias to_str to_s +# +# @see https://docs.ruby-lang.org/en/master/implicit_conversion_rdoc.html +# @note Since the arity of aliased methods is not checked, false positives may result. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/implicit_conversion_method.rb:31 +class RuboCop::Cop::Sorbet::ImplicitConversionMethod < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/implicit_conversion_method.rb:37 + def on_alias(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/implicit_conversion_method.rb:42 + def on_def(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/implicit_conversion_method.rb:48 + def on_defs(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/implicit_conversion_method.rb:50 + def on_send(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/implicit_conversion_method.rb:32 +RuboCop::Cop::Sorbet::ImplicitConversionMethod::IMPLICIT_CONVERSION_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/implicit_conversion_method.rb:33 +RuboCop::Cop::Sorbet::ImplicitConversionMethod::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/implicit_conversion_method.rb:35 +RuboCop::Cop::Sorbet::ImplicitConversionMethod::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for the ordering of keyword arguments required by +# sorbet-runtime. The ordering requires that all keyword arguments +# are at the end of the parameters list, and all keyword arguments +# with a default value must be after those without default values. +# +# @example +# +# # bad +# sig { params(a: Integer, b: String).void } +# def foo(a: 1, b:); end +# +# # good +# sig { params(b: String, a: Integer).void } +# def foo(b:, a: 1); end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb:20 +class RuboCop::Cop::Sorbet::KeywordArgumentOrdering < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Sorbet::SignatureHelp + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb:23 + def on_signature(node); end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb:34 + def check_order_for_kwoptargs(parameters); end +end + +# Disallow creating a `T::Enum` with less than two values. +# +# @example +# +# # bad +# class ErrorMessages < T::Enum +# enums do +# ServerError = new("There was a server error.") +# end +# end +# +# # good +# class ErrorMessages < T::Enum +# enums do +# ServerError = new("There was a server error.") +# NotFound = new("The resource was not found.") +# end +# end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb:24 +class RuboCop::Cop::Sorbet::MultipleTEnumValues < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Sorbet::TEnum + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb:30 + def enums_block?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb:40 + def on_block(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb:34 + def on_class(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb:27 +RuboCop::Cop::Sorbet::MultipleTEnumValues::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb:8 +module RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb:28 + def on_assignment(value); end + + class << self + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb:10 + def prepended(base); end + end +end + +# Checks for the obsolete pattern for initializing instance variables that was required for older Sorbet +# +# It's no longer required, as of Sorbet 0.5.10210 +# See https://sorbet.org/docs/type-assertions#put-type-assertions-behind-memoization +# +# @example +# +# # bad +# sig { returns(Foo) } +# def foo +# @foo = T.let(@foo, T.nilable(Foo)) +# @foo ||= Foo.new +# end +# +# # bad +# sig { returns(Foo) } +# def foo +# # This would have been a mistake, causing the memoized value to be discarded and recomputed on every call. +# @foo = T.let(nil, T.nilable(Foo)) +# @foo ||= Foo.new +# end +# +# # good +# sig { returns(Foo) } +# def foo +# @foo ||= T.let(Foo.new, T.nilable(Foo)) +# end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb:37 +class RuboCop::Cop::Sorbet::ObsoleteStrictMemoization < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::MatchRange + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::LineLengthHelp + include ::RuboCop::Cop::Sorbet::TargetSorbetVersion + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb:51 + def legacy_memoization_pattern?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb:62 + def on_begin(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb:86 + def relevant_file?(file); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb:47 +RuboCop::Cop::Sorbet::ObsoleteStrictMemoization::MSG = T.let(T.unsafe(nil), String) + +# Forbids the use of redundant `extend T::Sig`. Only for use in +# applications that monkey patch `Module.include(T::Sig)` globally, +# which would make it redundant. +# +# @safety +# This cop should not be enabled in applications that have not monkey +# patched `Module`. +# +# @example +# # bad +# class Example +# extend T::Sig +# sig { void } +# def no_op; end +# end +# +# # good +# class Example +# sig { void } +# def no_op; end +# end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb:28 +class RuboCop::Cop::Sorbet::RedundantExtendTSig < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb:36 + def extend_t_sig?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb:40 + def on_send(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb:32 +RuboCop::Cop::Sorbet::RedundantExtendTSig::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb:33 +RuboCop::Cop::Sorbet::RedundantExtendTSig::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Prevents unnecessary `T.let` where Sorbet infers the type automatically. +# +# When a signature parameter is assigned to an instance variable in +# `initialize`, the type is inferred from the signature. +# +# When a constant is assigned a constructor call (`.new`), optionally +# followed by `.freeze` (Sorbet 0.6.13304+), the type is inferred from +# the class being instantiated. Generic classes (e.g. `Set`) are +# excluded: Sorbet infers their constructor calls as applied types like +# `T::Set[T.untyped]`, so an annotation is still required. +# +# @example +# +# # bad +# sig { params(a: Integer) } +# def initialize(a) +# @a = T.let(a, Integer) +# end +# +# # good +# sig { params(a: Integer) } +# def initialize(a) +# @a = a +# end +# +# # good +# sig { params(a: Integer) } +# def initialize(a) +# @a = T.let(a, T.any(Integer, String)) +# end +# +# # bad +# DEFAULT_PATH = T.let(Pathname.new("/usr/local").freeze, Pathname) +# +# # good +# DEFAULT_PATH = Pathname.new("/usr/local").freeze +# +# # good — generic classes are not inferred, so T.let is required +# LICENSES = T.let(Set.new(["mit"]).freeze, T::Set[String]) +# +# # good — instance variables are only inferred from signature parameters +# @path = T.let(Pathname.new("/usr/local"), Pathname) +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let.rb:48 +class RuboCop::Cop::Sorbet::RedundantTLet < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Sorbet::SignatureHelp + include ::RuboCop::Cop::Sorbet::ConstantScope + include ::RuboCop::Cop::Sorbet::TargetSorbetVersion + include ::RuboCop::Cop::Sorbet::TLetCorrection + extend ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let.rb:99 + def on_casgn(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let.rb:80 + def on_def(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let.rb:78 + def sig_params(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let.rb:72 + def t_let(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let.rb:75 + def t_let_casgn(param0 = T.unsafe(nil)); end + + private + + # Returns the `.new` call for a constant constructor, looking through + # an optional block and trailing `.freeze`. For example, + # `Foo.new { _1.enabled = true }.freeze` returns the `Foo.new` call, + # while `foo.new` and `Foo.build` return `nil`. + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let.rb:135 + def constructor_call(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let.rb:195 + def expected_type(sig_type, arg_kind); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let.rb:180 + def find_redundant_t_let(node, tlet_key, tlet_value, sig_params, method_args); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let.rb:151 + def find_sig_node(method_node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let.rb:172 + def ivar_assignments(node); end + + # Maps named parameters to their AST types, omitting destructured + # parameters because they have no name and cannot appear in a signature. + # For example, `def initialize(a, (left, right), *rest)` returns + # `{ a: :arg, rest: :restarg }`, omitting `(left, right)`. + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let.rb:125 + def named_argument_types(method_node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let.rb:160 + def normalize_whitespace(source); end + + # Returns the method send wrapped by a block, or the original node when + # no block is present. For example, `Foo.new { _1.enabled = true }` + # returns the `Foo.new` send node. + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let.rb:147 + def unwrap_block(node); end +end + +# Classes whose constructor calls Sorbet infers as applied generic +# types (e.g. `T::Set[T.untyped]`) rather than the bare class, so +# constants assigned them still need an explicit annotation. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let.rb:69 +RuboCop::Cop::Sorbet::RedundantTLet::GENERIC_CLASSES = T.let(T.unsafe(nil), Array) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let.rb:63 +RuboCop::Cop::Sorbet::RedundantTLet::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let.rb:64 +RuboCop::Cop::Sorbet::RedundantTLet::MSG_CONSTRUCTOR = T.let(T.unsafe(nil), String) + +# Checks for redundant `T.let` declarations where the first argument +# is a literal whose type Sorbet can infer automatically, so wrapping +# it in `T.let` is redundant. +# +# Simple literals (strings, symbols, integers, floats, regexps) infer as +# their own class. Regexp literals are the only simple literals whose +# inference survives a `.freeze` call (Sorbet 0.6.13304+), so +# `T.let(/foo/.freeze, Regexp)` is also redundant; other frozen simple +# literals (e.g. `"hello".freeze`) are not inferred and still need `T.let`. +# +# Array literals of simple literals are also inferred: +# +# * A frozen array (`[...].freeze`) infers as a fixed-size tuple, which is +# a subtype of the annotated `T::Array`, so the annotation is redundant. +# * An unfrozen array infers as `T::Array[]`. It is only +# flagged when that inferred type matches the annotation exactly, to +# avoid silently widening (e.g. `["a", nil]` infers a nilable element). +# +# Hashes are excluded: Sorbet infers hash literals as `T.untyped`, so the +# annotation is required. +# +# @example +# # bad +# MAX_RETRIES = T.let(3, Integer) +# GREETING = T.let("hello", String) +# RATE = T.let(1.5, Float) +# PATTERN = T.let(/foo/, Regexp) +# FROZEN_PATTERN = T.let(/foo/.freeze, Regexp) +# STATUS = T.let(:active, Symbol) +# SHELLS = T.let([:bash, :zsh].freeze, T::Array[Symbol]) +# NAMES = T.let(["alice", "bob"], T::Array[String]) +# +# # good +# MAX_RETRIES = 3 +# GREETING = "hello" +# RATE = 1.5 +# PATTERN = /foo/ +# FROZEN_PATTERN = /foo/.freeze +# STATUS = :active +# SHELLS = [:bash, :zsh].freeze +# NAMES = ["alice", "bob"] +# +# # good — non-regexp frozen simple literals are not inferred +# GREETING = T.let("hello".freeze, String) +# +# # good — hash literals are inferred as T.untyped +# OPTIONS = T.let({ verbose: true }, T::Hash[Symbol, T::Boolean]) +# +# # good — unfrozen array whose annotation is wider than the inferred type +# NAMES = T.let(["alice", "bob"], T::Array[T.nilable(String)]) +# +# # good — type is not the literal's own class +# value = T.let("hello", T.nilable(String)) +# +# # good — instance variables need T.let for Sorbet to track their type +# @max_retries = T.let(3, Integer) +# +# # good — local variables may need T.let so Sorbet allows reassignment +# count = T.let(0, Integer) +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let_for_literal.rb:67 +class RuboCop::Cop::Sorbet::RedundantTLetForLiteral < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Sorbet::ConstantScope + include ::RuboCop::Cop::Sorbet::TargetSorbetVersion + include ::RuboCop::Cop::Sorbet::TLetCorrection + extend ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let_for_literal.rb:123 + def on_casgn(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let_for_literal.rb:119 + def t_let_with_array?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let_for_literal.rb:114 + def t_let_with_literal_and_class?(param0 = T.unsafe(nil)); end + + private + + # An array literal is inferable only when every element is one of the + # simple literals Sorbet reflects into the element type (or a nested + # inferable array). Empty arrays are excluded: they infer as + # `T::Array[T.untyped]` and so still need the annotation. + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let_for_literal.rb:170 + def inferable_array?(node); end + + # Returns the underlying literal when its inference is supported by the + # target Sorbet version. Bare literals are always supported; for example, + # `3` returns its integer node. Frozen literals are version-gated, so + # `/foo/.freeze` returns its regexp node only for supported targets. + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let_for_literal.rb:152 + def inferable_literal_node(value_node); end + + # The type Sorbet infers for an unfrozen array literal, or nil when the + # element types are not uniform enough to render deterministically + # (mixed classes, booleans, nils and nested arrays are left alone). + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let_for_literal.rb:202 + def inferred_array_type(node); end + + # Strips whitespace and any trailing comma before a closing delimiter, + # so a multi-line annotation (`T::Array[\n String,\n]`) still compares + # equal to the rendered inferred type. + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let_for_literal.rb:212 + def normalize(source); end + + # Returns whether Sorbet's inferred array type makes the annotation + # redundant. A frozen `[:a].freeze` infers as a tuple compatible with + # any `T::Array[...]`; an unfrozen `[:a]` must infer exactly the + # annotated type, such as `T::Array[Symbol]`. + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let_for_literal.rb:187 + def redundant_array_annotation?(array_node, type_node, frozen:); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let_for_literal.rb:159 + def register_offense(node, value_node, type); end + + # `T::Array[...]` (with or without a leading `::`) + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let_for_literal.rb:194 + def t_array_type?(node); end +end + +# Element node types allowed inside an inferable array literal: the +# literals whose class Sorbet reflects into the array's element type. +# Regexps and ranges, by contrast, degrade the array to `T.untyped`, so +# they are excluded. Interpolated strings/symbols (`dstr`/`dsym`) infer +# as `String`/`Symbol`, the same as their plain literal forms. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let_for_literal.rb:100 +RuboCop::Cop::Sorbet::RedundantTLetForLiteral::ARRAY_ELEMENT_TYPES = T.let(T.unsafe(nil), Array) + +# Element node types whose inferred class is unambiguous, used to derive +# the element type of an unfrozen array literal. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let_for_literal.rb:104 +RuboCop::Cop::Sorbet::RedundantTLetForLiteral::ELEMENT_TYPE_TO_CLASS = T.let(T.unsafe(nil), Hash) + +# Simple literal node types Sorbet infers, mapped to the class name. +# Interpolated strings/symbols (`dstr`/`dsym`) infer as `String`/`Symbol`. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let_for_literal.rb:85 +RuboCop::Cop::Sorbet::RedundantTLetForLiteral::LITERAL_TYPE_TO_CLASS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/redundant_t_let_for_literal.rb:81 +RuboCop::Cop::Sorbet::RedundantTLetForLiteral::MSG = T.let(T.unsafe(nil), String) + +# Checks for the use of Ruby Refinements library. Refinements add +# complexity and incur a performance penalty that can be significant +# for large code bases. Good examples are cases of unrelated +# methods that happen to have the same name as these module methods. +# +# @example +# # bad +# module Foo +# refine(Date) do +# end +# end +# +# # bad +# module Foo +# using(Date) do +# end +# end +# +# # good +# module Foo +# bar.refine(Date) +# end +# +# # good +# module Foo +# bar.using(Date) +# end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/refinement.rb:34 +class RuboCop::Cop::Sorbet::Refinement < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/refinement.rb:38 + def on_send(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/refinement.rb:35 +RuboCop::Cop::Sorbet::Refinement::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/refinement.rb:36 +RuboCop::Cop::Sorbet::Refinement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks that `on_failure` is not used without `checked(:tests)` or `checked(:always)`. +# +# @example +# +# # bad +# sig { params(x: Integer).returns(Integer).on_failure(:raise) } +# def plus_one(x) +# x + 1 +# end +# +# # good +# sig { params(x: Integer).returns(Integer).checked(:always).on_failure(:raise) } +# def plus_one(x) +# x + 1 +# end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/runtime_on_failure_depends_on_checked.rb:22 +class RuboCop::Cop::Sorbet::RuntimeOnFailureDependsOnChecked < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Sorbet::SignatureHelp + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/runtime_on_failure_depends_on_checked.rb:33 + def checked_tests_or_always?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/runtime_on_failure_depends_on_checked.rb:28 + def on_failure_call?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/runtime_on_failure_depends_on_checked.rb:37 + def on_signature(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/runtime_on_failure_depends_on_checked.rb:25 +RuboCop::Cop::Sorbet::RuntimeOnFailureDependsOnChecked::MSG = T.let(T.unsafe(nil), String) + +# Suggests using `grep` over `select` when using it only for type narrowing. +# +# @example +# +# # bad +# strings_or_integers.select { |e| e.is_a?(String) } +# strings_or_integers.filter { |e| e.is_a?(String) } +# strings_or_integers.select { |e| e.kind_of?(String) } +# +# # good +# strings_or_integers.grep(String) +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/select_by_is_a.rb:19 +class RuboCop::Cop::Sorbet::SelectByIsA < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/select_by_is_a.rb:58 + def on_csend(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/select_by_is_a.rb:43 + def on_send(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/select_by_is_a.rb:26 + def type_narrowing_select?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/select_by_is_a.rb:22 +RuboCop::Cop::Sorbet::SelectByIsA::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/select_by_is_a.rb:23 +RuboCop::Cop::Sorbet::SelectByIsA::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# Checks for the correct order of `sig` builder methods. +# +# Options: +# +# * `Order`: The order in which to enforce the builder methods are called. +# +# @example +# # bad +# sig { void.abstract } +# +# # good +# sig { abstract.void } +# +# # bad +# sig { returns(Integer).params(x: Integer) } +# +# # good +# sig { params(x: Integer).returns(Integer) } +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/signature_build_order.rb:24 +class RuboCop::Cop::Sorbet::SignatureBuildOrder < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Sorbet::SignatureHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/signature_build_order.rb:33 + def on_signature(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/signature_build_order.rb:29 + def root_call(param0); end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/signature_build_order.rb:96 + def builder_method_indexes; end + + # Split foo.bar.baz into [foo, foo.bar, foo.bar.baz] + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/signature_build_order.rb:83 + def call_chain(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/signature_build_order.rb:70 + def expected_source(expected_calls_and_indexes); end +end + +# Mixin for writing cops for signatures, providing a `signature?` node matcher and an `on_signature` trigger. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/signature_help.rb:7 +module RuboCop::Cop::Sorbet::SignatureHelp + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/signature_help.rb:16 + def bare_sig?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/signature_help.rb:42 + def on_block(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/signature_help.rb:46 + def on_numblock(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/signature_help.rb:48 + def on_signature(_node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/signature_help.rb:25 + def sig_with_runtime?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/signature_help.rb:34 + def sig_without_runtime?(param0 = T.unsafe(nil)); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/signature_help.rb:11 + def signature?(param0 = T.unsafe(nil)); end +end + +# Ensures empty class/module definitions in RBI files are +# done on a single line rather than being split across multiple lines. +# +# @example +# +# # bad +# module SomeModule +# end +# +# # good +# module SomeModule; end +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb:17 +class RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb:30 + def on_class(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb:22 + def on_module(node); end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb:34 + def convert_newlines_to_semicolons(source); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb:20 +RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions::MSG = T.let(T.unsafe(nil), String) + +# Makes the Sorbet `strict` sigil mandatory in all files. +# +# @safety +# This cop is unsafe because Sorbet sigils may not exist yet when it is run. +# +# @example +# +# # bad +# +# # bad +# +# # good +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/strict_sigil.rb:25 +class RuboCop::Cop::Sorbet::StrictSigil < ::RuboCop::Cop::Sorbet::HasSigil + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/strict_sigil.rb:26 + def minimum_strictness; end +end + +# Makes the Sorbet `strong` sigil mandatory in all files. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/strong_sigil.rb:10 +class RuboCop::Cop::Sorbet::StrongSigil < ::RuboCop::Cop::Sorbet::HasSigil + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/strong_sigil.rb:11 + def minimum_strictness; end +end + +# Mixing for writing cops that deal with `T::Enum`s +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/t_enum.rb:7 +module RuboCop::Cop::Sorbet::TEnum + extend ::RuboCop::AST::NodePattern::Macros + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/t_enum.rb:9 + def initialize(*_arg0); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/t_enum.rb:23 + def after_class(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/t_enum.rb:19 + def on_class(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/t_enum.rb:15 + def t_enum?(param0 = T.unsafe(nil)); end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/t_enum.rb:29 + def in_t_enum_class?; end +end + +# Shared autocorrection helper for cops that unwrap a redundant +# `T.let(value, Type)` down to `value`, preserving heredoc bodies that a +# naive `corrector.replace(t_let_node, value_node.source)` would drop +# (`value_node.source` stops at the marker line, so the body and its +# terminator sit outside it). +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/t_let_correction.rb:11 +module RuboCop::Cop::Sorbet::TLetCorrection + private + + # Returns the comment trailing the heredoc marker, including its leading space. + # For example, the marker line `<<~SQL, String) # query` returns ` # query`. + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/t_let_correction.rb:55 + def marker_line_comment(value_node); end + + # Expands the correction range to include every heredoc body and terminator. + # For example, the range for `T.let(<<~SQL, String)` extends through the + # final `SQL` terminator rather than ending at the closing parenthesis. + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/t_let_correction.rb:35 + def range_including_heredocs(t_let_node, heredocs); end + + # Replaces `T.let(value, Type)` with `value`. + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/t_let_correction.rb:15 + def replace_t_let(corrector, t_let_node, value_node); end + + # Replaces `T.let(value, Type)` with `value` without losing any heredocs + # contained in the value. For example, `T.let(<<~SQL, String)` becomes + # `<<~SQL` followed by its original body and terminator. + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/t_let_correction.rb:25 + def replace_t_let_preserving_heredocs(corrector, t_let_node, value_node, heredocs); end + + # Reconstructs the value with its marker-line comment and heredoc bodies. + # For example, `T.let(<<~SQL, String) # query` becomes a source string + # containing `<<~SQL # query`, followed by its body and `SQL` terminator. + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/t_let_correction.rb:44 + def source_including_heredocs(value_node, heredocs); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb:6 +module RuboCop::Cop::Sorbet::TargetSorbetVersion + mixes_in_class_methods ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb:28 + def enabled_for_sorbet_static_version?; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb:44 + def read_sorbet_static_version_from_bundler_lock_file; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb:24 + def sorbet_enabled?; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb:35 + def target_sorbet_static_version_from_bundler_lock_file; end + + class << self + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb:8 + def included(target); end + end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb:13 +module RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods + # Sets the version of the Sorbet static type checker required by this cop + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb:15 + def minimum_target_sorbet_static_version(version); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb:19 + def supports_target_sorbet_static_version?(version); end +end + +# Makes the Sorbet `true` sigil mandatory in all files. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/true_sigil.rb:10 +class RuboCop::Cop::Sorbet::TrueSigil < ::RuboCop::Cop::Sorbet::HasSigil + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/true_sigil.rb:11 + def minimum_strictness; end +end + +# Ensures all constants used as `T.type_alias` are using CamelCase. +# +# @example +# +# # bad +# FOO_OR_BAR = T.type_alias { T.any(Foo, Bar) } +# +# # good +# FooOrBar = T.type_alias { T.any(Foo, Bar) } +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/type_alias_name.rb:17 +class RuboCop::Cop::Sorbet::TypeAliasName < ::RuboCop::Cop::Base + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/type_alias_name.rb:32 + def on_casgn(node); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/type_alias_name.rb:21 + def underscored_type_alias?(param0 = T.unsafe(nil)); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/type_alias_name.rb:18 +RuboCop::Cop::Sorbet::TypeAliasName::MSG = T.let(T.unsafe(nil), String) + +# Checks that gem versions in RBI annotations are properly formatted per the Bundler gem specification. +# +# @example +# # bad +# # @version > not a version number +# +# # good +# # @version = 1 +# +# # good +# # @version > 1.2.3 +# +# # good +# # @version <= 4.3-preview +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb:21 +class RuboCop::Cop::Sorbet::ValidGemVersionAnnotations < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Sorbet::GemVersionAnnotationHelper + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb:27 + def on_new_investigation; end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb:50 + def valid_version?(version_string); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb:24 +RuboCop::Cop::Sorbet::ValidGemVersionAnnotations::MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb:25 +RuboCop::Cop::Sorbet::ValidGemVersionAnnotations::VALID_OPERATORS = T.let(T.unsafe(nil), Array) + +# Checks that every Ruby file contains a valid Sorbet sigil. +# Adapted from: https://gist.github.com/clarkdave/85aca4e16f33fd52aceb6a0a29936e52 +# +# Options: +# +# * `RequireSigilOnAllFiles`: make offense if the Sorbet typed is not found in the file (default: false) +# * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false') +# * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one +# * `ExactStrictness`: If set, make offense if the strictness level in the file is different than this one +# +# If an `ExactStrictness` level is specified, it will be used in offense messages and autocorrect. +# If a `SuggestedStrictness` level is specified, it will be used in autocorrect. +# Otherwise, if a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:21 +class RuboCop::Cop::Sorbet::ValidSigil < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:24 + def on_new_investigation; end + + protected + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:169 + def autocorrect(corrector); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:110 + def check_double_commented_sigil(sigil, strictness); end + + # checks + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:59 + def check_sigil_present(sigil); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:137 + def check_strictness_level(sigil, strictness); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:98 + def check_strictness_not_empty(sigil, strictness); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:125 + def check_strictness_valid(sigil, strictness); end + + # Default is `nil` + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:203 + def exact_strictness; end + + # extraction + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:47 + def extract_sigil(processed_source); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:53 + def extract_strictness(sigil); end + + # Default is `nil` + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:197 + def minimum_strictness; end + + # Default is `false` + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:186 + def require_sigil_on_all_files?; end + + # Default is `'false'` + # + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:191 + def suggested_strictness; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:76 + def suggested_strictness_level; end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:43 +RuboCop::Cop::Sorbet::ValidSigil::INVALID_SIGIL_MSG = T.let(T.unsafe(nil), String) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:42 +RuboCop::Cop::Sorbet::ValidSigil::SIGIL_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/sigils/valid_sigil.rb:41 +RuboCop::Cop::Sorbet::ValidSigil::STRICTNESS_LEVELS = T.let(T.unsafe(nil), Array) + +# Disallows the usage of `.void.checked(:tests)`. +# +# Using `.void` changes the value returned from the method, but only if +# runtime type checking is enabled for the method. Methods marked `.void` +# will return different values in tests compared with non-test +# environments. This is particularly troublesome if branching on the +# result of a `.void` method, because the returned value in test code +# will be the truthy `VOID` value, while the non-test return value may be +# falsy depending on the method's implementation. +# +# - Use `.returns(T.anything).checked(:tests)` to keep the runtime type +# checking for the rest of the parameters. +# - Use `.void.checked(:never)` if you are on an older version of Sorbet +# which does not have `T.anything` (meaning versions 0.5.10781 or +# earlier. Versions released after 2023-04-14 include `T.anything`.) +# +# @example +# +# # bad +# sig { void.checked(:tests) } +# +# # good +# sig { void } +# sig { returns(T.anything).checked(:tests) } +# sig { void.checked(:never) } +# +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb:31 +class RuboCop::Cop::Sorbet::VoidCheckedTests < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::Sorbet::SignatureHelp + extend ::RuboCop::Cop::AutoCorrector + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb:37 + def checked_tests(param0); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb:58 + def on_signature(node); end + + private + + # pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb:48 + def top_level_void(node); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb:41 +RuboCop::Cop::Sorbet::VoidCheckedTests::MESSAGE = T.let(T.unsafe(nil), String) + +module RuboCop::Cop::Style; end + +class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/sorbet/version.rb:4 +module RuboCop::Sorbet; end + +# pkg:gem/rubocop-sorbet#lib/rubocop/sorbet.rb:11 +class RuboCop::Sorbet::Error < ::StandardError; end + +# A plugin that integrates RuboCop Sorbet with RuboCop's plugin system. +# +# pkg:gem/rubocop-sorbet#lib/rubocop/sorbet/plugin.rb:10 +class RuboCop::Sorbet::Plugin < ::LintRoller::Plugin + # pkg:gem/rubocop-sorbet#lib/rubocop/sorbet/plugin.rb:11 + def about; end + + # pkg:gem/rubocop-sorbet#lib/rubocop/sorbet/plugin.rb:24 + def rules(_context); end + + # pkg:gem/rubocop-sorbet#lib/rubocop/sorbet/plugin.rb:20 + def supported?(context); end +end + +# pkg:gem/rubocop-sorbet#lib/rubocop/sorbet/version.rb:5 +RuboCop::Sorbet::VERSION = T.let(T.unsafe(nil), String) 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..a824571 --- /dev/null +++ b/sorbet/rbi/gems/rubocop@1.88.2.rbi @@ -0,0 +1,63233 @@ +# 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/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/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/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/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/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 +# +# +# 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 +# +# +# 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 +# +# +# 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 +# +# +# 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 +# +# +# 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 +# +# +# 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 +# +# +# 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 +# +# +# 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 +# +# +# 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 +# +# +# 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 +# +# +# 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 +# +# +# 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 +# +# +# 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 +# +# +# 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 +# +# +# 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 +# +# +# 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 +# +# +# 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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 [](*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def []=(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:139 + def deprecation_check; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def dig(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:204 + def disabled_new_cops?; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def each(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def each_key(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:208 + def enabled_new_cops?; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def fetch(*_arg0, **_arg1, &_arg2); 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?(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def keys(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def merge(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def to_h(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def to_hash(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:101 + def to_s; end + + # pkg:gem/rubocop#lib/rubocop/config.rb:97 + def transform_values(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop#lib/rubocop/config.rb:99 + def validate(*_arg0, **_arg1, &_arg2); 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(*_arg0, **_arg1, &_arg2); end + + # pkg:gem/rubocop#lib/rubocop/config_validator.rb:26 + def smart_loaded_path(*_arg0, **_arg1, &_arg2); 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] #=> [#