From 5af1a59fdbced5c865e80e3a9bf918d8f38103b1 Mon Sep 17 00:00:00 2001 From: Jacobo Bouzas Quiroga Date: Fri, 15 Nov 2024 17:18:15 +0100 Subject: [PATCH 1/2] chore: make example project have standalone tapioca configuration --- examples/sinatra-pet-shelter/Gemfile | 19 +- examples/sinatra-pet-shelter/Gemfile.lock | 35 + examples/sinatra-pet-shelter/lib/app.rb | 17 +- .../sinatra-pet-shelter/lib/repository.rb | 4 +- .../sinatra-pet-shelter/lib/resources/dogs.rb | 11 +- examples/sinatra-pet-shelter/sorbet/config | 4 + .../sorbet/rbi/gems/.gitattributes | 1 + .../sorbet/rbi/gems/base64@0.2.0.rbi | 507 + .../sorbet/rbi/gems/coderay@1.1.3.rbi | 3427 ++ .../sorbet/rbi/gems/diff-lcs@1.5.1.rbi | 1131 + .../sorbet/rbi/gems/dry-inflector@1.1.0.rbi | 648 + .../sorbet/rbi/gems/erubi@1.13.0.rbi | 150 + .../sorbet/rbi/gems/json@2.7.2.rbi | 1562 + .../sorbet/rbi/gems/method_source@1.1.0.rbi | 304 + .../sorbet/rbi/gems/multi_json@1.15.0.rbi | 268 + .../sorbet/rbi/gems/mustermann@3.0.3.rbi | 2537 ++ .../sorbet/rbi/gems/netrc@0.11.0.rbi | 159 + .../sorbet/rbi/gems/parallel@1.26.3.rbi | 291 + .../sorbet/rbi/gems/polyfill@1.9.0.rbi | 9 + .../sorbet/rbi/gems/prism@0.30.0.rbi | 37863 ++++++++++++++++ .../sorbet/rbi/gems/pry@0.14.2.rbi | 10070 ++++ .../sorbet/rbi/gems/rack-protection@3.2.0.rbi | 905 + .../sorbet/rbi/gems/rack-test@2.1.0.rbi | 750 + .../sorbet/rbi/gems/rack@2.2.9.rbi | 5634 +++ .../sorbet/rbi/gems/rbi@0.1.14.rbi | 3327 ++ ...73ddd272417ca8026e5f13e1103b4c72897824.rbi | 1895 + .../sorbet/rbi/gems/rspec-core@3.13.1.rbi | 10887 +++++ .../rbi/gems/rspec-expectations@3.13.3.rbi | 8183 ++++ .../sorbet/rbi/gems/rspec-mocks@3.13.1.rbi | 5341 +++ .../sorbet/rbi/gems/rspec-support@3.13.1.rbi | 1630 + .../sorbet/rbi/gems/rspec@3.13.0.rbi | 83 + .../sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi | 9 + .../sorbet/rbi/gems/safe_type@1.1.1.rbi | 9 + .../sorbet/rbi/gems/sinatra-contrib@3.2.0.rbi | 3411 ++ .../sorbet/rbi/gems/sinatra@3.2.0.rbi | 2041 + .../sorbet/rbi/gems/sorbet-coerce@0.7.0.rbi | 9 + .../sorbet/rbi/gems/spoom@1.5.0.rbi | 4932 ++ .../sorbet/rbi/gems/tapioca@0.15.1.rbi | 3562 ++ .../sorbet/rbi/gems/thor@1.3.2.rbi | 4345 ++ .../sorbet/rbi/gems/tilt@2.4.0.rbi | 880 + .../sorbet/rbi/gems/yard-sorbet@0.9.0.rbi | 435 + .../sorbet/rbi/gems/yard@0.9.37.rbi | 18357 ++++++++ .../sorbet/tapioca/config.yml | 13 + .../sorbet/tapioca/require.rb | 10 + examples/sinatra-pet-shelter/spec/app_spec.rb | 8 +- .../sinatra-pet-shelter/spec/spec_helper.rb | 12 +- sorbet/config | 1 + 47 files changed, 135655 insertions(+), 31 deletions(-) create mode 100644 examples/sinatra-pet-shelter/sorbet/config create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/.gitattributes create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/base64@0.2.0.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/coderay@1.1.3.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/diff-lcs@1.5.1.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/dry-inflector@1.1.0.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/erubi@1.13.0.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/json@2.7.2.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/method_source@1.1.0.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/multi_json@1.15.0.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/mustermann@3.0.3.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/netrc@0.11.0.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/parallel@1.26.3.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/polyfill@1.9.0.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/prism@0.30.0.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/pry@0.14.2.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/rack-protection@3.2.0.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/rack-test@2.1.0.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/rack@2.2.9.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/rbi@0.1.14.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/resource_registry@0.0.0-2b73ddd272417ca8026e5f13e1103b4c72897824.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec-core@3.13.1.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec-expectations@3.13.3.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec-mocks@3.13.1.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec-support@3.13.1.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec@3.13.0.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/safe_type@1.1.1.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/sinatra-contrib@3.2.0.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/sinatra@3.2.0.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/sorbet-coerce@0.7.0.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/spoom@1.5.0.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/tapioca@0.15.1.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/thor@1.3.2.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/tilt@2.4.0.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/rbi/gems/yard@0.9.37.rbi create mode 100644 examples/sinatra-pet-shelter/sorbet/tapioca/config.yml create mode 100644 examples/sinatra-pet-shelter/sorbet/tapioca/require.rb diff --git a/examples/sinatra-pet-shelter/Gemfile b/examples/sinatra-pet-shelter/Gemfile index cdd1136..06d2a2b 100644 --- a/examples/sinatra-pet-shelter/Gemfile +++ b/examples/sinatra-pet-shelter/Gemfile @@ -1,14 +1,17 @@ # frozen_string_literal: true -source 'https://rubygems.org' +source "https://rubygems.org" -gem 'json' -gem 'resource_registry', github: 'factorialco/resource-registry', branch: 'adding-example-app' -gem 'sinatra' -gem 'sinatra-contrib' +gem "json" +gem "resource_registry", + github: "factorialco/resource-registry", + branch: "adding-example-app" +gem "sinatra" +gem "sinatra-contrib" +gem "tapioca", "~> 0.15.1", require: false group :development, :test do - gem 'pry' - gem 'rack-test' - gem 'rspec' + gem "pry" + gem "rack-test" + gem "rspec" end diff --git a/examples/sinatra-pet-shelter/Gemfile.lock b/examples/sinatra-pet-shelter/Gemfile.lock index f38f666..0091787 100644 --- a/examples/sinatra-pet-shelter/Gemfile.lock +++ b/examples/sinatra-pet-shelter/Gemfile.lock @@ -15,12 +15,16 @@ GEM coderay (1.1.3) diff-lcs (1.5.1) dry-inflector (1.1.0) + erubi (1.13.0) json (2.7.2) method_source (1.1.0) multi_json (1.15.0) mustermann (3.0.3) ruby2_keywords (~> 0.0.1) + netrc (0.11.0) + parallel (1.26.3) polyfill (1.9.0) + prism (0.30.0) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) @@ -30,6 +34,9 @@ GEM rack (~> 2.2, >= 2.2.4) rack-test (2.1.0) rack (>= 1.3) + rbi (0.1.14) + prism (>= 0.18.0, < 1.0.0) + sorbet-runtime (>= 0.5.9204) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) @@ -56,14 +63,41 @@ GEM rack-protection (= 3.2.0) sinatra (= 3.2.0) tilt (~> 2.0) + sorbet (0.5.11609) + sorbet-static (= 0.5.11609) sorbet-coerce (0.7.0) polyfill (~> 1.8) safe_type (~> 1.1, >= 1.1.1) sorbet-runtime (>= 0.4.4704) sorbet-runtime (0.5.11609) + sorbet-static (0.5.11609-universal-darwin) + sorbet-static (0.5.11609-x86_64-linux) + sorbet-static-and-runtime (0.5.11609) + sorbet (= 0.5.11609) + sorbet-runtime (= 0.5.11609) + spoom (1.5.0) + erubi (>= 1.10.0) + prism (>= 0.28.0) + sorbet-static-and-runtime (>= 0.5.10187) + thor (>= 0.19.2) + tapioca (0.15.1) + bundler (>= 2.2.25) + netrc (>= 0.11.0) + parallel (>= 1.21.0) + rbi (>= 0.1.4, < 0.2) + sorbet-static-and-runtime (>= 0.5.11087) + spoom (>= 1.2.0) + thor (>= 1.2.0) + yard-sorbet + thor (1.3.2) tilt (2.4.0) + yard (0.9.37) + yard-sorbet (0.9.0) + sorbet-runtime + yard PLATFORMS + arm64-darwin-23 x86_64-linux DEPENDENCIES @@ -74,6 +108,7 @@ DEPENDENCIES rspec sinatra sinatra-contrib + tapioca (~> 0.15.1) BUNDLED WITH 2.4.7 diff --git a/examples/sinatra-pet-shelter/lib/app.rb b/examples/sinatra-pet-shelter/lib/app.rb index 037b463..c479902 100644 --- a/examples/sinatra-pet-shelter/lib/app.rb +++ b/examples/sinatra-pet-shelter/lib/app.rb @@ -1,21 +1,22 @@ # frozen_string_literal: true -require 'sinatra' -require 'sinatra/multi_route' -require 'resource_registry' +require "sinatra" +require "sinatra/multi_route" +require "resource_registry" -require 'sinatra/reloader' if development? -require 'pry' +require "sinatra/reloader" if development? +require "pry" -require_relative 'repository' +require_relative "repository" -Dir[File.expand_path('lib/resources/*.rb')].each { |f| require_relative(f) } +Dir[File.expand_path("lib/resources/*.rb")].each { |f| require_relative(f) } # Main entrypoint of the application class App < Sinatra::Base register Sinatra::MultiRoute - registry, = ResourceRegistry::Initializer.new(repository_base_klass: Repository).call + registry, = + ResourceRegistry::Initializer.new(repository_base_klass: Repository).call resources = registry.fetch_all resources.each do |id, resource| diff --git a/examples/sinatra-pet-shelter/lib/repository.rb b/examples/sinatra-pet-shelter/lib/repository.rb index 52a88be..5d3a2aa 100644 --- a/examples/sinatra-pet-shelter/lib/repository.rb +++ b/examples/sinatra-pet-shelter/lib/repository.rb @@ -7,6 +7,8 @@ class Repository include ::ResourceRegistry::Repositories::Base extend RuntimeGeneric + Entity = type_member { { upper: T::Struct } } + sig { returns(T.untyped) } def self.entity # Dirty hack to make Tapioca work with `tapioca dsl` command, our @@ -20,6 +22,6 @@ def self.entity # FIXME: Review sig(:final) { returns(String) } def self.namespace - '' + "" end end diff --git a/examples/sinatra-pet-shelter/lib/resources/dogs.rb b/examples/sinatra-pet-shelter/lib/resources/dogs.rb index 4b84c29..c997e0c 100644 --- a/examples/sinatra-pet-shelter/lib/resources/dogs.rb +++ b/examples/sinatra-pet-shelter/lib/resources/dogs.rb @@ -1,6 +1,7 @@ +# typed: strict # frozen_string_literal: true -require_relative '../repository' +require_relative "../repository" class ReadDto < T::Struct const :id, String @@ -16,6 +17,10 @@ class Dogs < Repository Entity = type_member { { fixed: Dog } } # FIXME: Review `context` - sig { override.params(dto: ReadDto, context: T.untyped).returns(T::Array[Dog]) } - def read(dto:, context:); end + sig do + override.params(dto: ReadDto, context: T.untyped).returns(T::Array[Dog]) + end + def read(dto:, context:) + [] + end end diff --git a/examples/sinatra-pet-shelter/sorbet/config b/examples/sinatra-pet-shelter/sorbet/config new file mode 100644 index 0000000..3a0416d --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/config @@ -0,0 +1,4 @@ +--dir +. +--ignore=/tmp/ +--ignore=/vendor/bundle diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/.gitattributes b/examples/sinatra-pet-shelter/sorbet/rbi/gems/.gitattributes new file mode 100644 index 0000000..d9bb82a --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/.gitattributes @@ -0,0 +1 @@ +**/*.rbi linguist-generated=true diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/base64@0.2.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/base64@0.2.0.rbi new file mode 100644 index 0000000..087b64e --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/base64@0.2.0.rbi @@ -0,0 +1,507 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `base64` gem. +# Please instead update this file by running `bin/tapioca gem base64`. + + +# \Module \Base64 provides methods for: +# +# - Encoding a binary string (containing non-ASCII characters) +# as a string of printable ASCII characters. +# - Decoding such an encoded string. +# +# \Base64 is commonly used in contexts where binary data +# is not allowed or supported: +# +# - Images in HTML or CSS files, or in URLs. +# - Email attachments. +# +# A \Base64-encoded string is about one-third larger that its source. +# See the {Wikipedia article}[https://en.wikipedia.org/wiki/Base64] +# for more information. +# +# This module provides three pairs of encode/decode methods. +# Your choices among these methods should depend on: +# +# - Which character set is to be used for encoding and decoding. +# - Whether "padding" is to be used. +# - Whether encoded strings are to contain newlines. +# +# Note: Examples on this page assume that the including program has executed: +# +# require 'base64' +# +# == Encoding Character Sets +# +# A \Base64-encoded string consists only of characters from a 64-character set: +# +# - ('A'..'Z'). +# - ('a'..'z'). +# - ('0'..'9'). +# - =, the 'padding' character. +# - Either: +# - %w[+ /]: +# {RFC-2045-compliant}[https://datatracker.ietf.org/doc/html/rfc2045]; +# _not_ safe for URLs. +# - %w[- _]: +# {RFC-4648-compliant}[https://datatracker.ietf.org/doc/html/rfc4648]; +# safe for URLs. +# +# If you are working with \Base64-encoded strings that will come from +# or be put into URLs, you should choose this encoder-decoder pair +# of RFC-4648-compliant methods: +# +# - Base64.urlsafe_encode64 and Base64.urlsafe_decode64. +# +# Otherwise, you may choose any of the pairs in this module, +# including the pair above, or the RFC-2045-compliant pairs: +# +# - Base64.encode64 and Base64.decode64. +# - Base64.strict_encode64 and Base64.strict_decode64. +# +# == Padding +# +# \Base64-encoding changes a triplet of input bytes +# into a quartet of output characters. +# +# Padding in Encode Methods +# +# Padding -- extending an encoded string with zero, one, or two trailing +# = characters -- is performed by methods Base64.encode64, +# Base64.strict_encode64, and, by default, Base64.urlsafe_encode64: +# +# Base64.encode64('s') # => "cw==\n" +# Base64.strict_encode64('s') # => "cw==" +# Base64.urlsafe_encode64('s') # => "cw==" +# Base64.urlsafe_encode64('s', padding: false) # => "cw" +# +# When padding is performed, the encoded string is always of length 4n, +# where +n+ is a non-negative integer: +# +# - Input bytes of length 3n generate unpadded output characters +# of length 4n: +# +# # n = 1: 3 bytes => 4 characters. +# Base64.strict_encode64('123') # => "MDEy" +# # n = 2: 6 bytes => 8 characters. +# Base64.strict_encode64('123456') # => "MDEyMzQ1" +# +# - Input bytes of length 3n+1 generate padded output characters +# of length 4(n+1), with two padding characters at the end: +# +# # n = 1: 4 bytes => 8 characters. +# Base64.strict_encode64('1234') # => "MDEyMw==" +# # n = 2: 7 bytes => 12 characters. +# Base64.strict_encode64('1234567') # => "MDEyMzQ1Ng==" +# +# - Input bytes of length 3n+2 generate padded output characters +# of length 4(n+1), with one padding character at the end: +# +# # n = 1: 5 bytes => 8 characters. +# Base64.strict_encode64('12345') # => "MDEyMzQ=" +# # n = 2: 8 bytes => 12 characters. +# Base64.strict_encode64('12345678') # => "MDEyMzQ1Njc=" +# +# When padding is suppressed, for a positive integer n: +# +# - Input bytes of length 3n generate unpadded output characters +# of length 4n: +# +# # n = 1: 3 bytes => 4 characters. +# Base64.urlsafe_encode64('123', padding: false) # => "MDEy" +# # n = 2: 6 bytes => 8 characters. +# Base64.urlsafe_encode64('123456', padding: false) # => "MDEyMzQ1" +# +# - Input bytes of length 3n+1 generate unpadded output characters +# of length 4n+2, with two padding characters at the end: +# +# # n = 1: 4 bytes => 6 characters. +# Base64.urlsafe_encode64('1234', padding: false) # => "MDEyMw" +# # n = 2: 7 bytes => 10 characters. +# Base64.urlsafe_encode64('1234567', padding: false) # => "MDEyMzQ1Ng" +# +# - Input bytes of length 3n+2 generate unpadded output characters +# of length 4n+3, with one padding character at the end: +# +# # n = 1: 5 bytes => 7 characters. +# Base64.urlsafe_encode64('12345', padding: false) # => "MDEyMzQ" +# # m = 2: 8 bytes => 11 characters. +# Base64.urlsafe_encode64('12345678', padding: false) # => "MDEyMzQ1Njc" +# +# Padding in Decode Methods +# +# All of the \Base64 decode methods support (but do not require) padding. +# +# \Method Base64.decode64 does not check the size of the padding: +# +# Base64.decode64("MDEyMzQ1Njc") # => "01234567" +# Base64.decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.decode64("MDEyMzQ1Njc==") # => "01234567" +# +# \Method Base64.strict_decode64 strictly enforces padding size: +# +# Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError +# Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError +# +# \Method Base64.urlsafe_decode64 allows padding in +str+, +# which if present, must be correct: +# see {Padding}[Base64.html#module-Base64-label-Padding], above: +# +# Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" +# Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. +# +# == Newlines +# +# An encoded string returned by Base64.encode64 or Base64.urlsafe_encode64 +# has an embedded newline character +# after each 60-character sequence, and, if non-empty, at the end: +# +# # No newline if empty. +# encoded = Base64.encode64("\x00" * 0) +# encoded.index("\n") # => nil +# +# # Newline at end of short output. +# encoded = Base64.encode64("\x00" * 1) +# encoded.size # => 4 +# encoded.index("\n") # => 4 +# +# # Newline at end of longer output. +# encoded = Base64.encode64("\x00" * 45) +# encoded.size # => 60 +# encoded.index("\n") # => 60 +# +# # Newlines embedded and at end of still longer output. +# encoded = Base64.encode64("\x00" * 46) +# encoded.size # => 65 +# encoded.rindex("\n") # => 65 +# encoded.split("\n").map {|s| s.size } # => [60, 4] +# +# The string to be encoded may itself contain newlines, +# which are encoded as \Base64: +# +# # Base64.encode64("\n\n\n") # => "CgoK\n" +# s = "This is line 1\nThis is line 2\n" +# Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" +module Base64 + private + + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +str+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # Base64.decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +str+ are ignored; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.decode64("\x00\n-_") # => "" + # + # Padding in +str+ (even if incorrect) is ignored: + # + # Base64.decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc==") # => "01234567" + # + # source://base64//base64.rb#241 + def decode64(str); end + + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.encode64('*') # => "Kg==\n" + # + # The returned string ends with a newline character, and if sufficiently long + # will have one or more embedded newline characters; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.encode64('*') # => "Kg==\n" + # Base64.encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\nKg==\n" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.encode64("\n\n\n") # => "CgoK\n" + # s = "This is line 1\nThis is line 2\n" + # Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # + # source://base64//base64.rb#219 + def encode64(bin); end + + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +str+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +str+ not allowed; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.strict_decode64("\n") # Raises ArgumentError + # Base64.strict_decode64('-') # Raises ArgumentError + # Base64.strict_decode64('_') # Raises ArgumentError + # + # Padding in +str+, if present, must be correct: + # + # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError + # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError + # + # source://base64//base64.rb#297 + def strict_decode64(str); end + + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.strict_encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.strict_encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.strict_encode64('*') # => "Kg==\n" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.strict_encode64('*') # => "Kg==" + # Base64.strict_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.strict_encode64("\n\n\n") # => "CgoK" + # s = "This is line 1\nThis is line 2\n" + # Base64.strict_encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # + # source://base64//base64.rb#273 + def strict_encode64(bin); end + + # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +str+: + # + # +str+ may not contain non-Base64 characters; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_decode64('+') # Raises ArgumentError. + # Base64.urlsafe_decode64('/') # Raises ArgumentError. + # Base64.urlsafe_decode64("\n") # Raises ArgumentError. + # + # Padding in +str+, if present, must be correct: + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. + # + # source://base64//base64.rb#351 + def urlsafe_decode64(str); end + + # Returns the RFC-4648-compliant \Base64-encoding of +bin+. + # + # Per RFC 4648, the returned string will not contain the URL-unsafe characters + # + or /, + # but instead may contain the URL-safe characters + # - and _; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_encode64("\xFB\xEF\xBE") # => "----" + # Base64.urlsafe_encode64("\xFF\xFF\xFF") # => "____" + # + # By default, the returned string may have padding; + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # + # Optionally, you can suppress padding: + # + # Base64.urlsafe_encode64('*', padding: false) # => "Kg" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # Base64.urlsafe_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # source://base64//base64.rb#328 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + + class << self + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +str+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # Base64.decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +str+ are ignored; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.decode64("\x00\n-_") # => "" + # + # Padding in +str+ (even if incorrect) is ignored: + # + # Base64.decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc==") # => "01234567" + # + # source://base64//base64.rb#241 + def decode64(str); end + + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.encode64('*') # => "Kg==\n" + # + # The returned string ends with a newline character, and if sufficiently long + # will have one or more embedded newline characters; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.encode64('*') # => "Kg==\n" + # Base64.encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\nKg==\n" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.encode64("\n\n\n") # => "CgoK\n" + # s = "This is line 1\nThis is line 2\n" + # Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # + # source://base64//base64.rb#219 + def encode64(bin); end + + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +str+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +str+ not allowed; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.strict_decode64("\n") # Raises ArgumentError + # Base64.strict_decode64('-') # Raises ArgumentError + # Base64.strict_decode64('_') # Raises ArgumentError + # + # Padding in +str+, if present, must be correct: + # + # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError + # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError + # + # source://base64//base64.rb#297 + def strict_decode64(str); end + + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.strict_encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.strict_encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.strict_encode64('*') # => "Kg==\n" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.strict_encode64('*') # => "Kg==" + # Base64.strict_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.strict_encode64("\n\n\n") # => "CgoK" + # s = "This is line 1\nThis is line 2\n" + # Base64.strict_encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # + # source://base64//base64.rb#273 + def strict_encode64(bin); end + + # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +str+: + # + # +str+ may not contain non-Base64 characters; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_decode64('+') # Raises ArgumentError. + # Base64.urlsafe_decode64('/') # Raises ArgumentError. + # Base64.urlsafe_decode64("\n") # Raises ArgumentError. + # + # Padding in +str+, if present, must be correct: + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. + # + # source://base64//base64.rb#351 + def urlsafe_decode64(str); end + + # Returns the RFC-4648-compliant \Base64-encoding of +bin+. + # + # Per RFC 4648, the returned string will not contain the URL-unsafe characters + # + or /, + # but instead may contain the URL-safe characters + # - and _; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_encode64("\xFB\xEF\xBE") # => "----" + # Base64.urlsafe_encode64("\xFF\xFF\xFF") # => "____" + # + # By default, the returned string may have padding; + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # + # Optionally, you can suppress padding: + # + # Base64.urlsafe_encode64('*', padding: false) # => "Kg" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # Base64.urlsafe_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # source://base64//base64.rb#328 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + end +end + +# source://base64//base64.rb#186 +Base64::VERSION = T.let(T.unsafe(nil), String) diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/coderay@1.1.3.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/coderay@1.1.3.rbi new file mode 100644 index 0000000..f095724 --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/coderay@1.1.3.rbi @@ -0,0 +1,3427 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `coderay` gem. +# Please instead update this file by running `bin/tapioca gem coderay`. + + +# = CodeRay Library +# +# CodeRay is a Ruby library for syntax highlighting. +# +# I try to make CodeRay easy to use and intuitive, but at the same time fully +# featured, complete, fast and efficient. +# +# See README. +# +# It consists mainly of +# * the main engine: CodeRay (Scanners::Scanner, Tokens, Encoders::Encoder) +# * the plugin system: PluginHost, Plugin +# * the scanners in CodeRay::Scanners +# * the encoders in CodeRay::Encoders +# * the styles in CodeRay::Styles +# +# Here's a fancy graphic to light up this gray docu: +# +# http://cycnus.de/raindark/coderay/scheme.png +# +# == Documentation +# +# See CodeRay, Encoders, Scanners, Tokens. +# +# == Usage +# +# Remember you need RubyGems to use CodeRay, unless you have it in your load +# path. Run Ruby with -rubygems option if required. +# +# === Highlight Ruby code in a string as html +# +# require 'coderay' +# print CodeRay.scan('puts "Hello, world!"', :ruby).html +# +# # prints something like this: +# puts "Hello, world!" +# +# +# === Highlight C code from a file in a html div +# +# require 'coderay' +# print CodeRay.scan(File.read('ruby.h'), :c).div +# print CodeRay.scan_file('ruby.h').html.div +# +# You can include this div in your page. The used CSS styles can be printed with +# +# % coderay_stylesheet +# +# === Highlight without typing too much +# +# If you are one of the hasty (or lazy, or extremely curious) people, just run this file: +# +# % ruby -rubygems /path/to/coderay/coderay.rb > example.html +# +# and look at the file it created in your browser. +# +# = CodeRay Module +# +# The CodeRay module provides convenience methods for the engine. +# +# * The +lang+ and +format+ arguments select Scanner and Encoder to use. These are +# simply lower-case symbols, like :python or :html. +# * All methods take an optional hash as last parameter, +options+, that is send to +# the Encoder / Scanner. +# * Input and language are always sorted in this order: +code+, +lang+. +# (This is in alphabetical order, if you need a mnemonic ;) +# +# You should be able to highlight everything you want just using these methods; +# so there is no need to dive into CodeRay's deep class hierarchy. +# +# The examples in the demo directory demonstrate common cases using this interface. +# +# = Basic Access Ways +# +# Read this to get a general view what CodeRay provides. +# +# == Scanning +# +# Scanning means analysing an input string, splitting it up into Tokens. +# Each Token knows about what type it is: string, comment, class name, etc. +# +# Each +lang+ (language) has its own Scanner; for example, :ruby code is +# handled by CodeRay::Scanners::Ruby. +# +# CodeRay.scan:: Scan a string in a given language into Tokens. +# This is the most common method to use. +# CodeRay.scan_file:: Scan a file and guess the language using FileType. +# +# The Tokens object you get from these methods can encode itself; see Tokens. +# +# == Encoding +# +# Encoding means compiling Tokens into an output. This can be colored HTML or +# LaTeX, a textual statistic or just the number of non-whitespace tokens. +# +# Each Encoder provides output in a specific +format+, so you select Encoders via +# formats like :html or :statistic. +# +# CodeRay.encode:: Scan and encode a string in a given language. +# CodeRay.encode_tokens:: Encode the given tokens. +# CodeRay.encode_file:: Scan a file, guess the language using FileType and encode it. +# +# == All-in-One Encoding +# +# CodeRay.encode:: Highlight a string with a given input and output format. +# +# == Instanciating +# +# You can use an Encoder instance to highlight multiple inputs. This way, the setup +# for this Encoder must only be done once. +# +# CodeRay.encoder:: Create an Encoder instance with format and options. +# CodeRay.scanner:: Create an Scanner instance for lang, with '' as default code. +# +# To make use of CodeRay.scanner, use CodeRay::Scanner::code=. +# +# The scanning methods provide more flexibility; we recommend to use these. +# +# == Reusing Scanners and Encoders +# +# If you want to re-use scanners and encoders (because that is faster), see +# CodeRay::Duo for the most convenient (and recommended) interface. +# +# source://coderay//lib/coderay.rb#126 +module CodeRay + class << self + # Assuming the path is a subpath of lib/coderay/ + # + # source://coderay//lib/coderay.rb#133 + def coderay_path(*path); end + + # Encode a string. + # + # This scans +code+ with the the Scanner for +lang+ and then + # encodes it with the Encoder for +format+. + # +options+ will be passed to the Encoder. + # + # See CodeRay::Encoder.encode. + # + # source://coderay//lib/coderay.rb#196 + def encode(code, lang, format, options = T.unsafe(nil)); end + + # Encodes +filename+ (a path to a code file) with the Scanner for +lang+. + # + # See CodeRay.scan_file. + # Notice that the second argument is the output +format+, not the input language. + # + # Example: + # require 'coderay' + # page = CodeRay.encode_file 'some_c_code.c', :html + # + # source://coderay//lib/coderay.rb#221 + def encode_file(filename, format, options = T.unsafe(nil)); end + + # Encode pre-scanned Tokens. + # Use this together with CodeRay.scan: + # + # require 'coderay' + # + # # Highlight a short Ruby code example in a HTML span + # tokens = CodeRay.scan '1 + 2', :ruby + # puts CodeRay.encode_tokens(tokens, :span) + # + # source://coderay//lib/coderay.rb#209 + def encode_tokens(tokens, format, options = T.unsafe(nil)); end + + # Finds the Encoder class for +format+ and creates an instance, passing + # +options+ to it. + # + # Example: + # require 'coderay' + # + # stats = CodeRay.encoder(:statistic) + # stats.encode("puts 17 + 4\n", :ruby) + # + # puts '%d out of %d tokens have the kind :integer.' % [ + # stats.type_stats[:integer].count, + # stats.real_token_count + # ] + # #-> 2 out of 4 tokens have the kind :integer. + # + # source://coderay//lib/coderay.rb#260 + def encoder(format, options = T.unsafe(nil)); end + + # Extract the options for the scanner from the +options+ hash. + # + # Returns an empty Hash if :scanner_options is not set. + # + # This is used if a method like CodeRay.encode has to provide options + # for Encoder _and_ scanner. + # + # source://coderay//lib/coderay.rb#278 + def get_scanner_options(options); end + + # Highlight a string into a HTML
. + # + # CSS styles use classes, so you have to include a stylesheet + # in your output. + # + # See encode. + # + # source://coderay//lib/coderay.rb#232 + def highlight(code, lang, options = T.unsafe(nil), format = T.unsafe(nil)); end + + # Highlight a file into a HTML
. + # + # CSS styles use classes, so you have to include a stylesheet + # in your output. + # + # See encode. + # + # source://coderay//lib/coderay.rb#242 + def highlight_file(filename, options = T.unsafe(nil), format = T.unsafe(nil)); end + + # Scans the given +code+ (a String) with the Scanner for +lang+. + # + # This is a simple way to use CodeRay. Example: + # require 'coderay' + # page = CodeRay.scan("puts 'Hello, world!'", :ruby).html + # + # See also demo/demo_simple. + # + # source://coderay//lib/coderay.rb#168 + def scan(code, lang, options = T.unsafe(nil), &block); end + + # Scans +filename+ (a path to a code file) with the Scanner for +lang+. + # + # If +lang+ is :auto or omitted, the CodeRay::FileType module is used to + # determine it. If it cannot find out what type it is, it uses + # CodeRay::Scanners::Text. + # + # Calls CodeRay.scan. + # + # Example: + # require 'coderay' + # page = CodeRay.scan_file('some_c_code.c').html + # + # source://coderay//lib/coderay.rb#183 + def scan_file(filename, lang = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Finds the Scanner class for +lang+ and creates an instance, passing + # +options+ to it. + # + # See Scanner.new. + # + # source://coderay//lib/coderay.rb#268 + def scanner(lang, options = T.unsafe(nil), &block); end + end +end + +# source://coderay//lib/coderay.rb#130 +CodeRay::CODERAY_PATH = T.let(T.unsafe(nil), String) + +# = Duo +# +# A Duo is a convenient way to use CodeRay. You just create a Duo, +# giving it a lang (language of the input code) and a format (desired +# output format), and call Duo#highlight with the code. +# +# Duo makes it easy to re-use both scanner and encoder for a repetitive +# task. It also provides a very easy interface syntax: +# +# require 'coderay' +# CodeRay::Duo[:python, :div].highlight 'import this' +# +# Until you want to do uncommon things with CodeRay, I recommend to use +# this method, since it takes care of everything. +# +# source://coderay//lib/coderay/duo.rb#17 +class CodeRay::Duo + # Create a new Duo, holding a lang and a format to highlight code. + # + # simple: + # CodeRay::Duo[:ruby, :html].highlight 'bla 42' + # + # with options: + # CodeRay::Duo[:ruby, :html, :hint => :debug].highlight '????::??' + # + # alternative syntax without options: + # CodeRay::Duo[:ruby => :statistic].encode 'class << self; end' + # + # alternative syntax with options: + # CodeRay::Duo[{ :ruby => :statistic }, :do => :something].encode 'abc' + # + # The options are forwarded to scanner and encoder + # (see CodeRay.get_scanner_options). + # + # @return [Duo] a new instance of Duo + # + # source://coderay//lib/coderay/duo.rb#37 + def initialize(lang = T.unsafe(nil), format = T.unsafe(nil), options = T.unsafe(nil)); end + + # Tokenize and highlight the code using +scanner+ and +encoder+. + # Allows to use Duo like a proc object: + # + # CodeRay::Duo[:python => :yaml].call(code) + # + # or, in Ruby 1.9 and later: + # + # CodeRay::Duo[:python => :yaml].(code) + # + # source://coderay//lib/coderay/duo.rb#64 + def call(code, options = T.unsafe(nil)); end + + # Tokenize and highlight the code using +scanner+ and +encoder+. + # + # source://coderay//lib/coderay/duo.rb#64 + def encode(code, options = T.unsafe(nil)); end + + # The encoder of the duo. Only created once. + # + # source://coderay//lib/coderay/duo.rb#59 + def encoder; end + + # Returns the value of attribute format. + # + # source://coderay//lib/coderay/duo.rb#19 + def format; end + + # Sets the attribute format + # + # @param value the value to set the attribute format to. + # + # source://coderay//lib/coderay/duo.rb#19 + def format=(_arg0); end + + # Tokenize and highlight the code using +scanner+ and +encoder+. + # + # source://coderay//lib/coderay/duo.rb#64 + def highlight(code, options = T.unsafe(nil)); end + + # Returns the value of attribute lang. + # + # source://coderay//lib/coderay/duo.rb#19 + def lang; end + + # Sets the attribute lang + # + # @param value the value to set the attribute lang to. + # + # source://coderay//lib/coderay/duo.rb#19 + def lang=(_arg0); end + + # Returns the value of attribute options. + # + # source://coderay//lib/coderay/duo.rb#19 + def options; end + + # Sets the attribute options + # + # @param value the value to set the attribute options to. + # + # source://coderay//lib/coderay/duo.rb#19 + def options=(_arg0); end + + # The scanner of the duo. Only created once. + # + # source://coderay//lib/coderay/duo.rb#54 + def scanner; end + + class << self + # To allow calls like Duo[:ruby, :html].highlight. + def [](*_arg0); end + end +end + +# This module holds the Encoder class and its subclasses. +# For example, the HTML encoder is named CodeRay::Encoders::HTML +# can be found in coderay/encoders/html. +# +# Encoders also provides methods and constants for the register +# mechanism and the [] method that returns the Encoder class +# belonging to the given format. +# +# source://coderay//lib/coderay/encoders.rb#10 +module CodeRay::Encoders + extend ::CodeRay::PluginHost +end + +# A simple Filter that removes all tokens of the :comment kind. +# +# Alias: +remove_comments+ +# +# Usage: +# CodeRay.scan('print # foo', :ruby).comment_filter.text +# #-> "print " +# +# See also: TokenKindFilter, LinesOfCode +# +# source://coderay//lib/coderay/encoders/comment_filter.rb#15 +class CodeRay::Encoders::CommentFilter < ::CodeRay::Encoders::TokenKindFilter; end + +# source://coderay//lib/coderay/encoders/comment_filter.rb#19 +CodeRay::Encoders::CommentFilter::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# Returns the number of tokens. +# +# Text and block tokens are counted. +# +# source://coderay//lib/coderay/encoders/count.rb#7 +class CodeRay::Encoders::Count < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/count.rb#29 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/count.rb#29 + def begin_line(kind); end + + # source://coderay//lib/coderay/encoders/count.rb#29 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/count.rb#29 + def end_line(kind); end + + # source://coderay//lib/coderay/encoders/count.rb#25 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/count.rb#19 + def finish(options); end + + # source://coderay//lib/coderay/encoders/count.rb#13 + def setup(options); end +end + +# = Debug Encoder +# +# Fast encoder producing simple debug output. +# +# It is readable and diff-able and is used for testing. +# +# You cannot fully restore the tokens information from the +# output, because consecutive :space tokens are merged. +# +# See also: Scanners::Debug +# +# source://coderay//lib/coderay/encoders/debug.rb#14 +class CodeRay::Encoders::Debug < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/debug.rb#30 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/debug.rb#38 + def begin_line(kind); end + + # source://coderay//lib/coderay/encoders/debug.rb#34 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/debug.rb#42 + def end_line(kind); end + + # source://coderay//lib/coderay/encoders/debug.rb#20 + def text_token(text, kind); end +end + +# source://coderay//lib/coderay/encoders/debug.rb#18 +CodeRay::Encoders::Debug::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# = Debug Lint Encoder +# +# Debug encoder with additional checks for: +# +# - empty tokens +# - incorrect nesting +# +# It will raise an InvalidTokenStream exception when any of the above occurs. +# +# See also: Encoders::Debug +# +# source://coderay//lib/coderay/encoders/debug_lint.rb#16 +class CodeRay::Encoders::DebugLint < ::CodeRay::Encoders::Debug + # source://coderay//lib/coderay/encoders/debug_lint.rb#26 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/debug_lint.rb#37 + def begin_line(kind); end + + # @raise [Lint::IncorrectTokenGroupNesting] + # + # source://coderay//lib/coderay/encoders/debug_lint.rb#31 + def end_group(kind); end + + # @raise [Lint::IncorrectTokenGroupNesting] + # + # source://coderay//lib/coderay/encoders/debug_lint.rb#42 + def end_line(kind); end + + # @raise [Lint::EmptyToken] + # + # source://coderay//lib/coderay/encoders/debug_lint.rb#20 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/debug_lint.rb#55 + def finish(options); end + + # source://coderay//lib/coderay/encoders/debug_lint.rb#50 + def setup(options); end +end + +# Wraps HTML output into a DIV element, using inline styles by default. +# +# See Encoders::HTML for available options. +# +# source://coderay//lib/coderay/encoders/div.rb#9 +class CodeRay::Encoders::Div < ::CodeRay::Encoders::HTML; end + +# source://coderay//lib/coderay/encoders/div.rb#15 +CodeRay::Encoders::Div::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/encoders/div.rb#11 +CodeRay::Encoders::Div::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# = Encoder +# +# The Encoder base class. Together with Scanner and +# Tokens, it forms the highlighting triad. +# +# Encoder instances take a Tokens object and do something with it. +# +# The most common Encoder is surely the HTML encoder +# (CodeRay::Encoders::HTML). It highlights the code in a colorful +# html page. +# If you want the highlighted code in a div or a span instead, +# use its subclasses Div and Span. +# +# source://coderay//lib/coderay/encoders/encoder.rb#16 +class CodeRay::Encoders::Encoder + extend ::CodeRay::Plugin + + # Creates a new Encoder. + # +options+ is saved and used for all encode operations, as long + # as you don't overwrite it there by passing additional options. + # + # Encoder objects provide three encode methods: + # - encode simply takes a +code+ string and a +lang+ + # - encode_tokens expects a +tokens+ object instead + # + # Each method has an optional +options+ parameter. These are + # added to the options you passed at creation. + # + # @return [Encoder] a new instance of Encoder + # + # source://coderay//lib/coderay/encoders/encoder.rb#55 + def initialize(options = T.unsafe(nil)); end + + # source://coderay//lib/coderay/encoders/encoder.rb#87 + def <<(token); end + + # Starts a token group with the given +kind+. + # + # source://coderay//lib/coderay/encoders/encoder.rb#123 + def begin_group(kind); end + + # Starts a new line token group with the given +kind+. + # + # source://coderay//lib/coderay/encoders/encoder.rb#131 + def begin_line(kind); end + + # Encode the given +code+ using the Scanner for +lang+. + # + # source://coderay//lib/coderay/encoders/encoder.rb#70 + def encode(code, lang, options = T.unsafe(nil)); end + + # Encode a Tokens object. + # + # source://coderay//lib/coderay/encoders/encoder.rb#61 + def encode_tokens(tokens, options = T.unsafe(nil)); end + + # Ends a token group with the given +kind+. + # + # source://coderay//lib/coderay/encoders/encoder.rb#127 + def end_group(kind); end + + # Ends a new line token group with the given +kind+. + # + # source://coderay//lib/coderay/encoders/encoder.rb#135 + def end_line(kind); end + + # The default file extension for this encoder. + # + # source://coderay//lib/coderay/encoders/encoder.rb#83 + def file_extension; end + + # Encode the given +code+ using the Scanner for +lang+. + # You can use highlight instead of encode, if that seems + # more clear to you. + # + # source://coderay//lib/coderay/encoders/encoder.rb#70 + def highlight(code, lang, options = T.unsafe(nil)); end + + # The options you gave the Encoder at creating. + # + # source://coderay//lib/coderay/encoders/encoder.rb#43 + def options; end + + # The options you gave the Encoder at creating. + # + # source://coderay//lib/coderay/encoders/encoder.rb#43 + def options=(_arg0); end + + # The options you gave the Encoder at creating. + # + # source://coderay//lib/coderay/encoders/encoder.rb#43 + def scanner; end + + # The options you gave the Encoder at creating. + # + # source://coderay//lib/coderay/encoders/encoder.rb#43 + def scanner=(_arg0); end + + # Called for each text token ([text, kind]), where text is a String. + # + # source://coderay//lib/coderay/encoders/encoder.rb#118 + def text_token(text, kind); end + + # Called with +content+ and +kind+ of the currently scanned token. + # For simple scanners, it's enougth to implement this method. + # + # By default, it calls text_token, begin_group, end_group, begin_line, + # or end_line, depending on the +content+. + # + # source://coderay//lib/coderay/encoders/encoder.rb#100 + def token(content, kind); end + + # Do the encoding. + # + # The already created +tokens+ object must be used; it must be a + # Tokens object. + # + # source://coderay//lib/coderay/encoders/encoder.rb#168 + def tokens(tokens, options = T.unsafe(nil)); end + + protected + + # Do the encoding. + # + # The already created +tokens+ object must be used; it must be a + # Tokens object. + # + # source://coderay//lib/coderay/encoders/encoder.rb#168 + def compile(tokens, options = T.unsafe(nil)); end + + # Called with merged options after encoding starts. + # The return value is the result of encoding, typically @out. + # + # source://coderay//lib/coderay/encoders/encoder.rb#160 + def finish(options); end + + # source://coderay//lib/coderay/encoders/encoder.rb#148 + def get_output(options); end + + # Append data.to_s to the output. Returns the argument. + # + # source://coderay//lib/coderay/encoders/encoder.rb#153 + def output(data); end + + # Called with merged options before encoding starts. + # Sets @out to an empty string. + # + # See the HTML Encoder for an example of option caching. + # + # source://coderay//lib/coderay/encoders/encoder.rb#144 + def setup(options); end + + class << self + # If FILE_EXTENSION isn't defined, this method returns the + # downcase class name instead. + # + # source://coderay//lib/coderay/encoders/encoder.rb#24 + def const_missing(sym); end + + # The default file extension for output file of this encoder class. + # + # source://coderay//lib/coderay/encoders/encoder.rb#33 + def file_extension; end + end +end + +# Subclasses are to store their default options in this constant. +# +# source://coderay//lib/coderay/encoders/encoder.rb#40 +CodeRay::Encoders::Encoder::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/helpers/plugin.rb#41 +CodeRay::Encoders::Encoder::PLUGIN_HOST = CodeRay::Encoders + +# A Filter encoder has another Tokens instance as output. +# It can be subclass to select, remove, or modify tokens in the stream. +# +# Subclasses of Filter are called "Filters" and can be chained. +# +# == Options +# +# === :tokens +# +# The Tokens object which will receive the output. +# +# Default: Tokens.new +# +# See also: TokenKindFilter +# +# source://coderay//lib/coderay/encoders/filter.rb#18 +class CodeRay::Encoders::Filter < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/filter.rb#39 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/filter.rb#43 + def begin_line(kind); end + + # source://coderay//lib/coderay/encoders/filter.rb#47 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/filter.rb#51 + def end_line(kind); end + + # source://coderay//lib/coderay/encoders/filter.rb#35 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/filter.rb#29 + def finish(options); end + + # source://coderay//lib/coderay/encoders/filter.rb#23 + def setup(options); end +end + +# = HTML Encoder +# +# This is CodeRay's most important highlighter: +# It provides save, fast XHTML generation and CSS support. +# +# == Usage +# +# require 'coderay' +# puts CodeRay.scan('Some /code/', :ruby).html #-> a HTML page +# puts CodeRay.scan('Some /code/', :ruby).html(:wrap => :span) +# #-> Some /code/ +# puts CodeRay.scan('Some /code/', :ruby).span #-> the same +# +# puts CodeRay.scan('Some code', :ruby).html( +# :wrap => nil, +# :line_numbers => :inline, +# :css => :style +# ) +# +# == Options +# +# === :tab_width +# Convert \t characters to +n+ spaces (a number or false.) +# false will keep tab characters untouched. +# +# Default: 8 +# +# === :css +# How to include the styles; can be :class or :style. +# +# Default: :class +# +# === :wrap +# Wrap in :page, :div, :span or nil. +# +# You can also use Encoders::Div and Encoders::Span. +# +# Default: nil +# +# === :title +# +# The title of the HTML page (works only when :wrap is set to :page.) +# +# Default: 'CodeRay output' +# +# === :break_lines +# +# Split multiline blocks at line breaks. +# Forced to true if :line_numbers option is set to :inline. +# +# Default: false +# +# === :line_numbers +# Include line numbers in :table, :inline, or nil (no line numbers) +# +# Default: nil +# +# === :line_number_anchors +# Adds anchors and links to the line numbers. Can be false (off), true (on), +# or a prefix string that will be prepended to the anchor name. +# +# The prefix must consist only of letters, digits, and underscores. +# +# Default: true, default prefix name: "line" +# +# === :line_number_start +# Where to start with line number counting. +# +# Default: 1 +# +# === :bold_every +# Make every +n+-th number appear bold. +# +# Default: 10 +# +# === :highlight_lines +# +# Highlights certain line numbers. +# Can be any Enumerable, typically just an Array or Range, of numbers. +# +# Bolding is deactivated when :highlight_lines is set. It only makes sense +# in combination with :line_numbers. +# +# Default: nil +# +# === :hint +# Include some information into the output using the title attribute. +# Can be :info (show token kind on mouse-over), :info_long (with full path) +# or :debug (via inspect). +# +# Default: false +# +# source://coderay//lib/coderay/encoders/html.rb#97 +class CodeRay::Encoders::HTML < ::CodeRay::Encoders::Encoder + # token groups, eg. strings + # + # source://coderay//lib/coderay/encoders/html.rb#235 + def begin_group(kind); end + + # whole lines to be highlighted, eg. a deleted line in a diff + # + # source://coderay//lib/coderay/encoders/html.rb#247 + def begin_line(kind); end + + # Returns the value of attribute css. + # + # source://coderay//lib/coderay/encoders/html.rb#126 + def css; end + + # source://coderay//lib/coderay/encoders/html.rb#241 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/html.rb#261 + def end_line(kind); end + + # source://coderay//lib/coderay/encoders/html.rb#221 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/html.rb#316 + def break_lines(text, style); end + + # source://coderay//lib/coderay/encoders/html.rb#310 + def check_group_nesting(name, kind); end + + # source://coderay//lib/coderay/encoders/html.rb#268 + def check_options!(options); end + + # source://coderay//lib/coderay/encoders/html.rb#324 + def close_span; end + + # source://coderay//lib/coderay/encoders/html.rb#280 + def css_class_for_kinds(kinds); end + + # source://coderay//lib/coderay/encoders/html.rb#195 + def finish(options); end + + # source://coderay//lib/coderay/encoders/html.rb#289 + def make_span_for_kinds(method, hint); end + + # source://coderay//lib/coderay/encoders/html.rb#172 + def setup(options); end + + # source://coderay//lib/coderay/encoders/html.rb#284 + def style_for_kinds(kinds); end + + class << self + # source://coderay//lib/coderay/encoders/html.rb#130 + def make_html_escape_hash; end + + # Generate a hint about the given +kinds+ in a +hint+ style. + # + # +hint+ may be :info, :info_long or :debug. + # + # source://coderay//lib/coderay/encoders/html.rb#157 + def token_path_to_hint(hint, kinds); end + end +end + +# source://coderay//lib/coderay/encoders/html/css.rb#5 +class CodeRay::Encoders::HTML::CSS + # @return [CSS] a new instance of CSS + # + # source://coderay//lib/coderay/encoders/html/css.rb#13 + def initialize(style = T.unsafe(nil)); end + + # source://coderay//lib/coderay/encoders/html/css.rb#23 + def get_style_for_css_classes(css_classes); end + + # Returns the value of attribute stylesheet. + # + # source://coderay//lib/coderay/encoders/html/css.rb#7 + def stylesheet; end + + private + + # source://coderay//lib/coderay/encoders/html/css.rb#49 + def parse(stylesheet); end + + class << self + # source://coderay//lib/coderay/encoders/html/css.rb#9 + def load_stylesheet(style = T.unsafe(nil)); end + end +end + +# source://coderay//lib/coderay/encoders/html/css.rb#36 +CodeRay::Encoders::HTML::CSS::CSS_CLASS_PATTERN = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/encoders/html.rb#103 +CodeRay::Encoders::HTML::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/encoders/html.rb#101 +CodeRay::Encoders::HTML::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# source://coderay//lib/coderay/encoders/html.rb#143 +CodeRay::Encoders::HTML::HTML_ESCAPE = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/encoders/html.rb#144 +CodeRay::Encoders::HTML::HTML_ESCAPE_PATTERN = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/encoders/html/numbering.rb#6 +module CodeRay::Encoders::HTML::Numbering + class << self + # source://coderay//lib/coderay/encoders/html/numbering.rb#8 + def number!(output, mode = T.unsafe(nil), options = T.unsafe(nil)); end + end +end + +# This module is included in the output String of the HTML Encoder. +# +# It provides methods like wrap, div, page etc. +# +# Remember to use #clone instead of #dup to keep the modules the object was +# extended with. +# +# TODO: Rewrite this without monkey patching. +# +# source://coderay//lib/coderay/encoders/html/output.rb#14 +module CodeRay::Encoders::HTML::Output + # source://coderay//lib/coderay/encoders/html/output.rb#57 + def apply_title!(title); end + + # Returns the value of attribute css. + # + # source://coderay//lib/coderay/encoders/html/output.rb#16 + def css; end + + # Sets the attribute css + # + # @param value the value to set the attribute css to. + # + # source://coderay//lib/coderay/encoders/html/output.rb#16 + def css=(_arg0); end + + # source://coderay//lib/coderay/encoders/html/output.rb#86 + def stylesheet(in_tag = T.unsafe(nil)); end + + # source://coderay//lib/coderay/encoders/html/output.rb#62 + def wrap!(element, *args); end + + # source://coderay//lib/coderay/encoders/html/output.rb#52 + def wrap_in!(template); end + + # source://coderay//lib/coderay/encoders/html/output.rb#47 + def wrapped_in; end + + # Sets the attribute wrapped_in + # + # @param value the value to set the attribute wrapped_in to. + # + # source://coderay//lib/coderay/encoders/html/output.rb#50 + def wrapped_in=(_arg0); end + + # @return [Boolean] + # + # source://coderay//lib/coderay/encoders/html/output.rb#43 + def wrapped_in?(element); end + + class << self + # Raises an exception if an object that doesn't respond to to_str is extended by Output, + # to prevent users from misuse. Use Module#remove_method to disable. + # + # source://coderay//lib/coderay/encoders/html/output.rb#22 + def extended(o); end + + # source://coderay//lib/coderay/encoders/html/output.rb#26 + def make_stylesheet(css, in_tag = T.unsafe(nil)); end + + # source://coderay//lib/coderay/encoders/html/output.rb#36 + def page_template_for_css(css); end + end +end + +# source://coderay//lib/coderay/encoders/html/output.rb#117 +CodeRay::Encoders::HTML::Output::DIV = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template) + +# source://coderay//lib/coderay/encoders/html/output.rb#130 +CodeRay::Encoders::HTML::Output::PAGE = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template) + +# source://coderay//lib/coderay/encoders/html/output.rb#115 +CodeRay::Encoders::HTML::Output::SPAN = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template) + +# source://coderay//lib/coderay/encoders/html/output.rb#123 +CodeRay::Encoders::HTML::Output::TABLE = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template) + +# -- don't include the templates in docu +# +# source://coderay//lib/coderay/encoders/html/output.rb#92 +class CodeRay::Encoders::HTML::Output::Template < ::String + # source://coderay//lib/coderay/encoders/html/output.rb#104 + def apply(target, replacement); end + + class << self + # source://coderay//lib/coderay/encoders/html/output.rb#94 + def wrap!(str, template, target); end + end +end + +# source://coderay//lib/coderay/encoders/html.rb#146 +CodeRay::Encoders::HTML::TOKEN_KIND_TO_INFO = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/encoders/html.rb#150 +CodeRay::Encoders::HTML::TRANSPARENT_TOKEN_KINDS = T.let(T.unsafe(nil), Set) + +# A simple JSON Encoder. +# +# Example: +# CodeRay.scan('puts "Hello world!"', :ruby).json +# yields +# [ +# {"type"=>"text", "text"=>"puts", "kind"=>"ident"}, +# {"type"=>"text", "text"=>" ", "kind"=>"space"}, +# {"type"=>"block", "action"=>"open", "kind"=>"string"}, +# {"type"=>"text", "text"=>"\"", "kind"=>"delimiter"}, +# {"type"=>"text", "text"=>"Hello world!", "kind"=>"content"}, +# {"type"=>"text", "text"=>"\"", "kind"=>"delimiter"}, +# {"type"=>"block", "action"=>"close", "kind"=>"string"}, +# ] +# +# source://coderay//lib/coderay/encoders/json.rb#18 +class CodeRay::Encoders::JSON < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/json.rb#64 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/json.rb#72 + def begin_line(kind); end + + # source://coderay//lib/coderay/encoders/json.rb#68 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/json.rb#76 + def end_line(kind); end + + # source://coderay//lib/coderay/encoders/json.rb#60 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/json.rb#49 + def append(data); end + + # source://coderay//lib/coderay/encoders/json.rb#45 + def finish(options); end + + # source://coderay//lib/coderay/encoders/json.rb#38 + def setup(options); end +end + +# source://coderay//lib/coderay/encoders/json.rb#35 +CodeRay::Encoders::JSON::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# Counts the LoC (Lines of Code). Returns an Integer >= 0. +# +# Alias: +loc+ +# +# Everything that is not comment, markup, doctype/shebang, or an empty line, +# is considered to be code. +# +# For example, +# * HTML files not containing JavaScript have 0 LoC +# * in a Java class without comments, LoC is the number of non-empty lines +# +# A Scanner class should define the token kinds that are not code in the +# KINDS_NOT_LOC constant, which defaults to [:comment, :doctype]. +# +# source://coderay//lib/coderay/encoders/lines_of_code.rb#17 +class CodeRay::Encoders::LinesOfCode < ::CodeRay::Encoders::TokenKindFilter + protected + + # source://coderay//lib/coderay/encoders/lines_of_code.rb#38 + def finish(options); end + + # source://coderay//lib/coderay/encoders/lines_of_code.rb#25 + def setup(options); end +end + +# source://coderay//lib/coderay/encoders/lines_of_code.rb#21 +CodeRay::Encoders::LinesOfCode::NON_EMPTY_LINE = T.let(T.unsafe(nil), Regexp) + +# = Lint Encoder +# +# Checks for: +# +# - empty tokens +# - incorrect nesting +# +# It will raise an InvalidTokenStream exception when any of the above occurs. +# +# See also: Encoders::DebugLint +# +# source://coderay//lib/coderay/encoders/lint.rb#14 +class CodeRay::Encoders::Lint < ::CodeRay::Encoders::Debug + # source://coderay//lib/coderay/encoders/lint.rb#28 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/lint.rb#37 + def begin_line(kind); end + + # @raise [IncorrectTokenGroupNesting] + # + # source://coderay//lib/coderay/encoders/lint.rb#32 + def end_group(kind); end + + # @raise [IncorrectTokenGroupNesting] + # + # source://coderay//lib/coderay/encoders/lint.rb#41 + def end_line(kind); end + + # @raise [EmptyToken] + # + # source://coderay//lib/coderay/encoders/lint.rb#23 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/lint.rb#52 + def finish(options); end + + # source://coderay//lib/coderay/encoders/lint.rb#48 + def setup(options); end +end + +# source://coderay//lib/coderay/encoders/lint.rb#19 +class CodeRay::Encoders::Lint::EmptyToken < ::CodeRay::Encoders::Lint::InvalidTokenStream; end + +# source://coderay//lib/coderay/encoders/lint.rb#21 +class CodeRay::Encoders::Lint::IncorrectTokenGroupNesting < ::CodeRay::Encoders::Lint::InvalidTokenStream; end + +# source://coderay//lib/coderay/encoders/lint.rb#18 +class CodeRay::Encoders::Lint::InvalidTokenStream < ::StandardError; end + +# source://coderay//lib/coderay/encoders/lint.rb#20 +class CodeRay::Encoders::Lint::UnknownTokenKind < ::CodeRay::Encoders::Lint::InvalidTokenStream; end + +# = Null Encoder +# +# Does nothing and returns an empty string. +# +# source://coderay//lib/coderay/encoders/null.rb#7 +class CodeRay::Encoders::Null < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/null.rb#11 + def text_token(text, kind); end +end + +# Wraps the output into a HTML page, using CSS classes and +# line numbers in the table format by default. +# +# See Encoders::HTML for available options. +# +# source://coderay//lib/coderay/encoders/page.rb#10 +class CodeRay::Encoders::Page < ::CodeRay::Encoders::HTML; end + +# source://coderay//lib/coderay/encoders/page.rb#16 +CodeRay::Encoders::Page::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/encoders/page.rb#12 +CodeRay::Encoders::Page::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# Wraps HTML output into a SPAN element, using inline styles by default. +# +# See Encoders::HTML for available options. +# +# source://coderay//lib/coderay/encoders/span.rb#9 +class CodeRay::Encoders::Span < ::CodeRay::Encoders::HTML; end + +# source://coderay//lib/coderay/encoders/span.rb#15 +CodeRay::Encoders::Span::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/encoders/span.rb#11 +CodeRay::Encoders::Span::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# Makes a statistic for the given tokens. +# +# Alias: +stats+ +# +# source://coderay//lib/coderay/encoders/statistic.rb#7 +class CodeRay::Encoders::Statistic < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/statistic.rb#70 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/statistic.rb#78 + def begin_line(kind); end + + # source://coderay//lib/coderay/encoders/statistic.rb#86 + def block_token(action, kind); end + + # source://coderay//lib/coderay/encoders/statistic.rb#74 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/statistic.rb#82 + def end_line(kind); end + + # source://coderay//lib/coderay/encoders/statistic.rb#11 + def real_token_count; end + + # source://coderay//lib/coderay/encoders/statistic.rb#62 + def text_token(text, kind); end + + # source://coderay//lib/coderay/encoders/statistic.rb#11 + def type_stats; end + + protected + + # source://coderay//lib/coderay/encoders/statistic.rb#42 + def finish(options); end + + # source://coderay//lib/coderay/encoders/statistic.rb#17 + def setup(options); end +end + +# source://coderay//lib/coderay/encoders/statistic.rb#24 +CodeRay::Encoders::Statistic::STATS = T.let(T.unsafe(nil), String) + +# source://coderay//lib/coderay/encoders/statistic.rb#38 +CodeRay::Encoders::Statistic::TOKEN_TYPES_ROW = T.let(T.unsafe(nil), String) + +# source://coderay//lib/coderay/encoders/statistic.rb#13 +class CodeRay::Encoders::Statistic::TypeStats < ::Struct + # Returns the value of attribute count + # + # @return [Object] the current value of count + def count; end + + # Sets the attribute count + # + # @param value [Object] the value to set the attribute count to. + # @return [Object] the newly set value + def count=(_); end + + # Returns the value of attribute size + # + # @return [Object] the current value of size + def size; end + + # Sets the attribute size + # + # @param value [Object] the value to set the attribute size to. + # @return [Object] the newly set value + def size=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# source://coderay//lib/coderay/encoders/terminal.rb#17 +class CodeRay::Encoders::Terminal < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/terminal.rb#156 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/terminal.rb#156 + def begin_line(kind); end + + # source://coderay//lib/coderay/encoders/terminal.rb#162 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/terminal.rb#172 + def end_line(kind); end + + # source://coderay//lib/coderay/encoders/terminal.rb#141 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/terminal.rb#133 + def setup(options); end + + private + + # source://coderay//lib/coderay/encoders/terminal.rb#179 + def open_token(kind); end +end + +# source://coderay//lib/coderay/encoders/terminal.rb#21 +CodeRay::Encoders::Terminal::TOKEN_COLORS = T.let(T.unsafe(nil), Hash) + +# Concats the tokens into a single string, resulting in the original +# code string if no tokens were removed. +# +# Alias: +plain+, +plaintext+ +# +# == Options +# +# === :separator +# A separator string to join the tokens. +# +# Default: empty String +# +# source://coderay//lib/coderay/encoders/text.rb#15 +class CodeRay::Encoders::Text < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/text.rb#25 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/text.rb#36 + def setup(options); end +end + +# source://coderay//lib/coderay/encoders/text.rb#21 +CodeRay::Encoders::Text::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/encoders/text.rb#19 +CodeRay::Encoders::Text::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# A Filter that selects tokens based on their token kind. +# +# == Options +# +# === :exclude +# +# One or many symbols (in an Array) which shall be excluded. +# +# Default: [] +# +# === :include +# +# One or many symbols (in an array) which shall be included. +# +# Default: :all, which means all tokens are included. +# +# Exclusion wins over inclusion. +# +# See also: CommentFilter +# +# source://coderay//lib/coderay/encoders/token_kind_filter.rb#25 +class CodeRay::Encoders::TokenKindFilter < ::CodeRay::Encoders::Filter + # Add the token group to the output stream if +kind+ matches the + # conditions. + # + # If it does not, all tokens inside the group are excluded from the + # stream, even if their kinds match. + # + # source://coderay//lib/coderay/encoders/token_kind_filter.rb#66 + def begin_group(kind); end + + # See +begin_group+. + # + # source://coderay//lib/coderay/encoders/token_kind_filter.rb#77 + def begin_line(kind); end + + # Take care of re-enabling the delegation of tokens to the output stream + # if an exluded group has ended. + # + # source://coderay//lib/coderay/encoders/token_kind_filter.rb#89 + def end_group(kind); end + + # See +end_group+. + # + # source://coderay//lib/coderay/encoders/token_kind_filter.rb#99 + def end_line(kind); end + + # Add the token to the output stream if +kind+ matches the conditions. + # + # source://coderay//lib/coderay/encoders/token_kind_filter.rb#57 + def text_token(text, kind); end + + protected + + # @return [Boolean] + # + # source://coderay//lib/coderay/encoders/token_kind_filter.rb#49 + def include_group?(kind); end + + # @return [Boolean] + # + # source://coderay//lib/coderay/encoders/token_kind_filter.rb#45 + def include_text_token?(text, kind); end + + # source://coderay//lib/coderay/encoders/token_kind_filter.rb#35 + def setup(options); end +end + +# source://coderay//lib/coderay/encoders/token_kind_filter.rb#29 +CodeRay::Encoders::TokenKindFilter::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# = XML Encoder +# +# Uses REXML. Very slow. +# +# source://coderay//lib/coderay/encoders/xml.rb#7 +class CodeRay::Encoders::XML < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/xml.rb#58 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/xml.rb#62 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/xml.rb#38 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/xml.rb#31 + def finish(options); end + + # source://coderay//lib/coderay/encoders/xml.rb#22 + def setup(options); end +end + +# source://coderay//lib/coderay/encoders/xml.rb#15 +CodeRay::Encoders::XML::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/encoders/xml.rb#11 +CodeRay::Encoders::XML::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# = YAML Encoder +# +# Slow. +# +# source://coderay//lib/coderay/encoders/yaml.rb#9 +class CodeRay::Encoders::YAML < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/yaml.rb#31 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/yaml.rb#39 + def begin_line(kind); end + + # source://coderay//lib/coderay/encoders/yaml.rb#35 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/yaml.rb#43 + def end_line(kind); end + + # source://coderay//lib/coderay/encoders/yaml.rb#27 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/yaml.rb#22 + def finish(options); end + + # source://coderay//lib/coderay/encoders/yaml.rb#16 + def setup(options); end +end + +# source://coderay//lib/coderay/encoders/yaml.rb#13 +CodeRay::Encoders::YAML::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# = FileType +# +# A simple filetype recognizer. +# +# == Usage +# +# # determine the type of the given +# lang = FileType[file_name] +# +# # return :text if the file type is unknown +# lang = FileType.fetch file_name, :text +# +# # try the shebang line, too +# lang = FileType.fetch file_name, :text, true +# +# source://coderay//lib/coderay/helpers/file_type.rb#17 +module CodeRay::FileType + class << self + # Try to determine the file type of the file. + # + # +filename+ is a relative or absolute path to a file. + # + # The file itself is only accessed when +read_shebang+ is set to true. + # That means you can get filetypes from files that don't exist. + # + # source://coderay//lib/coderay/helpers/file_type.rb#29 + def [](filename, read_shebang = T.unsafe(nil)); end + + # This works like Hash#fetch. + # + # If the filetype cannot be found, the +default+ value + # is returned. + # + # source://coderay//lib/coderay/helpers/file_type.rb#50 + def fetch(filename, default = T.unsafe(nil), read_shebang = T.unsafe(nil)); end + + protected + + # source://coderay//lib/coderay/helpers/file_type.rb#66 + def type_from_shebang(filename); end + end +end + +# source://coderay//lib/coderay/helpers/file_type.rb#79 +CodeRay::FileType::TypeFromExt = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/helpers/file_type.rb#139 +CodeRay::FileType::TypeFromName = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/helpers/file_type.rb#137 +CodeRay::FileType::TypeFromShebang = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/helpers/file_type.rb#19 +class CodeRay::FileType::UnknownFileType < ::Exception; end + +# = Plugin +# +# Plugins have to include this module. +# +# IMPORTANT: Use extend for this module. +# +# See CodeRay::PluginHost for examples. +# +# source://coderay//lib/coderay/helpers/plugin.rb#10 +module CodeRay::Plugin + # source://coderay//lib/coderay/helpers/plugin.rb#46 + def aliases; end + + # The PluginHost for this Plugin class. + # + # source://coderay//lib/coderay/helpers/plugin.rb#39 + def plugin_host(host = T.unsafe(nil)); end + + # Returns the value of attribute plugin_id. + # + # source://coderay//lib/coderay/helpers/plugin.rb#12 + def plugin_id; end + + # Register this class for the given +id+. + # + # Example: + # class MyPlugin < PluginHost::BaseClass + # register_for :my_id + # ... + # end + # + # See PluginHost.register. + # + # source://coderay//lib/coderay/helpers/plugin.rb#23 + def register_for(id); end + + # Returns the title of the plugin, or sets it to the + # optional argument +title+. + # + # source://coderay//lib/coderay/helpers/plugin.rb#30 + def title(title = T.unsafe(nil)); end +end + +# = PluginHost +# +# A simple subclass/subfolder plugin system. +# +# Example: +# class Generators +# extend PluginHost +# plugin_path 'app/generators' +# end +# +# class Generator +# extend Plugin +# PLUGIN_HOST = Generators +# end +# +# class FancyGenerator < Generator +# register_for :fancy +# end +# +# Generators[:fancy] #-> FancyGenerator +# # or +# CodeRay.require_plugin 'Generators/fancy' +# # or +# Generators::Fancy +# +# source://coderay//lib/coderay/helpers/plugin_host.rb#27 +module CodeRay::PluginHost + # Returns the Plugin for +id+. + # + # Example: + # yaml_plugin = MyPluginHost[:yaml] + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#49 + def [](id, *args, &blk); end + + # Returns an array of all Plugins. + # + # Note: This loads all plugins using load_all. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#151 + def all_plugins; end + + # Tries to +load+ the missing plugin by translating +const+ to the + # underscore form (eg. LinesOfCode becomes lines_of_code). + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#61 + def const_missing(const); end + + # Define the default plugin to use when no plugin is found + # for a given id, or return the default plugin. + # + # See also map. + # + # class MyColorHost < PluginHost + # map :navy => :dark_blue + # default :gray + # end + # + # MyColorHost.default # loads and returns the Gray plugin + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#114 + def default(id = T.unsafe(nil)); end + + # Returns an array of all .rb files in the plugin path. + # + # The extension .rb is not included. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#140 + def list; end + + # Returns the Plugin for +id+. + # + # Example: + # yaml_plugin = MyPluginHost[:yaml] + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#49 + def load(id, *args, &blk); end + + # Loads all plugins using list and load. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#39 + def load_all; end + + # Loads the map file (see map). + # + # This is done automatically when plugin_path is called. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#159 + def load_plugin_map; end + + # Map a plugin_id to another. + # + # Usage: Put this in a file plugin_path/_map.rb. + # + # class MyColorHost < PluginHost + # map :navy => :dark_blue, + # :maroon => :brown, + # :luna => :moon + # end + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#95 + def map(hash); end + + # A Hash of plugion_id => Plugin pairs. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#133 + def plugin_hash; end + + # The path where the plugins can be found. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#79 + def plugin_path(*args); end + + # Every plugin must register itself for +id+ by calling register_for, + # which calls this method. + # + # See Plugin#register_for. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#128 + def register(plugin, id); end + + protected + + # Return a plugin hash that automatically loads plugins. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#172 + def make_plugin_hash; end + + # Returns the expected path to the plugin file for the given id. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#196 + def path_to(plugin_id); end + + # Converts +id+ to a valid plugin ID String, or returns +nil+. + # + # Raises +ArgumentError+ for all other objects, or if the + # given String includes non-alphanumeric characters (\W). + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#204 + def validate_id(id); end + + class << self + # Adds the module/class to the PLUGIN_HOSTS list. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#72 + def extended(mod); end + end +end + +# source://coderay//lib/coderay/helpers/plugin_host.rb#33 +class CodeRay::PluginHost::HostNotFound < ::LoadError; end + +# source://coderay//lib/coderay/helpers/plugin_host.rb#35 +CodeRay::PluginHost::PLUGIN_HOSTS = T.let(T.unsafe(nil), Array) + +# dummy hash +# +# source://coderay//lib/coderay/helpers/plugin_host.rb#36 +CodeRay::PluginHost::PLUGIN_HOSTS_BY_ID = T.let(T.unsafe(nil), Hash) + +# Raised if Encoders::[] fails because: +# * a file could not be found +# * the requested Plugin is not registered +# +# source://coderay//lib/coderay/helpers/plugin_host.rb#32 +class CodeRay::PluginHost::PluginNotFound < ::LoadError; end + +# = Scanners +# +# This module holds the Scanner class and its subclasses. +# For example, the Ruby scanner is named CodeRay::Scanners::Ruby +# can be found in coderay/scanners/ruby. +# +# Scanner also provides methods and constants for the register +# mechanism and the [] method that returns the Scanner class +# belonging to the given lang. +# +# See PluginHost. +# +# source://coderay//lib/coderay/scanners.rb#18 +module CodeRay::Scanners + extend ::CodeRay::PluginHost +end + +# Scanner for C. +# +# source://coderay//lib/coderay/scanners/c.rb#5 +class CodeRay::Scanners::C < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/c.rb#44 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/c.rb#27 +CodeRay::Scanners::C::DIRECTIVES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/c.rb#39 +CodeRay::Scanners::C::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/c.rb#33 +CodeRay::Scanners::C::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/c.rb#10 +CodeRay::Scanners::C::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/c.rb#23 +CodeRay::Scanners::C::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/c.rb#17 +CodeRay::Scanners::C::PREDEFINED_TYPES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/c.rb#40 +CodeRay::Scanners::C::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Scanner for C++. +# +# Aliases: +cplusplus+, c++ +CodeRay::Scanners::CPlusPlus = CodeRay::Scanners::Text + +# source://coderay//lib/coderay/scanners/css.rb#4 +class CodeRay::Scanners::CSS < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/css.rb#55 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/css.rb#50 + def setup; end +end + +# source://coderay//lib/coderay/scanners/css.rb#8 +CodeRay::Scanners::CSS::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/css.rb#16 +module CodeRay::Scanners::CSS::RE; end + +# source://coderay//lib/coderay/scanners/css.rb#31 +CodeRay::Scanners::CSS::RE::AtKeyword = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#45 +CodeRay::Scanners::CSS::RE::AttributeSelector = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#43 +CodeRay::Scanners::CSS::RE::Class = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#38 +CodeRay::Scanners::CSS::RE::Dimension = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#19 +CodeRay::Scanners::CSS::RE::Escape = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#40 +CodeRay::Scanners::CSS::RE::Function = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#17 +CodeRay::Scanners::CSS::RE::Hex = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#26 +CodeRay::Scanners::CSS::RE::HexColor = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#42 +CodeRay::Scanners::CSS::RE::Id = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#30 +CodeRay::Scanners::CSS::RE::Ident = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#20 +CodeRay::Scanners::CSS::RE::NMChar = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#21 +CodeRay::Scanners::CSS::RE::NMStart = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#29 +CodeRay::Scanners::CSS::RE::Name = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#28 +CodeRay::Scanners::CSS::RE::Num = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#32 +CodeRay::Scanners::CSS::RE::Percentage = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#44 +CodeRay::Scanners::CSS::RE::PseudoClass = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#24 +CodeRay::Scanners::CSS::RE::String = T.let(T.unsafe(nil), Regexp) + +# TODO: buggy regexp +# +# source://coderay//lib/coderay/scanners/css.rb#22 +CodeRay::Scanners::CSS::RE::String1 = T.let(T.unsafe(nil), Regexp) + +# TODO: buggy regexp +# +# source://coderay//lib/coderay/scanners/css.rb#23 +CodeRay::Scanners::CSS::RE::String2 = T.let(T.unsafe(nil), Regexp) + +# differs from standard because it allows uppercase hex too +# +# source://coderay//lib/coderay/scanners/css.rb#18 +CodeRay::Scanners::CSS::RE::Unicode = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#36 +CodeRay::Scanners::CSS::RE::Unit = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#6 +class CodeRay::Scanners::Clojure < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/clojure.rb#145 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/clojure.rb#95 +CodeRay::Scanners::Clojure::BASIC_IDENTIFIER = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#133 +CodeRay::Scanners::Clojure::COMPLEX10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#134 +CodeRay::Scanners::Clojure::COMPLEX16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#136 +CodeRay::Scanners::Clojure::COMPLEX2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#135 +CodeRay::Scanners::Clojure::COMPLEX8 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#16 +CodeRay::Scanners::Clojure::CORE_FORMS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/clojure.rb#120 +CodeRay::Scanners::Clojure::DECIMAL = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#98 +CodeRay::Scanners::Clojure::DIGIT = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#99 +CodeRay::Scanners::Clojure::DIGIT10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#100 +CodeRay::Scanners::Clojure::DIGIT16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#102 +CodeRay::Scanners::Clojure::DIGIT2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#101 +CodeRay::Scanners::Clojure::DIGIT8 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#107 +CodeRay::Scanners::Clojure::EXACTNESS = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#110 +CodeRay::Scanners::Clojure::EXP = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#109 +CodeRay::Scanners::Clojure::EXP_MARK = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#96 +CodeRay::Scanners::Clojure::IDENTIFIER = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#85 +CodeRay::Scanners::Clojure::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/clojure.rb#129 +CodeRay::Scanners::Clojure::IMAG10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#130 +CodeRay::Scanners::Clojure::IMAG16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#132 +CodeRay::Scanners::Clojure::IMAG2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#131 +CodeRay::Scanners::Clojure::IMAG8 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#90 +CodeRay::Scanners::Clojure::KEYWORD_NEXT_TOKEN_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/clojure.rb#141 +CodeRay::Scanners::Clojure::NUM = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#137 +CodeRay::Scanners::Clojure::NUM10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#138 +CodeRay::Scanners::Clojure::NUM16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#140 +CodeRay::Scanners::Clojure::NUM2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#139 +CodeRay::Scanners::Clojure::NUM8 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#78 +CodeRay::Scanners::Clojure::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/clojure.rb#112 +CodeRay::Scanners::Clojure::PREFIX10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#113 +CodeRay::Scanners::Clojure::PREFIX16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#115 +CodeRay::Scanners::Clojure::PREFIX2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#114 +CodeRay::Scanners::Clojure::PREFIX8 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#106 +CodeRay::Scanners::Clojure::RADIX10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#103 +CodeRay::Scanners::Clojure::RADIX16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#105 +CodeRay::Scanners::Clojure::RADIX2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#104 +CodeRay::Scanners::Clojure::RADIX8 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#125 +CodeRay::Scanners::Clojure::REAL10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#126 +CodeRay::Scanners::Clojure::REAL16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#128 +CodeRay::Scanners::Clojure::REAL2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#127 +CodeRay::Scanners::Clojure::REAL8 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#108 +CodeRay::Scanners::Clojure::SIGN = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#11 +CodeRay::Scanners::Clojure::SPECIAL_FORMS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/clojure.rb#111 +CodeRay::Scanners::Clojure::SUFFIX = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#97 +CodeRay::Scanners::Clojure::SYMBOL = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#116 +CodeRay::Scanners::Clojure::UINT10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#117 +CodeRay::Scanners::Clojure::UINT16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#119 +CodeRay::Scanners::Clojure::UINT2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#118 +CodeRay::Scanners::Clojure::UINT8 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#121 +CodeRay::Scanners::Clojure::UREAL10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#122 +CodeRay::Scanners::Clojure::UREAL16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#124 +CodeRay::Scanners::Clojure::UREAL2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#123 +CodeRay::Scanners::Clojure::UREAL8 = T.let(T.unsafe(nil), Regexp) + +# = Debug Scanner +# +# Interprets the output of the Encoders::Debug encoder (basically the inverse function). +# +# source://coderay//lib/coderay/scanners/debug.rb#9 +class CodeRay::Scanners::Debug < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/debug.rb#21 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/debug.rb#16 + def setup; end +end + +# Scanner for the Delphi language (Object Pascal). +# +# Alias: +pascal+ +# +# source://coderay//lib/coderay/scanners/delphi.rb#7 +class CodeRay::Scanners::Delphi < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/delphi.rb#45 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/delphi.rb#25 +CodeRay::Scanners::Delphi::DIRECTIVES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/delphi.rb#36 +CodeRay::Scanners::Delphi::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring) + +# source://coderay//lib/coderay/scanners/delphi.rb#12 +CodeRay::Scanners::Delphi::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/delphi.rb#40 +CodeRay::Scanners::Delphi::NAME_FOLLOWS = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring) + +# Scanner for output of the diff command. +# +# Alias: +patch+ +# +# source://coderay//lib/coderay/scanners/diff.rb#7 +class CodeRay::Scanners::Diff < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/diff.rb#19 + def scan_tokens(encoder, options); end + + private + + # source://coderay//lib/coderay/scanners/diff.rb#204 + def diff(a, b); end +end + +# source://coderay//lib/coderay/scanners/diff.rb#12 +CodeRay::Scanners::Diff::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# Scanner for HTML ERB templates. +# +# source://coderay//lib/coderay/scanners/erb.rb#8 +class CodeRay::Scanners::ERB < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/erb.rb#38 + def reset_instance; end + + # source://coderay//lib/coderay/scanners/erb.rb#43 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/erb.rb#33 + def setup; end +end + +# source://coderay//lib/coderay/scanners/erb.rb#15 +CodeRay::Scanners::ERB::ERB_RUBY_BLOCK = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/erb.rb#13 +CodeRay::Scanners::ERB::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/erb.rb#27 +CodeRay::Scanners::ERB::START_OF_ERB = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/go.rb#4 +class CodeRay::Scanners::Go < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/go.rb#50 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/go.rb#45 +CodeRay::Scanners::Go::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/go.rb#39 +CodeRay::Scanners::Go::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# http://golang.org/ref/spec#Keywords +# +# source://coderay//lib/coderay/scanners/go.rb#10 +CodeRay::Scanners::Go::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/go.rb#29 +CodeRay::Scanners::Go::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/go.rb#34 +CodeRay::Scanners::Go::PREDEFINED_FUNCTIONS = T.let(T.unsafe(nil), Array) + +# http://golang.org/ref/spec#Types +# +# source://coderay//lib/coderay/scanners/go.rb#19 +CodeRay::Scanners::Go::PREDEFINED_TYPES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/go.rb#46 +CodeRay::Scanners::Go::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Scanner for Groovy. +# +# source://coderay//lib/coderay/scanners/groovy.rb#7 +class CodeRay::Scanners::Groovy < ::CodeRay::Scanners::Java + protected + + # source://coderay//lib/coderay/scanners/groovy.rb#43 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/groovy.rb#39 + def setup; end +end + +# source://coderay//lib/coderay/scanners/groovy.rb#24 +CodeRay::Scanners::Groovy::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# TODO: check list of keywords +# +# source://coderay//lib/coderay/scanners/groovy.rb#12 +CodeRay::Scanners::Groovy::GROOVY_KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/groovy.rb#18 +CodeRay::Scanners::Groovy::GROOVY_MAGIC_VARIABLES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/groovy.rb#20 +CodeRay::Scanners::Groovy::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/groovy.rb#15 +CodeRay::Scanners::Groovy::KEYWORDS_EXPECTING_VALUE = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/groovy.rb#26 +CodeRay::Scanners::Groovy::REGEXP_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# TODO: interpretation inside ', ", / +# +# source://coderay//lib/coderay/scanners/groovy.rb#29 +CodeRay::Scanners::Groovy::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/groovy.rb#25 +CodeRay::Scanners::Groovy::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/haml.rb#8 +class CodeRay::Scanners::HAML < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/haml.rb#24 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/haml.rb#17 + def setup; end +end + +# source://coderay//lib/coderay/scanners/haml.rb#13 +CodeRay::Scanners::HAML::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# HTML Scanner +# +# Alias: +xhtml+ +# +# See also: Scanners::XML +# +# source://coderay//lib/coderay/scanners/html.rb#9 +class CodeRay::Scanners::HTML < ::CodeRay::Scanners::Scanner + # source://coderay//lib/coderay/scanners/html.rb#62 + def reset; end + + protected + + # source://coderay//lib/coderay/scanners/html.rb#83 + def scan_css(encoder, code, state = T.unsafe(nil)); end + + # source://coderay//lib/coderay/scanners/html.rb#76 + def scan_java_script(encoder, code); end + + # source://coderay//lib/coderay/scanners/html.rb#90 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/html.rb#70 + def setup; end +end + +# source://coderay//lib/coderay/scanners/html.rb#39 +CodeRay::Scanners::HTML::ATTR_NAME = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/html.rb#42 +CodeRay::Scanners::HTML::ENTITY = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/html.rb#20 +CodeRay::Scanners::HTML::EVENT_ATTRIBUTES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/html.rb#41 +CodeRay::Scanners::HTML::HEX = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/html.rb#35 +CodeRay::Scanners::HTML::IN_ATTRIBUTE = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring) + +# source://coderay//lib/coderay/scanners/html.rb#13 +CodeRay::Scanners::HTML::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/html.rb#57 +CodeRay::Scanners::HTML::PLAIN_STRING_CONTENT = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/html.rb#40 +CodeRay::Scanners::HTML::TAG_END = T.let(T.unsafe(nil), Regexp) + +# Scanner for JSON (JavaScript Object Notation). +# +# source://coderay//lib/coderay/scanners/json.rb#5 +class CodeRay::Scanners::JSON < ::CodeRay::Scanners::Scanner + protected + + # See http://json.org/ for a definition of the JSON lexic/grammar. + # + # source://coderay//lib/coderay/scanners/json.rb#26 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/json.rb#21 + def setup; end +end + +# source://coderay//lib/coderay/scanners/json.rb#15 +CodeRay::Scanners::JSON::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/json.rb#17 +CodeRay::Scanners::JSON::KEY = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/json.rb#10 +CodeRay::Scanners::JSON::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/json.rb#16 +CodeRay::Scanners::JSON::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Scanner for Java. +# +# source://coderay//lib/coderay/scanners/java.rb#5 +class CodeRay::Scanners::Java < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/java.rb#51 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/java/builtin_types.rb#4 +module CodeRay::Scanners::Java::BuiltinTypes; end + +# source://coderay//lib/coderay/scanners/java/builtin_types.rb#7 +CodeRay::Scanners::Java::BuiltinTypes::List = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java.rb#19 +CodeRay::Scanners::Java::CONSTANTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java.rb#25 +CodeRay::Scanners::Java::DIRECTIVES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java.rb#40 +CodeRay::Scanners::Java::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/java.rb#47 +CodeRay::Scanners::Java::IDENT = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/java.rb#30 +CodeRay::Scanners::Java::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html +# +# source://coderay//lib/coderay/scanners/java.rb#12 +CodeRay::Scanners::Java::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java.rb#20 +CodeRay::Scanners::Java::MAGIC_VARIABLES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java.rb#18 +CodeRay::Scanners::Java::RESERVED = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java.rb#42 +CodeRay::Scanners::Java::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/java.rb#21 +CodeRay::Scanners::Java::TYPES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java.rb#41 +CodeRay::Scanners::Java::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Scanner for JavaScript. +# +# Aliases: +ecmascript+, +ecma_script+, +javascript+ +# +# source://coderay//lib/coderay/scanners/java_script.rb#7 +class CodeRay::Scanners::JavaScript < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/java_script.rb#224 + def reset_instance; end + + # source://coderay//lib/coderay/scanners/java_script.rb#61 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/java_script.rb#57 + def setup; end + + # source://coderay//lib/coderay/scanners/java_script.rb#229 + def xml_scanner; end +end + +# source://coderay//lib/coderay/scanners/java_script.rb#42 +CodeRay::Scanners::JavaScript::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/java_script.rb#36 +CodeRay::Scanners::JavaScript::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# The actual JavaScript keywords. +# +# source://coderay//lib/coderay/scanners/java_script.rb#13 +CodeRay::Scanners::JavaScript::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java_script.rb#24 +CodeRay::Scanners::JavaScript::KEYWORDS_EXPECTING_VALUE = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/java_script.rb#50 +CodeRay::Scanners::JavaScript::KEY_CHECK_PATTERN = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/java_script.rb#22 +CodeRay::Scanners::JavaScript::MAGIC_VARIABLES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java_script.rb#18 +CodeRay::Scanners::JavaScript::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java_script.rb#44 +CodeRay::Scanners::JavaScript::REGEXP_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Reserved for future use. +# +# source://coderay//lib/coderay/scanners/java_script.rb#29 +CodeRay::Scanners::JavaScript::RESERVED_WORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java_script.rb#45 +CodeRay::Scanners::JavaScript::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/java_script.rb#43 +CodeRay::Scanners::JavaScript::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Scanner for the Lua[http://lua.org] programming lanuage. +# +# The language’s complete syntax is defined in +# {the Lua manual}[http://www.lua.org/manual/5.2/manual.html], +# which is what this scanner tries to conform to. +# +# source://coderay//lib/coderay/scanners/lua.rb#11 +class CodeRay::Scanners::Lua < ::CodeRay::Scanners::Scanner + protected + + # CodeRay entry hook. Starts parsing. + # + # source://coderay//lib/coderay/scanners/lua.rb#60 + def scan_tokens(encoder, options); end + + # Scanner initialization. + # + # source://coderay//lib/coderay/scanners/lua.rb#54 + def setup; end +end + +# Automatic token kind selection for normal words. +# +# source://coderay//lib/coderay/scanners/lua.rb#46 +CodeRay::Scanners::Lua::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# Keywords used in Lua. +# +# source://coderay//lib/coderay/scanners/lua.rb#18 +CodeRay::Scanners::Lua::KEYWORDS = T.let(T.unsafe(nil), Array) + +# Constants set by the Lua core. +# +# source://coderay//lib/coderay/scanners/lua.rb#25 +CodeRay::Scanners::Lua::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# The expressions contained in this array are parts of Lua’s `basic' +# library. Although it’s not entirely necessary to load that library, +# it is highly recommended and one would have to provide own implementations +# of some of these expressions if one does not do so. They however aren’t +# keywords, neither are they constants, but nearly predefined, so they +# get tagged as `predefined' rather than anything else. +# +# This list excludes values of form `_UPPERCASE' because the Lua manual +# requires such identifiers to be reserved by Lua anyway and they are +# highlighted directly accordingly, without the need for specific +# identifiers to be listed here. +# +# source://coderay//lib/coderay/scanners/lua.rb#38 +CodeRay::Scanners::Lua::PREDEFINED_EXPRESSIONS = T.let(T.unsafe(nil), Array) + +# Scanner for PHP. +# +# Original by Stefan Walk. +# +# source://coderay//lib/coderay/scanners/php.rb#10 +class CodeRay::Scanners::PHP < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/php.rb#23 + def reset_instance; end + + # source://coderay//lib/coderay/scanners/php.rb#234 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/php.rb#19 + def setup; end +end + +# source://coderay//lib/coderay/scanners/php.rb#15 +CodeRay::Scanners::PHP::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/php.rb#197 +module CodeRay::Scanners::PHP::RE; end + +# source://coderay//lib/coderay/scanners/php.rb#211 +CodeRay::Scanners::PHP::RE::HTML_INDICATOR = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/php.rb#213 +CodeRay::Scanners::PHP::RE::IDENTIFIER = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/php.rb#216 +CodeRay::Scanners::PHP::RE::OPERATOR = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/php.rb#206 +CodeRay::Scanners::PHP::RE::PHP_END = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/php.rb#199 +CodeRay::Scanners::PHP::RE::PHP_START = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/php.rb#214 +CodeRay::Scanners::PHP::RE::VARIABLE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/php.rb#28 +module CodeRay::Scanners::PHP::Words; end + +# according to http://php.net/quickref.php on 2009-04-21; +# all functions with _ excluded (module functions) and selected additional functions +# +# source://coderay//lib/coderay/scanners/php.rb#50 +CodeRay::Scanners::PHP::Words::BUILTIN_FUNCTIONS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/php.rb#46 +CodeRay::Scanners::PHP::Words::CLASSES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/php.rb#145 +CodeRay::Scanners::PHP::Words::CONSTANTS = T.let(T.unsafe(nil), Array) + +# TODO: more built-in PHP functions? +# +# source://coderay//lib/coderay/scanners/php.rb#140 +CodeRay::Scanners::PHP::Words::EXCEPTIONS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/php.rb#184 +CodeRay::Scanners::PHP::Words::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring) + +# according to http://www.php.net/manual/en/reserved.keywords.php +# +# source://coderay//lib/coderay/scanners/php.rb#31 +CodeRay::Scanners::PHP::Words::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/php.rb#41 +CodeRay::Scanners::PHP::Words::LANGUAGE_CONSTRUCTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/php.rb#178 +CodeRay::Scanners::PHP::Words::PREDEFINED = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/php.rb#39 +CodeRay::Scanners::PHP::Words::TYPES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/php.rb#193 +CodeRay::Scanners::PHP::Words::VARIABLE_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# Scanner for Python. Supports Python 3. +# +# Based on pygments' PythonLexer, see +# http://dev.pocoo.org/projects/pygments/browser/pygments/lexers/agile.py. +# +# source://coderay//lib/coderay/scanners/python.rb#8 +class CodeRay::Scanners::Python < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/python.rb#103 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/python.rb#86 +CodeRay::Scanners::Python::DEF_NEW_STATE = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/python.rb#91 +CodeRay::Scanners::Python::DESCRIPTOR = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/python.rb#97 +CodeRay::Scanners::Python::DOCSTRING_COMING = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/python.rb#65 +CodeRay::Scanners::Python::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/python.rb#57 +CodeRay::Scanners::Python::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/python.rb#13 +CodeRay::Scanners::Python::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/python.rb#64 +CodeRay::Scanners::Python::NAME = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/python.rb#21 +CodeRay::Scanners::Python::OLD_KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/python.rb#68 +CodeRay::Scanners::Python::OPERATOR = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/python.rb#37 +CodeRay::Scanners::Python::PREDEFINED_EXCEPTIONS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/python.rb#25 +CodeRay::Scanners::Python::PREDEFINED_METHODS_AND_TYPES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/python.rb#52 +CodeRay::Scanners::Python::PREDEFINED_VARIABLES_AND_CONSTANTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/python.rb#82 +CodeRay::Scanners::Python::STRING_CONTENT_REGEXP = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/python.rb#78 +CodeRay::Scanners::Python::STRING_DELIMITER_REGEXP = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/python.rb#66 +CodeRay::Scanners::Python::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# = Raydebug Scanner +# +# Highlights the output of the Encoders::Debug encoder. +# +# source://coderay//lib/coderay/scanners/raydebug.rb#9 +class CodeRay::Scanners::Raydebug < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/raydebug.rb#22 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/raydebug.rb#17 + def setup; end +end + +# This scanner is really complex, since Ruby _is_ a complex language! +# +# It tries to highlight 100% of all common code, +# and 90% of strange codes. +# +# It is optimized for HTML highlighting, and is not very useful for +# parsing or pretty printing. +# +# source://coderay//lib/coderay/scanners/ruby.rb#11 +class CodeRay::Scanners::Ruby < ::CodeRay::Scanners::Scanner + # source://coderay//lib/coderay/scanners/ruby.rb#19 + def interpreted_string_state; end + + protected + + # source://coderay//lib/coderay/scanners/ruby.rb#29 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/ruby.rb#25 + def setup; end +end + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#5 +module CodeRay::Scanners::Ruby::Patterns; end + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#72 +CodeRay::Scanners::Ruby::Patterns::BINARY = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#106 +CodeRay::Scanners::Ruby::Patterns::CHARACTER = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#55 +CodeRay::Scanners::Ruby::Patterns::CLASS_VARIABLE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#96 +CodeRay::Scanners::Ruby::Patterns::CONTROL_META_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#132 +CodeRay::Scanners::Ruby::Patterns::DATA = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#69 +CodeRay::Scanners::Ruby::Patterns::DECIMAL = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#102 +CodeRay::Scanners::Ruby::Patterns::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#74 +CodeRay::Scanners::Ruby::Patterns::EXPONENT = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#168 +CodeRay::Scanners::Ruby::Patterns::FANCY_STRING_INTERPRETED = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#161 +CodeRay::Scanners::Ruby::Patterns::FANCY_STRING_KIND = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#160 +CodeRay::Scanners::Ruby::Patterns::FANCY_STRING_START = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#76 +CodeRay::Scanners::Ruby::Patterns::FLOAT_OR_INT = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#75 +CodeRay::Scanners::Ruby::Patterns::FLOAT_SUFFIX = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#57 +CodeRay::Scanners::Ruby::Patterns::GLOBAL_VARIABLE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#116 +CodeRay::Scanners::Ruby::Patterns::HEREDOC_OPEN = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#71 +CodeRay::Scanners::Ruby::Patterns::HEXADECIMAL = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#38 +CodeRay::Scanners::Ruby::Patterns::IDENT = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#28 +CodeRay::Scanners::Ruby::Patterns::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#54 +CodeRay::Scanners::Ruby::Patterns::INSTANCE_VARIABLE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#7 +CodeRay::Scanners::Ruby::Patterns::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#151 +CodeRay::Scanners::Ruby::Patterns::KEYWORDS_EXPECTING_VALUE = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#32 +CodeRay::Scanners::Ruby::Patterns::KEYWORD_NEW_STATE = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#53 +CodeRay::Scanners::Ruby::Patterns::METHOD_AFTER_DOT = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#40 +CodeRay::Scanners::Ruby::Patterns::METHOD_NAME = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#52 +CodeRay::Scanners::Ruby::Patterns::METHOD_NAME_EX = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#41 +CodeRay::Scanners::Ruby::Patterns::METHOD_NAME_OPERATOR = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#87 +CodeRay::Scanners::Ruby::Patterns::METHOD_NAME_OR_SYMBOL = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#51 +CodeRay::Scanners::Ruby::Patterns::METHOD_SUFFIX = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#77 +CodeRay::Scanners::Ruby::Patterns::NUMERIC = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#56 +CodeRay::Scanners::Ruby::Patterns::OBJECT_VARIABLE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#70 +CodeRay::Scanners::Ruby::Patterns::OCTAL = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#17 +CodeRay::Scanners::Ruby::Patterns::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#58 +CodeRay::Scanners::Ruby::Patterns::PREFIX_VARIABLE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#61 +CodeRay::Scanners::Ruby::Patterns::QUOTE_TO_TYPE = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#67 +CodeRay::Scanners::Ruby::Patterns::REGEXP_MODIFIERS = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#126 +CodeRay::Scanners::Ruby::Patterns::RUBYDOC = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#138 +CodeRay::Scanners::Ruby::Patterns::RUBYDOC_OR_DATA = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#89 +CodeRay::Scanners::Ruby::Patterns::SIMPLE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#79 +CodeRay::Scanners::Ruby::Patterns::SYMBOL = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#142 +CodeRay::Scanners::Ruby::Patterns::VALUE_FOLLOWS = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#59 +CodeRay::Scanners::Ruby::Patterns::VARIABLE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/string_state.rb#8 +class CodeRay::Scanners::Ruby::StringState < ::Struct + # @return [StringState] a new instance of StringState + # + # source://coderay//lib/coderay/scanners/ruby/string_state.rb#48 + def initialize(kind, interpreted, delim, heredoc = T.unsafe(nil)); end + + # source://coderay//lib/coderay/scanners/ruby/string_state.rb#63 + def heredoc_pattern(delim, interpreted, indented); end + + class << self + # source://coderay//lib/coderay/scanners/ruby/string_state.rb#40 + def simple_key_pattern(delim); end + end +end + +# source://coderay//lib/coderay/scanners/ruby/string_state.rb#10 +CodeRay::Scanners::Ruby::StringState::CLOSING_PAREN = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/ruby/string_state.rb#17 +CodeRay::Scanners::Ruby::StringState::STRING_PATTERN = T.let(T.unsafe(nil), Hash) + +# by Josh Goebel +# +# source://coderay//lib/coderay/scanners/sql.rb#5 +class CodeRay::Scanners::SQL < ::CodeRay::Scanners::Scanner + # source://coderay//lib/coderay/scanners/sql.rb#66 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/sql.rb#23 +CodeRay::Scanners::SQL::COMMANDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/sql.rb#38 +CodeRay::Scanners::SQL::DIRECTIVES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/sql.rb#55 +CodeRay::Scanners::SQL::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/sql.rb#46 +CodeRay::Scanners::SQL::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring) + +# source://coderay//lib/coderay/scanners/sql.rb#9 +CodeRay::Scanners::SQL::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/sql.rb#18 +CodeRay::Scanners::SQL::OBJECTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/sql.rb#44 +CodeRay::Scanners::SQL::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/sql.rb#36 +CodeRay::Scanners::SQL::PREDEFINED_FUNCTIONS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/sql.rb#28 +CodeRay::Scanners::SQL::PREDEFINED_TYPES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/sql.rb#60 +CodeRay::Scanners::SQL::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/sql.rb#58 +CodeRay::Scanners::SQL::STRING_PREFIXES = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/sql.rb#56 +CodeRay::Scanners::SQL::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# A scanner for Sass. +# +# source://coderay//lib/coderay/scanners/sass.rb#5 +class CodeRay::Scanners::Sass < ::CodeRay::Scanners::CSS + protected + + # source://coderay//lib/coderay/scanners/sass.rb#16 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/sass.rb#12 + def setup; end +end + +# = Scanner +# +# The base class for all Scanners. +# +# It is a subclass of Ruby's great +StringScanner+, which +# makes it easy to access the scanning methods inside. +# +# It is also +Enumerable+, so you can use it like an Array of +# Tokens: +# +# require 'coderay' +# +# c_scanner = CodeRay::Scanners[:c].new "if (*p == '{') nest++;" +# +# for text, kind in c_scanner +# puts text if kind == :operator +# end +# +# # prints: (*==)++; +# +# OK, this is a very simple example :) +# You can also use +map+, +any?+, +find+ and even +sort_by+, +# if you want. +# +# source://coderay//lib/coderay/scanners/scanner.rb#29 +class CodeRay::Scanners::Scanner < ::StringScanner + include ::Enumerable + extend ::CodeRay::Plugin + + # Create a new Scanner. + # + # * +code+ is the input String and is handled by the superclass + # StringScanner. + # * +options+ is a Hash with Symbols as keys. + # It is merged with the default options of the class (you can + # overwrite default options here.) + # + # Else, a Tokens object is used. + # + # @return [Scanner] a new instance of Scanner + # + # source://coderay//lib/coderay/scanners/scanner.rb#125 + def initialize(code = T.unsafe(nil), options = T.unsafe(nil)); end + + # The string in binary encoding. + # + # To be used with #pos, which is the index of the byte the scanner + # will scan next. + # + # source://coderay//lib/coderay/scanners/scanner.rb#218 + def binary_string; end + + # The current column position of the scanner, starting with 1. + # See also: #line. + # + # source://coderay//lib/coderay/scanners/scanner.rb#209 + def column(pos = T.unsafe(nil)); end + + # Traverse the tokens. + # + # source://coderay//lib/coderay/scanners/scanner.rb#192 + def each(&block); end + + # the default file extension for this scanner + # + # source://coderay//lib/coderay/scanners/scanner.rb#160 + def file_extension; end + + # the Plugin ID for this scanner + # + # source://coderay//lib/coderay/scanners/scanner.rb#155 + def lang; end + + # The current line position of the scanner, starting with 1. + # See also: #column. + # + # Beware, this is implemented inefficiently. It should be used + # for debugging only. + # + # source://coderay//lib/coderay/scanners/scanner.rb#202 + def line(pos = T.unsafe(nil)); end + + # Sets back the scanner. Subclasses should redefine the reset_instance + # method instead of this one. + # + # source://coderay//lib/coderay/scanners/scanner.rb#142 + def reset; end + + # Returns the value of attribute state. + # + # source://coderay//lib/coderay/scanners/scanner.rb#44 + def state; end + + # Sets the attribute state + # + # @param value the value to set the attribute state to. + # + # source://coderay//lib/coderay/scanners/scanner.rb#44 + def state=(_arg0); end + + # Set a new string to be scanned. + # + # source://coderay//lib/coderay/scanners/scanner.rb#148 + def string=(code); end + + # Scan the code and returns all tokens in a Tokens object. + # + # source://coderay//lib/coderay/scanners/scanner.rb#165 + def tokenize(source = T.unsafe(nil), options = T.unsafe(nil)); end + + # Cache the result of tokenize. + # + # source://coderay//lib/coderay/scanners/scanner.rb#187 + def tokens; end + + protected + + # Scanner error with additional status information + # + # @raise [ScanError] + # + # source://coderay//lib/coderay/scanners/scanner.rb#314 + def raise_inspect(message, tokens, state = T.unsafe(nil), ambit = T.unsafe(nil), backtrace = T.unsafe(nil)); end + + # source://coderay//lib/coderay/scanners/scanner.rb#289 + def raise_inspect_arguments(message, tokens, state, ambit); end + + # Resets the scanner. + # + # source://coderay//lib/coderay/scanners/scanner.rb#265 + def reset_instance; end + + # Shorthand for scan_until(/\z/). + # This method also avoids a JRuby 1.9 mode bug. + # + # source://coderay//lib/coderay/scanners/scanner.rb#328 + def scan_rest; end + + # This is the central method, and commonly the only one a + # subclass implements. + # + # Subclasses must implement this method; it must return +tokens+ + # and must only use Tokens#<< for storing scanned tokens! + # + # @raise [NotImplementedError] + # + # source://coderay//lib/coderay/scanners/scanner.rb#260 + def scan_tokens(tokens, options); end + + # source://coderay//lib/coderay/scanners/scanner.rb#305 + def scanner_state_info(state); end + + # source://coderay//lib/coderay/scanners/scanner.rb#239 + def set_string_from_source(source); end + + # source://coderay//lib/coderay/scanners/scanner.rb#250 + def set_tokens_from_options(options); end + + # Can be implemented by subclasses to do some initialization + # that has to be done once per instance. + # + # Use reset for initialization that has to be done once per + # scan. + # + # source://coderay//lib/coderay/scanners/scanner.rb#236 + def setup; end + + # source://coderay//lib/coderay/scanners/scanner.rb#322 + def tokens_last(tokens, n); end + + # source://coderay//lib/coderay/scanners/scanner.rb#318 + def tokens_size(tokens); end + + class << self + # The encoding used internally by this scanner. + # + # source://coderay//lib/coderay/scanners/scanner.rb#71 + def encoding(name = T.unsafe(nil)); end + + # The typical filename suffix for this scanner's language. + # + # source://coderay//lib/coderay/scanners/scanner.rb#66 + def file_extension(extension = T.unsafe(nil)); end + + # The lang of this Scanner class, which is equal to its Plugin ID. + # + # source://coderay//lib/coderay/scanners/scanner.rb#76 + def lang; end + + # Normalizes the given code into a string with UNIX newlines, in the + # scanner's internal encoding, with invalid and undefined charachters + # replaced by placeholders. Always returns a new object. + # + # source://coderay//lib/coderay/scanners/scanner.rb#51 + def normalize(code); end + + protected + + # source://coderay//lib/coderay/scanners/scanner.rb#82 + def encode_with_encoding(code, target_encoding); end + + # source://coderay//lib/coderay/scanners/scanner.rb#100 + def guess_encoding(s); end + + # source://coderay//lib/coderay/scanners/scanner.rb#96 + def to_unix(code); end + end +end + +# The default options for all scanner classes. +# +# Define @default_options for subclasses. +# +# source://coderay//lib/coderay/scanners/scanner.rb#40 +CodeRay::Scanners::Scanner::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/scanner.rb#42 +CodeRay::Scanners::Scanner::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/helpers/plugin.rb#41 +CodeRay::Scanners::Scanner::PLUGIN_HOST = CodeRay::Scanners + +# source://coderay//lib/coderay/scanners/scanner.rb#299 +CodeRay::Scanners::Scanner::SCANNER_STATE_INFO = T.let(T.unsafe(nil), String) + +# source://coderay//lib/coderay/scanners/scanner.rb#271 +CodeRay::Scanners::Scanner::SCAN_ERROR_MESSAGE = T.let(T.unsafe(nil), String) + +# Raised if a Scanner fails while scanning +# +# source://coderay//lib/coderay/scanners/scanner.rb#35 +class CodeRay::Scanners::Scanner::ScanError < ::StandardError; end + +# source://coderay//lib/coderay/scanners/taskpaper.rb#4 +class CodeRay::Scanners::Taskpaper < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/taskpaper.rb#11 + def scan_tokens(encoder, options); end +end + +# Scanner for plain text. +# +# Yields just one token of the kind :plain. +# +# Alias: +plaintext+, +plain+ +# +# source://coderay//lib/coderay/scanners/text.rb#9 +class CodeRay::Scanners::Text < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/text.rb#18 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/text.rb#14 +CodeRay::Scanners::Text::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# Scanner for XML. +# +# Currently this is the same scanner as Scanners::HTML. +# +# source://coderay//lib/coderay/scanners/xml.rb#9 +class CodeRay::Scanners::XML < ::CodeRay::Scanners::HTML; end + +# Scanner for YAML. +# +# Based on the YAML scanner from Syntax by Jamis Buck. +# +# source://coderay//lib/coderay/scanners/yaml.rb#7 +class CodeRay::Scanners::YAML < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/yaml.rb#16 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/yaml.rb#12 +CodeRay::Scanners::YAML::KINDS_NOT_LOC = T.let(T.unsafe(nil), Symbol) + +# This module holds the Style class and its subclasses. +# +# See Plugin. +# +# source://coderay//lib/coderay/styles.rb#6 +module CodeRay::Styles + extend ::CodeRay::PluginHost +end + +# A colorful theme using CSS 3 colors (with alpha channel). +# +# source://coderay//lib/coderay/styles/alpha.rb#5 +class CodeRay::Styles::Alpha < ::CodeRay::Styles::Style; end + +# source://coderay//lib/coderay/styles/alpha.rb#14 +CodeRay::Styles::Alpha::CSS_MAIN_STYLES = T.let(T.unsafe(nil), String) + +# source://coderay//lib/coderay/styles/alpha.rb#53 +CodeRay::Styles::Alpha::TOKEN_COLORS = T.let(T.unsafe(nil), String) + +# Base class for styles. +# +# Styles are used by Encoders::HTML to colorize tokens. +# +# source://coderay//lib/coderay/styles/style.rb#8 +class CodeRay::Styles::Style + extend ::CodeRay::Plugin +end + +# source://coderay//lib/coderay/styles/style.rb#12 +CodeRay::Styles::Style::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/helpers/plugin.rb#41 +CodeRay::Styles::Style::PLUGIN_HOST = CodeRay::Styles + +# A Hash of all known token kinds and their associated CSS classes. +# +# source://coderay//lib/coderay/token_kinds.rb#4 +CodeRay::TokenKinds = T.let(T.unsafe(nil), Hash) + +# The Tokens class represents a list of tokens returned from +# a Scanner. It's actually just an Array with a few helper methods. +# +# A token itself is not a special object, just two elements in an Array: +# * the _token_ _text_ (the original source of the token in a String) or +# a _token_ _action_ (begin_group, end_group, begin_line, end_line) +# * the _token_ _kind_ (a Symbol representing the type of the token) +# +# It looks like this: +# +# ..., '# It looks like this', :comment, ... +# ..., '3.1415926', :float, ... +# ..., '$^', :error, ... +# +# Some scanners also yield sub-tokens, represented by special +# token actions, for example :begin_group and :end_group. +# +# The Ruby scanner, for example, splits "a string" into: +# +# [ +# :begin_group, :string, +# '"', :delimiter, +# 'a string', :content, +# '"', :delimiter, +# :end_group, :string +# ] +# +# Tokens can be used to save the output of a Scanners in a simple +# Ruby object that can be send to an Encoder later: +# +# tokens = CodeRay.scan('price = 2.59', :ruby).tokens +# tokens.encode(:html) +# tokens.html +# CodeRay.encoder(:html).encode_tokens(tokens) +# +# Tokens gives you the power to handle pre-scanned code very easily: +# You can serialize it to a JSON string and store it in a database, pass it +# around to encode it more than once, send it to other algorithms... +# +# source://coderay//lib/coderay/tokens.rb#41 +class CodeRay::Tokens < ::Array + # source://coderay//lib/coderay/tokens.rb#156 + def begin_group(kind); end + + # source://coderay//lib/coderay/tokens.rb#158 + def begin_line(kind); end + + # Return the actual number of tokens. + # + # source://coderay//lib/coderay/tokens.rb#151 + def count; end + + # Encode the tokens using encoder. + # + # encoder can be + # * a plugin name like :html oder 'statistic' + # * an Encoder object + # + # options are passed to the encoder. + # + # source://coderay//lib/coderay/tokens.rb#56 + def encode(encoder, options = T.unsafe(nil)); end + + # source://coderay//lib/coderay/tokens.rb#157 + def end_group(kind); end + + # source://coderay//lib/coderay/tokens.rb#159 + def end_line(kind); end + + # Redirects unknown methods to encoder calls. + # + # For example, if you call +tokens.html+, the HTML encoder + # is used to highlight the tokens. + # + # source://coderay//lib/coderay/tokens.rb#70 + def method_missing(meth, options = T.unsafe(nil)); end + + # The Scanner instance that created the tokens. + # + # source://coderay//lib/coderay/tokens.rb#47 + def scanner; end + + # The Scanner instance that created the tokens. + # + # source://coderay//lib/coderay/tokens.rb#47 + def scanner=(_arg0); end + + # Split the tokens into parts of the given +sizes+. + # + # The result will be an Array of Tokens objects. The parts have + # the text size specified by the parameter. In addition, each + # part closes all opened tokens. This is useful to insert tokens + # betweem them. + # + # This method is used by @Scanner#tokenize@ when called with an Array + # of source strings. The Diff encoder uses it for inline highlighting. + # + # source://coderay//lib/coderay/tokens.rb#85 + def split_into_parts(*sizes); end + + def text_token(*_arg0); end + + # Turn tokens into a string by concatenating them. + # + # source://coderay//lib/coderay/tokens.rb#62 + def to_s; end + + def tokens(*_arg0); end +end + +# The result of a scan operation is a TokensProxy, but should act like Tokens. +# +# This proxy makes it possible to use the classic CodeRay.scan.encode API +# while still providing the benefits of direct streaming. +# +# source://coderay//lib/coderay/tokens_proxy.rb#7 +class CodeRay::TokensProxy + # Create a new TokensProxy with the arguments of CodeRay.scan. + # + # @return [TokensProxy] a new instance of TokensProxy + # + # source://coderay//lib/coderay/tokens_proxy.rb#12 + def initialize(input, lang, options = T.unsafe(nil), block = T.unsafe(nil)); end + + # Returns the value of attribute block. + # + # source://coderay//lib/coderay/tokens_proxy.rb#9 + def block; end + + # Sets the attribute block + # + # @param value the value to set the attribute block to. + # + # source://coderay//lib/coderay/tokens_proxy.rb#9 + def block=(_arg0); end + + # Overwrite Struct#each. + # + # source://coderay//lib/coderay/tokens_proxy.rb#48 + def each(*args, &blk); end + + # Call CodeRay.encode if +encoder+ is a Symbol; + # otherwise, convert the receiver to tokens and call encoder.encode_tokens. + # + # source://coderay//lib/coderay/tokens_proxy.rb#21 + def encode(encoder, options = T.unsafe(nil)); end + + # Returns the value of attribute input. + # + # source://coderay//lib/coderay/tokens_proxy.rb#9 + def input; end + + # Sets the attribute input + # + # @param value the value to set the attribute input to. + # + # source://coderay//lib/coderay/tokens_proxy.rb#9 + def input=(_arg0); end + + # Returns the value of attribute lang. + # + # source://coderay//lib/coderay/tokens_proxy.rb#9 + def lang; end + + # Sets the attribute lang + # + # @param value the value to set the attribute lang to. + # + # source://coderay//lib/coderay/tokens_proxy.rb#9 + def lang=(_arg0); end + + # Tries to call encode; + # delegates to tokens otherwise. + # + # source://coderay//lib/coderay/tokens_proxy.rb#31 + def method_missing(method, *args, &blk); end + + # Returns the value of attribute options. + # + # source://coderay//lib/coderay/tokens_proxy.rb#9 + def options; end + + # Sets the attribute options + # + # @param value the value to set the attribute options to. + # + # source://coderay//lib/coderay/tokens_proxy.rb#9 + def options=(_arg0); end + + # A (cached) scanner instance to use for the scan task. + # + # source://coderay//lib/coderay/tokens_proxy.rb#43 + def scanner; end + + # The (cached) result of the tokenized input; a Tokens instance. + # + # source://coderay//lib/coderay/tokens_proxy.rb#38 + def tokens; end +end + +# source://coderay//lib/coderay/version.rb#2 +CodeRay::VERSION = T.let(T.unsafe(nil), String) + +# = WordList +# +# A Hash subclass designed for mapping word lists to token types. +# +# A WordList is a Hash with some additional features. +# It is intended to be used for keyword recognition. +# +# WordList is optimized to be used in Scanners, +# typically to decide whether a given ident is a special token. +# +# For case insensitive words use WordList::CaseIgnoring. +# +# Example: +# +# # define word arrays +# RESERVED_WORDS = %w[ +# asm break case continue default do else +# ] +# +# PREDEFINED_TYPES = %w[ +# int long short char void +# ] +# +# # make a WordList +# IDENT_KIND = WordList.new(:ident). +# add(RESERVED_WORDS, :reserved). +# add(PREDEFINED_TYPES, :predefined_type) +# +# ... +# +# def scan_tokens tokens, options +# ... +# +# elsif scan(/[A-Za-z_][A-Za-z_0-9]*/) +# # use it +# kind = IDENT_KIND[match] +# ... +# +# source://coderay//lib/coderay/helpers/word_list.rb#40 +class CodeRay::WordList < ::Hash + # Create a new WordList with +default+ as default value. + # + # @return [WordList] a new instance of WordList + # + # source://coderay//lib/coderay/helpers/word_list.rb#43 + def initialize(default = T.unsafe(nil)); end + + # Add words to the list and associate them with +value+. + # + # Returns +self+, so you can concat add calls. + # + # source://coderay//lib/coderay/helpers/word_list.rb#50 + def add(words, value = T.unsafe(nil)); end +end + +# A CaseIgnoring WordList is like a WordList, only that +# keys are compared case-insensitively (normalizing keys using +downcase+). +# +# source://coderay//lib/coderay/helpers/word_list.rb#60 +class CodeRay::WordList::CaseIgnoring < ::CodeRay::WordList + # source://coderay//lib/coderay/helpers/word_list.rb#62 + def [](key); end + + # source://coderay//lib/coderay/helpers/word_list.rb#66 + def []=(key, value); end +end diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/diff-lcs@1.5.1.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/diff-lcs@1.5.1.rbi new file mode 100644 index 0000000..aa5aa3c --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/diff-lcs@1.5.1.rbi @@ -0,0 +1,1131 @@ +# 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`. + + +# source://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 +# +# source://diff-lcs//lib/diff/lcs.rb#51 +module Diff::LCS + # Returns the difference set between +self+ and +other+. See Diff::LCS#diff. + # + # source://diff-lcs//lib/diff/lcs.rb#75 + 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, which typically means that the objects must + # implement Object#eql? in a way that two identical values compare + # identically for key purposes. That is: + # + # O.new('a').eql?(O.new('a')) == true + # + # source://diff-lcs//lib/diff/lcs.rb#70 + 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. + # + # source://diff-lcs//lib/diff/lcs.rb#101 + 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. + # + # source://diff-lcs//lib/diff/lcs.rb#109 + 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. + # + # source://diff-lcs//lib/diff/lcs.rb#123 + def patch_me(patchset); end + + # Returns the balanced ("side-by-side") difference set between +self+ and + # +other+. See Diff::LCS#sdiff. + # + # source://diff-lcs//lib/diff/lcs.rb#81 + 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. + # + # source://diff-lcs//lib/diff/lcs.rb#94 + 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. + # + # source://diff-lcs//lib/diff/lcs.rb#87 + def traverse_sequences(other, callbacks = T.unsafe(nil), &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. + # + # source://diff-lcs//lib/diff/lcs.rb#101 + 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. + # + # source://diff-lcs//lib/diff/lcs.rb#116 + 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. + # + # source://diff-lcs//lib/diff/lcs.rb#134 + def unpatch_me(patchset); end + + class << self + # :yields: seq1[i] for each matched + # + # source://diff-lcs//lib/diff/lcs.rb#144 + def LCS(seq1, seq2, &block); end + + # source://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. + # + # source://diff-lcs//lib/diff/lcs.rb#168 + def diff(seq1, seq2, callbacks = T.unsafe(nil), &block); end + + # :yields: seq1[i] for each matched + # + # source://diff-lcs//lib/diff/lcs.rb#144 + 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. + # + # source://diff-lcs//lib/diff/lcs.rb#626 + 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. + # + # source://diff-lcs//lib/diff/lcs.rb#736 + 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 + # + # source://diff-lcs//lib/diff/lcs.rb#200 + 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, + # noticable 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 indicies +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. + # + # source://diff-lcs//lib/diff/lcs.rb#475 + 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 indicies +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+. + # + # source://diff-lcs//lib/diff/lcs.rb#285 + 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. + # + # source://diff-lcs//lib/diff/lcs.rb#730 + def unpatch!(src, patchset); end + + private + + # source://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) +# +# source://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. +# +# source://diff-lcs//lib/diff/lcs/block.rb#6 +class Diff::LCS::Block + # @return [Block] a new instance of Block + # + # source://diff-lcs//lib/diff/lcs/block.rb#9 + def initialize(chunk); end + + # Returns the value of attribute changes. + # + # source://diff-lcs//lib/diff/lcs/block.rb#7 + def changes; end + + # source://diff-lcs//lib/diff/lcs/block.rb#21 + def diff_size; end + + # Returns the value of attribute insert. + # + # source://diff-lcs//lib/diff/lcs/block.rb#7 + def insert; end + + # source://diff-lcs//lib/diff/lcs/block.rb#25 + def op; end + + # Returns the value of attribute remove. + # + # source://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. +# +# source://diff-lcs//lib/diff/lcs/change.rb#6 +class Diff::LCS::Change + include ::Comparable + + # @return [Change] a new instance of Change + # + # source://diff-lcs//lib/diff/lcs/change.rb#27 + def initialize(*args); end + + # source://diff-lcs//lib/diff/lcs/change.rb#65 + def <=>(other); end + + # source://diff-lcs//lib/diff/lcs/change.rb#58 + def ==(other); end + + # Returns the action this Change represents. + # + # source://diff-lcs//lib/diff/lcs/change.rb#20 + def action; end + + # @return [Boolean] + # + # source://diff-lcs//lib/diff/lcs/change.rb#72 + def adding?; end + + # @return [Boolean] + # + # source://diff-lcs//lib/diff/lcs/change.rb#84 + def changed?; end + + # @return [Boolean] + # + # source://diff-lcs//lib/diff/lcs/change.rb#76 + def deleting?; end + + # Returns the sequence element of the Change. + # + # source://diff-lcs//lib/diff/lcs/change.rb#25 + def element; end + + # @return [Boolean] + # + # source://diff-lcs//lib/diff/lcs/change.rb#88 + def finished_a?; end + + # @return [Boolean] + # + # source://diff-lcs//lib/diff/lcs/change.rb#92 + def finished_b?; end + + # source://diff-lcs//lib/diff/lcs/change.rb#34 + def inspect(*_args); end + + # Returns the position of the Change. + # + # source://diff-lcs//lib/diff/lcs/change.rb#23 + def position; end + + # source://diff-lcs//lib/diff/lcs/change.rb#38 + def to_a; end + + # source://diff-lcs//lib/diff/lcs/change.rb#38 + def to_ary; end + + # @return [Boolean] + # + # source://diff-lcs//lib/diff/lcs/change.rb#80 + def unchanged?; end + + class << self + # source://diff-lcs//lib/diff/lcs/change.rb#44 + def from_a(arr); end + + # @return [Boolean] + # + # source://diff-lcs//lib/diff/lcs/change.rb#15 + def valid_action?(action); end + end +end + +# source://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. +# +# source://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. +# +# source://diff-lcs//lib/diff/lcs/change.rb#100 +class Diff::LCS::ContextChange < ::Diff::LCS::Change + # @return [ContextChange] a new instance of ContextChange + # + # source://diff-lcs//lib/diff/lcs/change.rb#114 + def initialize(*args); end + + # source://diff-lcs//lib/diff/lcs/change.rb#166 + def <=>(other); end + + # source://diff-lcs//lib/diff/lcs/change.rb#157 + def ==(other); end + + # Returns the new element being changed. + # + # source://diff-lcs//lib/diff/lcs/change.rb#112 + def new_element; end + + # Returns the new position being changed. + # + # source://diff-lcs//lib/diff/lcs/change.rb#108 + def new_position; end + + # Returns the old element being changed. + # + # source://diff-lcs//lib/diff/lcs/change.rb#110 + def old_element; end + + # Returns the old position being changed. + # + # source://diff-lcs//lib/diff/lcs/change.rb#106 + def old_position; end + + # source://diff-lcs//lib/diff/lcs/change.rb#122 + def to_a; end + + # source://diff-lcs//lib/diff/lcs/change.rb#122 + def to_ary; end + + class << self + # source://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 '+'. + # + # source://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 } } +# +# source://diff-lcs//lib/diff/lcs/callbacks.rb#225 +class Diff::LCS::ContextDiffCallbacks < ::Diff::LCS::DiffCallbacks + # source://diff-lcs//lib/diff/lcs/callbacks.rb#234 + def change(event); end + + # source://diff-lcs//lib/diff/lcs/callbacks.rb#226 + def discard_a(event); end + + # source://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) +# +# source://diff-lcs//lib/diff/lcs/callbacks.rb#14 +class Diff::LCS::DefaultCallbacks + class << self + # Called when both the old and new values have changed. + # + # source://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. + # + # source://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. + # + # source://diff-lcs//lib/diff/lcs/callbacks.rb#27 + def discard_b(event); end + + # Called when two items match. + # + # source://diff-lcs//lib/diff/lcs/callbacks.rb#17 + def match(event); end + + private + + 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 } } +# +# source://diff-lcs//lib/diff/lcs/callbacks.rb#108 +class Diff::LCS::DiffCallbacks + # :yields: self + # + # @return [DiffCallbacks] a new instance of DiffCallbacks + # + # source://diff-lcs//lib/diff/lcs/callbacks.rb#112 + def initialize; end + + # Returns the difference set collected during the diff process. + # + # source://diff-lcs//lib/diff/lcs/callbacks.rb#110 + def diffs; end + + # source://diff-lcs//lib/diff/lcs/callbacks.rb#135 + def discard_a(event); end + + # source://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. + # + # source://diff-lcs//lib/diff/lcs/callbacks.rb#127 + def finish; end + + # source://diff-lcs//lib/diff/lcs/callbacks.rb#131 + def match(_event); end + + private + + # source://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). +# +# source://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. + # + # @return [Hunk] a new instance of Hunk + # + # source://diff-lcs//lib/diff/lcs/hunk.rb#16 + def initialize(data_old, data_new, piece, flag_context, file_length_difference); end + + # Returns the value of attribute blocks. + # + # source://diff-lcs//lib/diff/lcs/hunk.rb#62 + def blocks; end + + # Returns a diff string based on a format. + # + # source://diff-lcs//lib/diff/lcs/hunk.rb#115 + def diff(format, last = T.unsafe(nil)); end + + # Returns the value of attribute end_new. + # + # source://diff-lcs//lib/diff/lcs/hunk.rb#64 + def end_new; end + + # Returns the value of attribute end_old. + # + # source://diff-lcs//lib/diff/lcs/hunk.rb#64 + def end_old; end + + # Returns the value of attribute file_length_difference. + # + # source://diff-lcs//lib/diff/lcs/hunk.rb#65 + def file_length_difference; end + + # Change the "start" and "end" fields to note that context should be added + # to this hunk. + # + # source://diff-lcs//lib/diff/lcs/hunk.rb#69 + def flag_context; end + + # source://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. + # + # source://diff-lcs//lib/diff/lcs/hunk.rb#97 + def merge(hunk); end + + # @return [Boolean] + # + # source://diff-lcs//lib/diff/lcs/hunk.rb#331 + 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. + # + # @return [Boolean] + # + # source://diff-lcs//lib/diff/lcs/hunk.rb#109 + def overlaps?(hunk); end + + # Returns the value of attribute start_new. + # + # source://diff-lcs//lib/diff/lcs/hunk.rb#63 + def start_new; end + + # Returns the value of attribute start_old. + # + # source://diff-lcs//lib/diff/lcs/hunk.rb#63 + def start_old; 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. + # + # source://diff-lcs//lib/diff/lcs/hunk.rb#97 + def unshift(hunk); end + + private + + # source://diff-lcs//lib/diff/lcs/hunk.rb#214 + 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' + # + # source://diff-lcs//lib/diff/lcs/hunk.rb#298 + def context_range(mode, op, last = T.unsafe(nil)); end + + # source://diff-lcs//lib/diff/lcs/hunk.rb#276 + def ed_diff(format, _last = T.unsafe(nil)); end + + # source://diff-lcs//lib/diff/lcs/hunk.rb#344 + def encode(literal, target_encoding = T.unsafe(nil)); end + + # source://diff-lcs//lib/diff/lcs/hunk.rb#348 + 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. + # + # source://diff-lcs//lib/diff/lcs/hunk.rb#134 + def old_diff(_last = T.unsafe(nil)); end + + # source://diff-lcs//lib/diff/lcs/hunk.rb#159 + 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) + # + # source://diff-lcs//lib/diff/lcs/hunk.rb#316 + def unified_range(mode, last); end +end + +# source://diff-lcs//lib/diff/lcs/hunk.rb#10 +Diff::LCS::Hunk::ED_DIFF_OP_ACTION = T.let(T.unsafe(nil), Hash) + +# source://diff-lcs//lib/diff/lcs/hunk.rb#9 +Diff::LCS::Hunk::OLD_DIFF_OP_ACTION = T.let(T.unsafe(nil), Hash) + +# source://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. + # + # source://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. + # + # source://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 + # + # source://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.) + # + # source://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+. + # + # source://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. + # + # source://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 } +# +# source://diff-lcs//lib/diff/lcs/callbacks.rb#303 +class Diff::LCS::SDiffCallbacks + # :yields: self + # + # @return [SDiffCallbacks] a new instance of SDiffCallbacks + # @yield [_self] + # @yieldparam _self [Diff::LCS::SDiffCallbacks] the object that the method was called on + # + # source://diff-lcs//lib/diff/lcs/callbacks.rb#307 + def initialize; end + + # source://diff-lcs//lib/diff/lcs/callbacks.rb#324 + def change(event); end + + # Returns the difference set collected during the diff process. + # + # source://diff-lcs//lib/diff/lcs/callbacks.rb#305 + def diffs; end + + # source://diff-lcs//lib/diff/lcs/callbacks.rb#316 + def discard_a(event); end + + # source://diff-lcs//lib/diff/lcs/callbacks.rb#320 + def discard_b(event); end + + # source://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) +# +# source://diff-lcs//lib/diff/lcs/callbacks.rb#44 +Diff::LCS::SequenceCallbacks = Diff::LCS::DefaultCallbacks + +# source://diff-lcs//lib/diff/lcs.rb#52 +Diff::LCS::VERSION = T.let(T.unsafe(nil), String) diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/dry-inflector@1.1.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/dry-inflector@1.1.0.rbi new file mode 100644 index 0000000..5efec73 --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/dry-inflector@1.1.0.rbi @@ -0,0 +1,648 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `dry-inflector` gem. +# Please instead update this file by running `bin/tapioca gem dry-inflector`. + + +# source://dry-inflector//lib/dry/inflector.rb#3 +module Dry; end + +# dry-inflector +# +# @since 0.1.0 +# +# source://dry-inflector//lib/dry/inflector.rb#7 +class Dry::Inflector + # Instantiate the inflector + # + # @example Basic usage + # require "dry/inflector" + # + # inflector = Dry::Inflector.new + # @example Custom inflection rules + # require "dry/inflector" + # + # inflector = Dry::Inflector.new do |inflections| + # inflections.plural "virus", "viruses" # specify a rule for #pluralize + # inflections.singular "thieves", "thief" # specify a rule for #singularize + # inflections.uncountable "dry-inflector" # add an exception for an uncountable word + # end + # @param blk [Proc] an optional block to specify custom inflection rules + # @return [Dry::Inflector] the inflector + # @since 0.1.0 + # @yieldparam the [Dry::Inflector::Inflections] inflection rules + # + # source://dry-inflector//lib/dry/inflector.rb#33 + def initialize(&blk); end + + # Upper camelize a string + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new + # inflector.camelize_upper("data_mapper") # => "DataMapper" + # inflector.camelize_upper("dry/inflector") # => "Dry::Inflector" + # @param input [String, Symbol] the input + # @return [String] the upper camelized string + # @since 0.1.3 + # + # source://dry-inflector//lib/dry/inflector.rb#66 + def camelize(input); end + + # Lower camelize a string + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new + # inflector.camelize_lower("data_mapper") # => "dataMapper" + # @param input [String, Symbol] the input + # @return [String] the lower camelized string + # @since 0.1.3 + # + # source://dry-inflector//lib/dry/inflector.rb#49 + def camelize_lower(input); end + + # Upper camelize a string + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new + # inflector.camelize_upper("data_mapper") # => "DataMapper" + # inflector.camelize_upper("dry/inflector") # => "Dry::Inflector" + # @param input [String, Symbol] the input + # @return [String] the upper camelized string + # @since 0.1.3 + # + # source://dry-inflector//lib/dry/inflector.rb#66 + def camelize_upper(input); end + + # Classify a string + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new + # inflector.classify("books") # => "Book" + # @param input [String, Symbol] the input + # @return [String] the classified string + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector.rb#104 + def classify(input); end + + # Find a constant with the name specified in the argument string + # + # The name is assumed to be the one of a top-level constant, + # constant scope of caller is ignored + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new + # inflector.constantize("Module") # => Module + # inflector.constantize("Dry::Inflector") # => Dry::Inflector + # @param input [String, Symbol] the input + # @return [Class, Module] the class or module + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector.rb#88 + def constantize(input); end + + # Dasherize a string + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new + # inflector.dasherize("dry_inflector") # => "dry-inflector" + # @param input [String, Symbol] the input + # @return [String] the dasherized string + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector.rb#120 + def dasherize(input); end + + # Demodulize a string + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new + # inflector.demodulize("Dry::Inflector") # => "Inflector" + # @param input [String, Symbol] the input + # @return [String] the demodulized string + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector.rb#136 + def demodulize(input); end + + # Creates a foreign key name + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new + # inflector.foreign_key("Message") => "message_id" + # @param input [String, Symbol] the input + # @return [String] foreign key + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector.rb#175 + def foreign_key(input); end + + # Humanize a string + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new + # inflector.humanize("dry_inflector") # => "Dry inflector" + # inflector.humanize("author_id") # => "Author" + # @param input [String, Symbol] the input + # @return [String] the humanized string + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector.rb#153 + def humanize(input); end + + # @api public + # @return [String] + # @since 0.2.0 + # + # source://dry-inflector//lib/dry/inflector.rb#310 + def inspect; end + + # Ordinalize a number + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new + # inflector.ordinalize(1) # => "1st" + # inflector.ordinalize(2) # => "2nd" + # inflector.ordinalize(3) # => "3rd" + # inflector.ordinalize(10) # => "10th" + # inflector.ordinalize(23) # => "23rd" + # @param number [Integer] the input + # @return [String] the ordinalized number + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector.rb#195 + def ordinalize(number); end + + # Pluralize a string + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new + # inflector.pluralize("book") # => "books" + # inflector.pluralize("money") # => "money" + # @param input [String, Symbol] the input + # @return [String] the pluralized string + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector.rb#223 + def pluralize(input); end + + # Singularize a string + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new + # inflector.singularize("books") # => "book" + # inflector.singularize("money") # => "money" + # @param input [String] the input + # @return [String] the singularized string + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector.rb#243 + def singularize(input); end + + # Tableize a string + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new + # inflector.tableize("Book") # => "books" + # @param input [String, Symbol] the input + # @return [String] the tableized string + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector.rb#262 + def tableize(input); end + + # @api public + # @return [String] + # @since 0.2.0 + # + # source://dry-inflector//lib/dry/inflector.rb#310 + def to_s; end + + # Check if the input is an uncountable word + # + # @api private + # @param input [String] the input + # @return [TrueClass, FalseClass] the result of the check + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector.rb#300 + def uncountable?(input); end + + # Underscore a string + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new + # inflector.underscore("dry-inflector") # => "dry_inflector" + # @param input [String, Symbol] the input + # @return [String] the underscored string + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector.rb#279 + def underscore(input); end + + private + + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector.rb#325 + def inflections; end + + # @api private + # @since 0.1.3 + # + # source://dry-inflector//lib/dry/inflector.rb#329 + def internal_camelize(input, upper); end +end + +# A set of acronyms +# +# @api private +# @since 0.1.2 +# +# source://dry-inflector//lib/dry/inflector/acronyms.rb#9 +class Dry::Inflector::Acronyms + # @api private + # @return [Acronyms] a new instance of Acronyms + # @since 0.1.2 + # + # source://dry-inflector//lib/dry/inflector/acronyms.rb#14 + def initialize; end + + # @api private + # @since 0.1.2 + # + # source://dry-inflector//lib/dry/inflector/acronyms.rb#27 + def add(rule, replacement); end + + # @api private + # @since 0.1.2 + # + # source://dry-inflector//lib/dry/inflector/acronyms.rb#21 + def apply_to(word, capitalize: T.unsafe(nil)); end + + # @api private + # @since 0.1.2 + # + # source://dry-inflector//lib/dry/inflector/acronyms.rb#10 + def regex; end + + private + + # @api private + # @since 0.1.2 + # + # source://dry-inflector//lib/dry/inflector/acronyms.rb#36 + def define_regex_patterns; end +end + +# @api private +# @since 0.1.2 +# +# source://dry-inflector//lib/dry/inflector.rb#323 +Dry::Inflector::DEFAULT_SEPARATOR = T.let(T.unsafe(nil), String) + +# Inflections +# +# @since 0.1.0 +# +# source://dry-inflector//lib/dry/inflector/inflections.rb#12 +class Dry::Inflector::Inflections + # Instantiate the rules + # + # @api private + # @return [Dry::Inflector::Inflections] + # @since 0.1.0 + # @yieldparam [self] + # + # source://dry-inflector//lib/dry/inflector/inflections.rb#76 + def initialize; end + + # Add one or more acronyms + # + # Acronyms affect how basic operations are performed, such + # as camelize/underscore. + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new do |inflections| + # inflections.acronym "HTML" + # end + # + # inflector.camelize("html") # => "HTML" + # inflector.underscore("HTMLIsFun") # => "html_is_fun" + # @param words [Array] a list of acronyms + # @since 0.1.2 + # + # source://dry-inflector//lib/dry/inflector/inflections.rb#197 + def acronym(*words); end + + # Acronyms + # + # @api private + # @return [Dry::Inflector::Acronyms] + # @since 0.1.2 + # + # source://dry-inflector//lib/dry/inflector/inflections.rb#67 + def acronyms; end + + # Add a custom humanize rule + # + # 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"`) + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new do |inflections| + # inflections.human(/_cnt$/i, '\1_count') + # inflections.human("legacy_col_person_name", "Name") + # end + # @param rule [String, Regexp] the rule + # @param replacement [String] the replacement + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/inflections.rb#224 + def human(rule, replacement); end + + # Human rules + # + # @api private + # @return [Dry::Inflector::Rules] + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/inflections.rb#59 + def humans; end + + # Add a custom pluralization rule + # + # 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. + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new do |inflections| + # inflections.singular "octopus", "octopi" + # end + # @param singular [String] the singular + # @param plural [String] the plural + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/inflections.rb#151 + def irregular(singular, plural); end + + # Add a custom pluralization rule + # + # 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. + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new do |inflections| + # inflections.plural "virus", "viruses" + # end + # @param rule [String, Regexp] the rule + # @param replacement [String] the replacement + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/inflections.rb#105 + def plural(rule, replacement); end + + # Pluralization rules + # + # @api private + # @return [Dry::Inflector::Rules] + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/inflections.rb#35 + def plurals; end + + # Add a custom singularization rule + # + # 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. + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new do |inflections| + # inflections.singular "thieves", "thief" + # end + # @param rule [String, Regexp] the rule + # @param replacement [String] the replacement + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/inflections.rb#128 + def singular(rule, replacement); end + + # Singularization rules + # + # @api private + # @return [Dry::Inflector::Rules] + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/inflections.rb#43 + def singulars; end + + # Add a custom rule for uncountable words + # + # Uncountable will not be inflected + # + # @example + # require "dry/inflector" + # + # inflector = Dry::Inflector.new do |inflections| + # inflections.uncountable "money" + # inflections.uncountable "money", "information" + # inflections.uncountable %w(money information rice) + # end + # @param words [Enumerable] + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/inflections.rb#175 + def uncountable(*words); end + + # Uncountable rules + # + # @api private + # @return [Set] + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/inflections.rb#51 + def uncountables; end + + private + + # Add irregular inflection + # + # @api private + # @param rule [String] the rule + # @param replacement [String] the replacement + # @return [undefined] + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/inflections.rb#239 + def add_irregular(rule, replacement, target); end + + # Add a new rule + # + # @api private + # @param rule [String, Regexp] the rule + # @param replacement [String, Regexp] the replacement + # @param target [Dry::Inflector::Rules] the target + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/inflections.rb#252 + def rule(rule, replacement, target); end + + class << self + # Instantiate a set of inflection rules. + # It adds the default rules and the optional customizations, passed as a block. + # + # @api private + # @param blk [Proc] the optional, custom rules + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/inflections.rb#22 + def build(&blk); end + end +end + +# Default inflections +# +# +# @api private +# @since 0.1.0 +# +# source://dry-inflector//lib/dry/inflector/inflections/defaults.rb#12 +module Dry::Inflector::Inflections::Defaults + class << self + # @api private + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/inflections/defaults.rb#15 + def call(inflect); end + + private + + # @api private + # @since 0.1.2 + # + # source://dry-inflector//lib/dry/inflector/inflections/defaults.rb#112 + def acronyms(inflect); end + + # @api private + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/inflections/defaults.rb#87 + def irregular(inflect); end + + # @api private + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/inflections/defaults.rb#25 + def plural(inflect); end + + # @api private + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/inflections/defaults.rb#55 + def singular(inflect); end + + # @api private + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/inflections/defaults.rb#105 + def uncountable(inflect); end + end +end + +# @api private +# @since 0.1.0 +# +# source://dry-inflector//lib/dry/inflector.rb#319 +Dry::Inflector::ORDINALIZE_TH = T.let(T.unsafe(nil), Hash) + +# A set of inflection rules +# +# @api private +# @since 0.1.0 +# +# source://dry-inflector//lib/dry/inflector/rules.rb#9 +class Dry::Inflector::Rules + # @api private + # @return [Rules] a new instance of Rules + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/rules.rb#12 + def initialize; end + + # @api private + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/rules.rb#18 + def apply_to(word); end + + # @api private + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/rules.rb#32 + def each(&blk); end + + # @api private + # @since 0.1.0 + # + # source://dry-inflector//lib/dry/inflector/rules.rb#26 + def insert(index, array); end +end + +# @since 0.1.0 +# +# source://dry-inflector//lib/dry/inflector/version.rb#6 +Dry::Inflector::VERSION = T.let(T.unsafe(nil), String) diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/erubi@1.13.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/erubi@1.13.0.rbi new file mode 100644 index 0000000..16d45fa --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/erubi@1.13.0.rbi @@ -0,0 +1,150 @@ +# 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`. + + +# source://erubi//lib/erubi.rb#3 +module Erubi + private + + def h(_arg0); end + + class << self + def h(_arg0); end + end +end + +# source://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. + # + # @return [Engine] a new instance of Engine + # + # source://erubi//lib/erubi.rb#91 + def initialize(input, properties = T.unsafe(nil)); end + + # The variable name used for the buffer variable. + # + # source://erubi//lib/erubi.rb#62 + def bufvar; end + + # The filename of the template, if one was given. + # + # source://erubi//lib/erubi.rb#59 + def filename; end + + # The frozen ruby source code generated from the template, which can be evaled. + # + # source://erubi//lib/erubi.rb#56 + def src; end + + private + + # Add ruby code to the template + # + # source://erubi//lib/erubi.rb#223 + def add_code(code); end + + # Add the given ruby expression result to the template, + # escaping it based on the indicator given and escape flag. + # + # source://erubi//lib/erubi.rb#232 + def add_expression(indicator, code); end + + # Add the result of Ruby expression to the template + # + # source://erubi//lib/erubi.rb#241 + def add_expression_result(code); end + + # Add the escaped result of Ruby expression to the template + # + # source://erubi//lib/erubi.rb#246 + 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. + # + # source://erubi//lib/erubi.rb#252 + 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). + # + # source://erubi//lib/erubi.rb#210 + def add_text(text); end + + # Raise an exception, as the base engine class does not support handling other indicators. + # + # @raise [ArgumentError] + # + # source://erubi//lib/erubi.rb#258 + 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. + # + # source://erubi//lib/erubi.rb#286 + 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. + # + # source://erubi//lib/erubi.rb#268 + def with_buffer; end +end + +# The default regular expression used for scanning. +# +# source://erubi//lib/erubi.rb#53 +Erubi::Engine::DEFAULT_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://erubi//lib/erubi.rb#17 +Erubi::FREEZE_TEMPLATE_LITERALS = T.let(T.unsafe(nil), TrueClass) + +# source://erubi//lib/erubi.rb#15 +Erubi::MATCH_METHOD = T.let(T.unsafe(nil), Symbol) + +# source://erubi//lib/erubi.rb#8 +Erubi::RANGE_FIRST = T.let(T.unsafe(nil), Integer) + +# source://erubi//lib/erubi.rb#9 +Erubi::RANGE_LAST = T.let(T.unsafe(nil), Integer) + +# source://erubi//lib/erubi.rb#16 +Erubi::SKIP_DEFINED_FOR_INSTANCE_VARIABLE = T.let(T.unsafe(nil), TrueClass) + +# source://erubi//lib/erubi.rb#4 +Erubi::VERSION = T.let(T.unsafe(nil), String) diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/json@2.7.2.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/json@2.7.2.rbi new file mode 100644 index 0000000..1558aa4 --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/json@2.7.2.rbi @@ -0,0 +1,1562 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `json` gem. +# Please instead update this file by running `bin/tapioca gem json`. + + +# Extends any Class to include _json_creatable?_ method. +# +# source://json//lib/json/common.rb#690 +class Class < ::Module + # Returns true if this class can be used to create an instance + # from a serialised JSON string. The class has to implement a class + # method _json_create_ that expects a hash as first parameter. The hash + # should include the required data. + # + # @return [Boolean] + # + # source://json//lib/json/common.rb#695 + def json_creatable?; end +end + +# = JavaScript \Object Notation (\JSON) +# +# \JSON is a lightweight data-interchange format. +# +# A \JSON value is one of the following: +# - Double-quoted text: "foo". +# - Number: +1+, +1.0+, +2.0e2+. +# - Boolean: +true+, +false+. +# - Null: +null+. +# - \Array: an ordered list of values, enclosed by square brackets: +# ["foo", 1, 1.0, 2.0e2, true, false, null] +# +# - \Object: a collection of name/value pairs, enclosed by curly braces; +# each name is double-quoted text; +# the values may be any \JSON values: +# {"a": "foo", "b": 1, "c": 1.0, "d": 2.0e2, "e": true, "f": false, "g": null} +# +# A \JSON array or object may contain nested arrays, objects, and scalars +# to any depth: +# {"foo": {"bar": 1, "baz": 2}, "bat": [0, 1, 2]} +# [{"foo": 0, "bar": 1}, ["baz", 2]] +# +# == Using \Module \JSON +# +# To make module \JSON available in your code, begin with: +# require 'json' +# +# All examples here assume that this has been done. +# +# === Parsing \JSON +# +# You can parse a \String containing \JSON data using +# either of two methods: +# - JSON.parse(source, opts) +# - JSON.parse!(source, opts) +# +# where +# - +source+ is a Ruby object. +# - +opts+ is a \Hash object containing options +# that control both input allowed and output formatting. +# +# The difference between the two methods +# is that JSON.parse! omits some checks +# and may not be safe for some +source+ data; +# use it only for data from trusted sources. +# Use the safer method JSON.parse for less trusted sources. +# +# ==== Parsing \JSON Arrays +# +# When +source+ is a \JSON array, JSON.parse by default returns a Ruby \Array: +# json = '["foo", 1, 1.0, 2.0e2, true, false, null]' +# ruby = JSON.parse(json) +# ruby # => ["foo", 1, 1.0, 200.0, true, false, nil] +# ruby.class # => Array +# +# The \JSON array may contain nested arrays, objects, and scalars +# to any depth: +# json = '[{"foo": 0, "bar": 1}, ["baz", 2]]' +# JSON.parse(json) # => [{"foo"=>0, "bar"=>1}, ["baz", 2]] +# +# ==== Parsing \JSON \Objects +# +# When the source is a \JSON object, JSON.parse by default returns a Ruby \Hash: +# json = '{"a": "foo", "b": 1, "c": 1.0, "d": 2.0e2, "e": true, "f": false, "g": null}' +# ruby = JSON.parse(json) +# ruby # => {"a"=>"foo", "b"=>1, "c"=>1.0, "d"=>200.0, "e"=>true, "f"=>false, "g"=>nil} +# ruby.class # => Hash +# +# The \JSON object may contain nested arrays, objects, and scalars +# to any depth: +# json = '{"foo": {"bar": 1, "baz": 2}, "bat": [0, 1, 2]}' +# JSON.parse(json) # => {"foo"=>{"bar"=>1, "baz"=>2}, "bat"=>[0, 1, 2]} +# +# ==== Parsing \JSON Scalars +# +# When the source is a \JSON scalar (not an array or object), +# JSON.parse returns a Ruby scalar. +# +# \String: +# ruby = JSON.parse('"foo"') +# ruby # => 'foo' +# ruby.class # => String +# \Integer: +# ruby = JSON.parse('1') +# ruby # => 1 +# ruby.class # => Integer +# \Float: +# ruby = JSON.parse('1.0') +# ruby # => 1.0 +# ruby.class # => Float +# ruby = JSON.parse('2.0e2') +# ruby # => 200 +# ruby.class # => Float +# Boolean: +# ruby = JSON.parse('true') +# ruby # => true +# ruby.class # => TrueClass +# ruby = JSON.parse('false') +# ruby # => false +# ruby.class # => FalseClass +# Null: +# ruby = JSON.parse('null') +# ruby # => nil +# ruby.class # => NilClass +# +# ==== Parsing Options +# +# ====== Input Options +# +# Option +max_nesting+ (\Integer) specifies the maximum nesting depth allowed; +# defaults to +100+; specify +false+ to disable depth checking. +# +# With the default, +false+: +# source = '[0, [1, [2, [3]]]]' +# ruby = JSON.parse(source) +# ruby # => [0, [1, [2, [3]]]] +# Too deep: +# # Raises JSON::NestingError (nesting of 2 is too deep): +# JSON.parse(source, {max_nesting: 1}) +# Bad value: +# # Raises TypeError (wrong argument type Symbol (expected Fixnum)): +# JSON.parse(source, {max_nesting: :foo}) +# +# --- +# +# Option +allow_nan+ (boolean) specifies whether to allow +# NaN, Infinity, and MinusInfinity in +source+; +# defaults to +false+. +# +# With the default, +false+: +# # Raises JSON::ParserError (225: unexpected token at '[NaN]'): +# JSON.parse('[NaN]') +# # Raises JSON::ParserError (232: unexpected token at '[Infinity]'): +# JSON.parse('[Infinity]') +# # Raises JSON::ParserError (248: unexpected token at '[-Infinity]'): +# JSON.parse('[-Infinity]') +# Allow: +# source = '[NaN, Infinity, -Infinity]' +# ruby = JSON.parse(source, {allow_nan: true}) +# ruby # => [NaN, Infinity, -Infinity] +# +# ====== Output Options +# +# Option +symbolize_names+ (boolean) specifies whether returned \Hash keys +# should be Symbols; +# defaults to +false+ (use Strings). +# +# With the default, +false+: +# source = '{"a": "foo", "b": 1.0, "c": true, "d": false, "e": null}' +# ruby = JSON.parse(source) +# ruby # => {"a"=>"foo", "b"=>1.0, "c"=>true, "d"=>false, "e"=>nil} +# Use Symbols: +# ruby = JSON.parse(source, {symbolize_names: true}) +# ruby # => {:a=>"foo", :b=>1.0, :c=>true, :d=>false, :e=>nil} +# +# --- +# +# Option +object_class+ (\Class) specifies the Ruby class to be used +# for each \JSON object; +# defaults to \Hash. +# +# With the default, \Hash: +# source = '{"a": "foo", "b": 1.0, "c": true, "d": false, "e": null}' +# ruby = JSON.parse(source) +# ruby.class # => Hash +# Use class \OpenStruct: +# ruby = JSON.parse(source, {object_class: OpenStruct}) +# ruby # => # +# +# --- +# +# Option +array_class+ (\Class) specifies the Ruby class to be used +# for each \JSON array; +# defaults to \Array. +# +# With the default, \Array: +# source = '["foo", 1.0, true, false, null]' +# ruby = JSON.parse(source) +# ruby.class # => Array +# Use class \Set: +# ruby = JSON.parse(source, {array_class: Set}) +# ruby # => # +# +# --- +# +# Option +create_additions+ (boolean) specifies whether to use \JSON additions in parsing. +# See {\JSON Additions}[#module-JSON-label-JSON+Additions]. +# +# === Generating \JSON +# +# To generate a Ruby \String containing \JSON data, +# use method JSON.generate(source, opts), where +# - +source+ is a Ruby object. +# - +opts+ is a \Hash object containing options +# that control both input allowed and output formatting. +# +# ==== Generating \JSON from Arrays +# +# When the source is a Ruby \Array, JSON.generate returns +# a \String containing a \JSON array: +# ruby = [0, 's', :foo] +# json = JSON.generate(ruby) +# json # => '[0,"s","foo"]' +# +# The Ruby \Array array may contain nested arrays, hashes, and scalars +# to any depth: +# ruby = [0, [1, 2], {foo: 3, bar: 4}] +# json = JSON.generate(ruby) +# json # => '[0,[1,2],{"foo":3,"bar":4}]' +# +# ==== Generating \JSON from Hashes +# +# When the source is a Ruby \Hash, JSON.generate returns +# a \String containing a \JSON object: +# ruby = {foo: 0, bar: 's', baz: :bat} +# json = JSON.generate(ruby) +# json # => '{"foo":0,"bar":"s","baz":"bat"}' +# +# The Ruby \Hash array may contain nested arrays, hashes, and scalars +# to any depth: +# ruby = {foo: [0, 1], bar: {baz: 2, bat: 3}, bam: :bad} +# json = JSON.generate(ruby) +# json # => '{"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"}' +# +# ==== Generating \JSON from Other Objects +# +# When the source is neither an \Array nor a \Hash, +# the generated \JSON data depends on the class of the source. +# +# When the source is a Ruby \Integer or \Float, JSON.generate returns +# a \String containing a \JSON number: +# JSON.generate(42) # => '42' +# JSON.generate(0.42) # => '0.42' +# +# When the source is a Ruby \String, JSON.generate returns +# a \String containing a \JSON string (with double-quotes): +# JSON.generate('A string') # => '"A string"' +# +# When the source is +true+, +false+ or +nil+, JSON.generate returns +# a \String containing the corresponding \JSON token: +# JSON.generate(true) # => 'true' +# JSON.generate(false) # => 'false' +# JSON.generate(nil) # => 'null' +# +# When the source is none of the above, JSON.generate returns +# a \String containing a \JSON string representation of the source: +# JSON.generate(:foo) # => '"foo"' +# JSON.generate(Complex(0, 0)) # => '"0+0i"' +# JSON.generate(Dir.new('.')) # => '"#"' +# +# ==== Generating Options +# +# ====== Input Options +# +# Option +allow_nan+ (boolean) specifies whether +# +NaN+, +Infinity+, and -Infinity may be generated; +# defaults to +false+. +# +# With the default, +false+: +# # Raises JSON::GeneratorError (920: NaN not allowed in JSON): +# JSON.generate(JSON::NaN) +# # Raises JSON::GeneratorError (917: Infinity not allowed in JSON): +# JSON.generate(JSON::Infinity) +# # Raises JSON::GeneratorError (917: -Infinity not allowed in JSON): +# JSON.generate(JSON::MinusInfinity) +# +# Allow: +# ruby = [Float::NaN, Float::Infinity, Float::MinusInfinity] +# JSON.generate(ruby, allow_nan: true) # => '[NaN,Infinity,-Infinity]' +# +# --- +# +# Option +max_nesting+ (\Integer) specifies the maximum nesting depth +# in +obj+; defaults to +100+. +# +# With the default, +100+: +# obj = [[[[[[0]]]]]] +# JSON.generate(obj) # => '[[[[[[0]]]]]]' +# +# Too deep: +# # Raises JSON::NestingError (nesting of 2 is too deep): +# JSON.generate(obj, max_nesting: 2) +# +# ====== Escaping Options +# +# Options +script_safe+ (boolean) specifies wether '\u2028', '\u2029' +# and '/' should be escaped as to make the JSON object safe to interpolate in script +# tags. +# +# Options +ascii_only+ (boolean) specifies wether all characters outside the ASCII range +# should be escaped. +# +# ====== Output Options +# +# The default formatting options generate the most compact +# \JSON data, all on one line and with no whitespace. +# +# You can use these formatting options to generate +# \JSON data in a more open format, using whitespace. +# See also JSON.pretty_generate. +# +# - Option +array_nl+ (\String) specifies a string (usually a newline) +# to be inserted after each \JSON array; defaults to the empty \String, ''. +# - Option +object_nl+ (\String) specifies a string (usually a newline) +# to be inserted after each \JSON object; defaults to the empty \String, ''. +# - Option +indent+ (\String) specifies the string (usually spaces) to be +# used for indentation; defaults to the empty \String, ''; +# defaults to the empty \String, ''; +# has no effect unless options +array_nl+ or +object_nl+ specify newlines. +# - Option +space+ (\String) specifies a string (usually a space) to be +# inserted after the colon in each \JSON object's pair; +# defaults to the empty \String, ''. +# - Option +space_before+ (\String) specifies a string (usually a space) to be +# inserted before the colon in each \JSON object's pair; +# defaults to the empty \String, ''. +# +# In this example, +obj+ is used first to generate the shortest +# \JSON data (no whitespace), then again with all formatting options +# specified: +# +# obj = {foo: [:bar, :baz], bat: {bam: 0, bad: 1}} +# json = JSON.generate(obj) +# puts 'Compact:', json +# opts = { +# array_nl: "\n", +# object_nl: "\n", +# indent: ' ', +# space_before: ' ', +# space: ' ' +# } +# puts 'Open:', JSON.generate(obj, opts) +# +# Output: +# Compact: +# {"foo":["bar","baz"],"bat":{"bam":0,"bad":1}} +# Open: +# { +# "foo" : [ +# "bar", +# "baz" +# ], +# "bat" : { +# "bam" : 0, +# "bad" : 1 +# } +# } +# +# == \JSON Additions +# +# When you "round trip" a non-\String object from Ruby to \JSON and back, +# you have a new \String, instead of the object you began with: +# ruby0 = Range.new(0, 2) +# json = JSON.generate(ruby0) +# json # => '0..2"' +# ruby1 = JSON.parse(json) +# ruby1 # => '0..2' +# ruby1.class # => String +# +# You can use \JSON _additions_ to preserve the original object. +# The addition is an extension of a ruby class, so that: +# - \JSON.generate stores more information in the \JSON string. +# - \JSON.parse, called with option +create_additions+, +# uses that information to create a proper Ruby object. +# +# This example shows a \Range being generated into \JSON +# and parsed back into Ruby, both without and with +# the addition for \Range: +# ruby = Range.new(0, 2) +# # This passage does not use the addition for Range. +# json0 = JSON.generate(ruby) +# ruby0 = JSON.parse(json0) +# # This passage uses the addition for Range. +# require 'json/add/range' +# json1 = JSON.generate(ruby) +# ruby1 = JSON.parse(json1, create_additions: true) +# # Make a nice display. +# display = <require 'json/add/bigdecimal' +# - Complex: require 'json/add/complex' +# - Date: require 'json/add/date' +# - DateTime: require 'json/add/date_time' +# - Exception: require 'json/add/exception' +# - OpenStruct: require 'json/add/ostruct' +# - Range: require 'json/add/range' +# - Rational: require 'json/add/rational' +# - Regexp: require 'json/add/regexp' +# - Set: require 'json/add/set' +# - Struct: require 'json/add/struct' +# - Symbol: require 'json/add/symbol' +# - Time: require 'json/add/time' +# +# To reduce punctuation clutter, the examples below +# show the generated \JSON via +puts+, rather than the usual +inspect+, +# +# \BigDecimal: +# require 'json/add/bigdecimal' +# ruby0 = BigDecimal(0) # 0.0 +# json = JSON.generate(ruby0) # {"json_class":"BigDecimal","b":"27:0.0"} +# ruby1 = JSON.parse(json, create_additions: true) # 0.0 +# ruby1.class # => BigDecimal +# +# \Complex: +# require 'json/add/complex' +# ruby0 = Complex(1+0i) # 1+0i +# json = JSON.generate(ruby0) # {"json_class":"Complex","r":1,"i":0} +# ruby1 = JSON.parse(json, create_additions: true) # 1+0i +# ruby1.class # Complex +# +# \Date: +# require 'json/add/date' +# ruby0 = Date.today # 2020-05-02 +# json = JSON.generate(ruby0) # {"json_class":"Date","y":2020,"m":5,"d":2,"sg":2299161.0} +# ruby1 = JSON.parse(json, create_additions: true) # 2020-05-02 +# ruby1.class # Date +# +# \DateTime: +# require 'json/add/date_time' +# ruby0 = DateTime.now # 2020-05-02T10:38:13-05:00 +# json = JSON.generate(ruby0) # {"json_class":"DateTime","y":2020,"m":5,"d":2,"H":10,"M":38,"S":13,"of":"-5/24","sg":2299161.0} +# ruby1 = JSON.parse(json, create_additions: true) # 2020-05-02T10:38:13-05:00 +# ruby1.class # DateTime +# +# \Exception (and its subclasses including \RuntimeError): +# require 'json/add/exception' +# ruby0 = Exception.new('A message') # A message +# json = JSON.generate(ruby0) # {"json_class":"Exception","m":"A message","b":null} +# ruby1 = JSON.parse(json, create_additions: true) # A message +# ruby1.class # Exception +# ruby0 = RuntimeError.new('Another message') # Another message +# json = JSON.generate(ruby0) # {"json_class":"RuntimeError","m":"Another message","b":null} +# ruby1 = JSON.parse(json, create_additions: true) # Another message +# ruby1.class # RuntimeError +# +# \OpenStruct: +# require 'json/add/ostruct' +# ruby0 = OpenStruct.new(name: 'Matz', language: 'Ruby') # # +# json = JSON.generate(ruby0) # {"json_class":"OpenStruct","t":{"name":"Matz","language":"Ruby"}} +# ruby1 = JSON.parse(json, create_additions: true) # # +# ruby1.class # OpenStruct +# +# \Range: +# require 'json/add/range' +# ruby0 = Range.new(0, 2) # 0..2 +# json = JSON.generate(ruby0) # {"json_class":"Range","a":[0,2,false]} +# ruby1 = JSON.parse(json, create_additions: true) # 0..2 +# ruby1.class # Range +# +# \Rational: +# require 'json/add/rational' +# ruby0 = Rational(1, 3) # 1/3 +# json = JSON.generate(ruby0) # {"json_class":"Rational","n":1,"d":3} +# ruby1 = JSON.parse(json, create_additions: true) # 1/3 +# ruby1.class # Rational +# +# \Regexp: +# require 'json/add/regexp' +# ruby0 = Regexp.new('foo') # (?-mix:foo) +# json = JSON.generate(ruby0) # {"json_class":"Regexp","o":0,"s":"foo"} +# ruby1 = JSON.parse(json, create_additions: true) # (?-mix:foo) +# ruby1.class # Regexp +# +# \Set: +# require 'json/add/set' +# ruby0 = Set.new([0, 1, 2]) # # +# json = JSON.generate(ruby0) # {"json_class":"Set","a":[0,1,2]} +# ruby1 = JSON.parse(json, create_additions: true) # # +# ruby1.class # Set +# +# \Struct: +# require 'json/add/struct' +# Customer = Struct.new(:name, :address) # Customer +# ruby0 = Customer.new("Dave", "123 Main") # # +# json = JSON.generate(ruby0) # {"json_class":"Customer","v":["Dave","123 Main"]} +# ruby1 = JSON.parse(json, create_additions: true) # # +# ruby1.class # Customer +# +# \Symbol: +# require 'json/add/symbol' +# ruby0 = :foo # foo +# json = JSON.generate(ruby0) # {"json_class":"Symbol","s":"foo"} +# ruby1 = JSON.parse(json, create_additions: true) # foo +# ruby1.class # Symbol +# +# \Time: +# require 'json/add/time' +# ruby0 = Time.now # 2020-05-02 11:28:26 -0500 +# json = JSON.generate(ruby0) # {"json_class":"Time","s":1588436906,"n":840560000} +# ruby1 = JSON.parse(json, create_additions: true) # 2020-05-02 11:28:26 -0500 +# ruby1.class # Time +# +# +# === Custom \JSON Additions +# +# In addition to the \JSON additions provided, +# you can craft \JSON additions of your own, +# either for Ruby built-in classes or for user-defined classes. +# +# Here's a user-defined class +Foo+: +# class Foo +# attr_accessor :bar, :baz +# def initialize(bar, baz) +# self.bar = bar +# self.baz = baz +# end +# end +# +# Here's the \JSON addition for it: +# # Extend class Foo with JSON addition. +# class Foo +# # Serialize Foo object with its class name and arguments +# def to_json(*args) +# { +# JSON.create_id => self.class.name, +# 'a' => [ bar, baz ] +# }.to_json(*args) +# end +# # Deserialize JSON string by constructing new Foo object with arguments. +# def self.json_create(object) +# new(*object['a']) +# end +# end +# +# Demonstration: +# require 'json' +# # This Foo object has no custom addition. +# foo0 = Foo.new(0, 1) +# json0 = JSON.generate(foo0) +# obj0 = JSON.parse(json0) +# # Lood the custom addition. +# require_relative 'foo_addition' +# # This foo has the custom addition. +# foo1 = Foo.new(0, 1) +# json1 = JSON.generate(foo1) +# obj1 = JSON.parse(json1, create_additions: true) +# # Make a nice display. +# display = <" (String) +# With custom addition: {"json_class":"Foo","a":[0,1]} (String) +# Parsed JSON: +# Without custom addition: "#" (String) +# With custom addition: # (Foo) +# +# source://json//lib/json/version.rb#2 +module JSON + private + + # :call-seq: + # JSON.dump(obj, io = nil, limit = nil) + # + # Dumps +obj+ as a \JSON string, i.e. calls generate on the object and returns the result. + # + # The default options can be changed via method JSON.dump_default_options. + # + # - Argument +io+, if given, should respond to method +write+; + # the \JSON \String is written to +io+, and +io+ is returned. + # If +io+ is not given, the \JSON \String is returned. + # - Argument +limit+, if given, is passed to JSON.generate as option +max_nesting+. + # + # --- + # + # When argument +io+ is not given, returns the \JSON \String generated from +obj+: + # obj = {foo: [0, 1], bar: {baz: 2, bat: 3}, bam: :bad} + # json = JSON.dump(obj) + # json # => "{\"foo\":[0,1],\"bar\":{\"baz\":2,\"bat\":3},\"bam\":\"bad\"}" + # + # When argument +io+ is given, writes the \JSON \String to +io+ and returns +io+: + # path = 't.json' + # File.open(path, 'w') do |file| + # JSON.dump(obj, file) + # end # => # + # puts File.read(path) + # Output: + # {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"} + # + # source://json//lib/json/common.rb#615 + def dump(obj, anIO = T.unsafe(nil), limit = T.unsafe(nil), kwargs = T.unsafe(nil)); end + + # :call-seq: + # JSON.fast_generate(obj, opts) -> new_string + # + # Arguments +obj+ and +opts+ here are the same as + # arguments +obj+ and +opts+ in JSON.generate. + # + # By default, generates \JSON data without checking + # for circular references in +obj+ (option +max_nesting+ set to +false+, disabled). + # + # Raises an exception if +obj+ contains circular references: + # a = []; b = []; a.push(b); b.push(a) + # # Raises SystemStackError (stack level too deep): + # JSON.fast_generate(a) + # + # source://json//lib/json/common.rb#329 + def fast_generate(obj, opts = T.unsafe(nil)); end + + # :stopdoc: + # I want to deprecate these later, so I'll first be silent about them, and later delete them. + # + # source://json//lib/json/common.rb#329 + def fast_unparse(obj, opts = T.unsafe(nil)); end + + # :call-seq: + # JSON.generate(obj, opts = nil) -> new_string + # + # Returns a \String containing the generated \JSON data. + # + # See also JSON.fast_generate, JSON.pretty_generate. + # + # Argument +obj+ is the Ruby object to be converted to \JSON. + # + # Argument +opts+, if given, contains a \Hash of options for the generation. + # See {Generating Options}[#module-JSON-label-Generating+Options]. + # + # --- + # + # When +obj+ is an \Array, returns a \String containing a \JSON array: + # obj = ["foo", 1.0, true, false, nil] + # json = JSON.generate(obj) + # json # => '["foo",1.0,true,false,null]' + # + # When +obj+ is a \Hash, returns a \String containing a \JSON object: + # obj = {foo: 0, bar: 's', baz: :bat} + # json = JSON.generate(obj) + # json # => '{"foo":0,"bar":"s","baz":"bat"}' + # + # For examples of generating from other Ruby objects, see + # {Generating \JSON from Other Objects}[#module-JSON-label-Generating+JSON+from+Other+Objects]. + # + # --- + # + # Raises an exception if any formatting option is not a \String. + # + # Raises an exception if +obj+ contains circular references: + # a = []; b = []; a.push(b); b.push(a) + # # Raises JSON::NestingError (nesting of 100 is too deep): + # JSON.generate(a) + # + # source://json//lib/json/common.rb#300 + def generate(obj, opts = T.unsafe(nil)); end + + # :call-seq: + # JSON.load(source, proc = nil, options = {}) -> object + # + # Returns the Ruby objects created by parsing the given +source+. + # + # - Argument +source+ must be, or be convertible to, a \String: + # - If +source+ responds to instance method +to_str+, + # source.to_str becomes the source. + # - If +source+ responds to instance method +to_io+, + # source.to_io.read becomes the source. + # - If +source+ responds to instance method +read+, + # source.read becomes the source. + # - If both of the following are true, source becomes the \String 'null': + # - Option +allow_blank+ specifies a truthy value. + # - The source, as defined above, is +nil+ or the empty \String ''. + # - Otherwise, +source+ remains the source. + # - Argument +proc+, if given, must be a \Proc that accepts one argument. + # It will be called recursively with each result (depth-first order). + # See details below. + # BEWARE: This method is meant to serialise data from trusted user input, + # like from your own database server or clients under your control, it could + # be dangerous to allow untrusted users to pass JSON sources into it. + # - Argument +opts+, if given, contains a \Hash of options for the parsing. + # See {Parsing Options}[#module-JSON-label-Parsing+Options]. + # The default options can be changed via method JSON.load_default_options=. + # + # --- + # + # When no +proc+ is given, modifies +source+ as above and returns the result of + # parse(source, opts); see #parse. + # + # Source for following examples: + # source = <<-EOT + # { + # "name": "Dave", + # "age" :40, + # "hats": [ + # "Cattleman's", + # "Panama", + # "Tophat" + # ] + # } + # EOT + # + # Load a \String: + # ruby = JSON.load(source) + # ruby # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # Load an \IO object: + # require 'stringio' + # object = JSON.load(StringIO.new(source)) + # object # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # Load a \File object: + # path = 't.json' + # File.write(path, source) + # File.open(path) do |file| + # JSON.load(file) + # end # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # --- + # + # When +proc+ is given: + # - Modifies +source+ as above. + # - Gets the +result+ from calling parse(source, opts). + # - Recursively calls proc(result). + # - Returns the final result. + # + # Example: + # require 'json' + # + # # Some classes for the example. + # class Base + # def initialize(attributes) + # @attributes = attributes + # end + # end + # class User < Base; end + # class Account < Base; end + # class Admin < Base; end + # # The JSON source. + # json = <<-EOF + # { + # "users": [ + # {"type": "User", "username": "jane", "email": "jane@example.com"}, + # {"type": "User", "username": "john", "email": "john@example.com"} + # ], + # "accounts": [ + # {"account": {"type": "Account", "paid": true, "account_id": "1234"}}, + # {"account": {"type": "Account", "paid": false, "account_id": "1235"}} + # ], + # "admins": {"type": "Admin", "password": "0wn3d"} + # } + # EOF + # # Deserializer method. + # def deserialize_obj(obj, safe_types = %w(User Account Admin)) + # type = obj.is_a?(Hash) && obj["type"] + # safe_types.include?(type) ? Object.const_get(type).new(obj) : obj + # end + # # Call to JSON.load + # ruby = JSON.load(json, proc {|obj| + # case obj + # when Hash + # obj.each {|k, v| obj[k] = deserialize_obj v } + # when Array + # obj.map! {|v| deserialize_obj v } + # end + # }) + # pp ruby + # Output: + # {"users"=> + # [#"User", "username"=>"jane", "email"=>"jane@example.com"}>, + # #"User", "username"=>"john", "email"=>"john@example.com"}>], + # "accounts"=> + # [{"account"=> + # #"Account", "paid"=>true, "account_id"=>"1234"}>}, + # {"account"=> + # #"Account", "paid"=>false, "account_id"=>"1235"}>}], + # "admins"=> + # #"Admin", "password"=>"0wn3d"}>} + # + # source://json//lib/json/common.rb#541 + def load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end + + # :call-seq: + # JSON.load_file(path, opts={}) -> object + # + # Calls: + # parse(File.read(path), opts) + # + # See method #parse. + # + # source://json//lib/json/common.rb#249 + def load_file(filespec, opts = T.unsafe(nil)); end + + # :call-seq: + # JSON.load_file!(path, opts = {}) + # + # Calls: + # JSON.parse!(File.read(path, opts)) + # + # See method #parse! + # + # source://json//lib/json/common.rb#260 + def load_file!(filespec, opts = T.unsafe(nil)); end + + # source://json//lib/json/common.rb#643 + def merge_dump_options(opts, strict: T.unsafe(nil)); end + + # :call-seq: + # JSON.parse(source, opts) -> object + # + # Returns the Ruby objects created by parsing the given +source+. + # + # Argument +source+ contains the \String to be parsed. + # + # Argument +opts+, if given, contains a \Hash of options for the parsing. + # See {Parsing Options}[#module-JSON-label-Parsing+Options]. + # + # --- + # + # When +source+ is a \JSON array, returns a Ruby \Array: + # source = '["foo", 1.0, true, false, null]' + # ruby = JSON.parse(source) + # ruby # => ["foo", 1.0, true, false, nil] + # ruby.class # => Array + # + # When +source+ is a \JSON object, returns a Ruby \Hash: + # source = '{"a": "foo", "b": 1.0, "c": true, "d": false, "e": null}' + # ruby = JSON.parse(source) + # ruby # => {"a"=>"foo", "b"=>1.0, "c"=>true, "d"=>false, "e"=>nil} + # ruby.class # => Hash + # + # For examples of parsing for all \JSON data types, see + # {Parsing \JSON}[#module-JSON-label-Parsing+JSON]. + # + # Parses nested JSON objects: + # source = <<-EOT + # { + # "name": "Dave", + # "age" :40, + # "hats": [ + # "Cattleman's", + # "Panama", + # "Tophat" + # ] + # } + # EOT + # ruby = JSON.parse(source) + # ruby # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # --- + # + # Raises an exception if +source+ is not valid JSON: + # # Raises JSON::ParserError (783: unexpected token at ''): + # JSON.parse('') + # + # source://json//lib/json/common.rb#219 + def parse(source, opts = T.unsafe(nil)); end + + # :call-seq: + # JSON.parse!(source, opts) -> object + # + # Calls + # parse(source, opts) + # with +source+ and possibly modified +opts+. + # + # Differences from JSON.parse: + # - Option +max_nesting+, if not provided, defaults to +false+, + # which disables checking for nesting depth. + # - Option +allow_nan+, if not provided, defaults to +true+. + # + # source://json//lib/json/common.rb#234 + def parse!(source, opts = T.unsafe(nil)); end + + # :call-seq: + # JSON.pretty_generate(obj, opts = nil) -> new_string + # + # Arguments +obj+ and +opts+ here are the same as + # arguments +obj+ and +opts+ in JSON.generate. + # + # Default options are: + # { + # indent: ' ', # Two spaces + # space: ' ', # One space + # array_nl: "\n", # Newline + # object_nl: "\n" # Newline + # } + # + # Example: + # obj = {foo: [:bar, :baz], bat: {bam: 0, bad: 1}} + # json = JSON.pretty_generate(obj) + # puts json + # Output: + # { + # "foo": [ + # "bar", + # "baz" + # ], + # "bat": { + # "bam": 0, + # "bad": 1 + # } + # } + # + # source://json//lib/json/common.rb#374 + def pretty_generate(obj, opts = T.unsafe(nil)); end + + # :stopdoc: + # I want to deprecate these later, so I'll first be silent about them, and later delete them. + # + # source://json//lib/json/common.rb#374 + def pretty_unparse(obj, opts = T.unsafe(nil)); end + + # Recursively calls passed _Proc_ if the parsed data structure is an _Array_ or _Hash_ + # + # source://json//lib/json/common.rb#559 + def recurse_proc(result, &proc); end + + # source://json//lib/json/common.rb#541 + def restore(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end + + # :stopdoc: + # I want to deprecate these later, so I'll first be silent about them, and + # later delete them. + # + # source://json//lib/json/common.rb#300 + def unparse(obj, opts = T.unsafe(nil)); end + + class << self + # :call-seq: + # JSON[object] -> new_array or new_string + # + # If +object+ is a \String, + # calls JSON.parse with +object+ and +opts+ (see method #parse): + # json = '[0, 1, null]' + # JSON[json]# => [0, 1, nil] + # + # Otherwise, calls JSON.generate with +object+ and +opts+ (see method #generate): + # ruby = [0, 1, nil] + # JSON[ruby] # => '[0,1,null]' + # + # source://json//lib/json/common.rb#22 + def [](object, opts = T.unsafe(nil)); end + + # source://json//lib/json/common.rb#85 + def create_fast_state; end + + # Returns the current create identifier. + # See also JSON.create_id=. + # + # source://json//lib/json/common.rb#130 + def create_id; end + + # Sets create identifier, which is used to decide if the _json_create_ + # hook of a class should be called; initial value is +json_class+: + # JSON.create_id # => 'json_class' + # + # source://json//lib/json/common.rb#124 + def create_id=(new_value); end + + # source://json//lib/json/common.rb#95 + def create_pretty_state; end + + # Return the constant located at _path_. The format of _path_ has to be + # either ::A::B::C or A::B::C. In any case, A has to be located at the top + # level (absolute namespace path?). If there doesn't exist a constant at + # the given path, an ArgumentError is raised. + # + # source://json//lib/json/common.rb#46 + def deep_const_get(path); end + + # :call-seq: + # JSON.dump(obj, io = nil, limit = nil) + # + # Dumps +obj+ as a \JSON string, i.e. calls generate on the object and returns the result. + # + # The default options can be changed via method JSON.dump_default_options. + # + # - Argument +io+, if given, should respond to method +write+; + # the \JSON \String is written to +io+, and +io+ is returned. + # If +io+ is not given, the \JSON \String is returned. + # - Argument +limit+, if given, is passed to JSON.generate as option +max_nesting+. + # + # --- + # + # When argument +io+ is not given, returns the \JSON \String generated from +obj+: + # obj = {foo: [0, 1], bar: {baz: 2, bat: 3}, bam: :bad} + # json = JSON.dump(obj) + # json # => "{\"foo\":[0,1],\"bar\":{\"baz\":2,\"bat\":3},\"bam\":\"bad\"}" + # + # When argument +io+ is given, writes the \JSON \String to +io+ and returns +io+: + # path = 't.json' + # File.open(path, 'w') do |file| + # JSON.dump(obj, file) + # end # => # + # puts File.read(path) + # Output: + # {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"} + # + # source://json//lib/json/common.rb#615 + def dump(obj, anIO = T.unsafe(nil), limit = T.unsafe(nil), kwargs = T.unsafe(nil)); end + + # Sets or returns the default options for the JSON.dump method. + # Initially: + # opts = JSON.dump_default_options + # opts # => {:max_nesting=>false, :allow_nan=>true, :script_safe=>false} + # + # source://json//lib/json/common.rb#580 + def dump_default_options; end + + # Sets or returns the default options for the JSON.dump method. + # Initially: + # opts = JSON.dump_default_options + # opts # => {:max_nesting=>false, :allow_nan=>true, :script_safe=>false} + # + # source://json//lib/json/common.rb#580 + def dump_default_options=(_arg0); end + + # :call-seq: + # JSON.fast_generate(obj, opts) -> new_string + # + # Arguments +obj+ and +opts+ here are the same as + # arguments +obj+ and +opts+ in JSON.generate. + # + # By default, generates \JSON data without checking + # for circular references in +obj+ (option +max_nesting+ set to +false+, disabled). + # + # Raises an exception if +obj+ contains circular references: + # a = []; b = []; a.push(b); b.push(a) + # # Raises SystemStackError (stack level too deep): + # JSON.fast_generate(a) + # + # source://json//lib/json/common.rb#329 + def fast_generate(obj, opts = T.unsafe(nil)); end + + # :stopdoc: + # I want to deprecate these later, so I'll first be silent about them, and later delete them. + # + # source://json//lib/json/common.rb#329 + def fast_unparse(obj, opts = T.unsafe(nil)); end + + # :call-seq: + # JSON.generate(obj, opts = nil) -> new_string + # + # Returns a \String containing the generated \JSON data. + # + # See also JSON.fast_generate, JSON.pretty_generate. + # + # Argument +obj+ is the Ruby object to be converted to \JSON. + # + # Argument +opts+, if given, contains a \Hash of options for the generation. + # See {Generating Options}[#module-JSON-label-Generating+Options]. + # + # --- + # + # When +obj+ is an \Array, returns a \String containing a \JSON array: + # obj = ["foo", 1.0, true, false, nil] + # json = JSON.generate(obj) + # json # => '["foo",1.0,true,false,null]' + # + # When +obj+ is a \Hash, returns a \String containing a \JSON object: + # obj = {foo: 0, bar: 's', baz: :bat} + # json = JSON.generate(obj) + # json # => '{"foo":0,"bar":"s","baz":"bat"}' + # + # For examples of generating from other Ruby objects, see + # {Generating \JSON from Other Objects}[#module-JSON-label-Generating+JSON+from+Other+Objects]. + # + # --- + # + # Raises an exception if any formatting option is not a \String. + # + # Raises an exception if +obj+ contains circular references: + # a = []; b = []; a.push(b); b.push(a) + # # Raises JSON::NestingError (nesting of 100 is too deep): + # JSON.generate(a) + # + # source://json//lib/json/common.rb#300 + def generate(obj, opts = T.unsafe(nil)); end + + # Returns the JSON generator module that is used by JSON. This is + # either JSON::Ext::Generator or JSON::Pure::Generator: + # JSON.generator # => JSON::Ext::Generator + # + # source://json//lib/json/common.rb#107 + def generator; end + + # Set the module _generator_ to be used by JSON. + # + # source://json//lib/json/common.rb#62 + def generator=(generator); end + + # Encodes string using String.encode. + # + # source://json//lib/json/common.rb#639 + def iconv(to, from, string); end + + # :call-seq: + # JSON.load(source, proc = nil, options = {}) -> object + # + # Returns the Ruby objects created by parsing the given +source+. + # + # - Argument +source+ must be, or be convertible to, a \String: + # - If +source+ responds to instance method +to_str+, + # source.to_str becomes the source. + # - If +source+ responds to instance method +to_io+, + # source.to_io.read becomes the source. + # - If +source+ responds to instance method +read+, + # source.read becomes the source. + # - If both of the following are true, source becomes the \String 'null': + # - Option +allow_blank+ specifies a truthy value. + # - The source, as defined above, is +nil+ or the empty \String ''. + # - Otherwise, +source+ remains the source. + # - Argument +proc+, if given, must be a \Proc that accepts one argument. + # It will be called recursively with each result (depth-first order). + # See details below. + # BEWARE: This method is meant to serialise data from trusted user input, + # like from your own database server or clients under your control, it could + # be dangerous to allow untrusted users to pass JSON sources into it. + # - Argument +opts+, if given, contains a \Hash of options for the parsing. + # See {Parsing Options}[#module-JSON-label-Parsing+Options]. + # The default options can be changed via method JSON.load_default_options=. + # + # --- + # + # When no +proc+ is given, modifies +source+ as above and returns the result of + # parse(source, opts); see #parse. + # + # Source for following examples: + # source = <<-EOT + # { + # "name": "Dave", + # "age" :40, + # "hats": [ + # "Cattleman's", + # "Panama", + # "Tophat" + # ] + # } + # EOT + # + # Load a \String: + # ruby = JSON.load(source) + # ruby # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # Load an \IO object: + # require 'stringio' + # object = JSON.load(StringIO.new(source)) + # object # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # Load a \File object: + # path = 't.json' + # File.write(path, source) + # File.open(path) do |file| + # JSON.load(file) + # end # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # --- + # + # When +proc+ is given: + # - Modifies +source+ as above. + # - Gets the +result+ from calling parse(source, opts). + # - Recursively calls proc(result). + # - Returns the final result. + # + # Example: + # require 'json' + # + # # Some classes for the example. + # class Base + # def initialize(attributes) + # @attributes = attributes + # end + # end + # class User < Base; end + # class Account < Base; end + # class Admin < Base; end + # # The JSON source. + # json = <<-EOF + # { + # "users": [ + # {"type": "User", "username": "jane", "email": "jane@example.com"}, + # {"type": "User", "username": "john", "email": "john@example.com"} + # ], + # "accounts": [ + # {"account": {"type": "Account", "paid": true, "account_id": "1234"}}, + # {"account": {"type": "Account", "paid": false, "account_id": "1235"}} + # ], + # "admins": {"type": "Admin", "password": "0wn3d"} + # } + # EOF + # # Deserializer method. + # def deserialize_obj(obj, safe_types = %w(User Account Admin)) + # type = obj.is_a?(Hash) && obj["type"] + # safe_types.include?(type) ? Object.const_get(type).new(obj) : obj + # end + # # Call to JSON.load + # ruby = JSON.load(json, proc {|obj| + # case obj + # when Hash + # obj.each {|k, v| obj[k] = deserialize_obj v } + # when Array + # obj.map! {|v| deserialize_obj v } + # end + # }) + # pp ruby + # Output: + # {"users"=> + # [#"User", "username"=>"jane", "email"=>"jane@example.com"}>, + # #"User", "username"=>"john", "email"=>"john@example.com"}>], + # "accounts"=> + # [{"account"=> + # #"Account", "paid"=>true, "account_id"=>"1234"}>}, + # {"account"=> + # #"Account", "paid"=>false, "account_id"=>"1235"}>}], + # "admins"=> + # #"Admin", "password"=>"0wn3d"}>} + # + # source://json//lib/json/common.rb#541 + def load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end + + # Sets or returns default options for the JSON.load method. + # Initially: + # opts = JSON.load_default_options + # opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true} + # + # source://json//lib/json/common.rb#404 + def load_default_options; end + + # Sets or returns default options for the JSON.load method. + # Initially: + # opts = JSON.load_default_options + # opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true} + # + # source://json//lib/json/common.rb#404 + def load_default_options=(_arg0); end + + # :call-seq: + # JSON.load_file(path, opts={}) -> object + # + # Calls: + # parse(File.read(path), opts) + # + # See method #parse. + # + # source://json//lib/json/common.rb#249 + def load_file(filespec, opts = T.unsafe(nil)); end + + # :call-seq: + # JSON.load_file!(path, opts = {}) + # + # Calls: + # JSON.parse!(File.read(path, opts)) + # + # See method #parse! + # + # source://json//lib/json/common.rb#260 + def load_file!(filespec, opts = T.unsafe(nil)); end + + # :call-seq: + # JSON.parse(source, opts) -> object + # + # Returns the Ruby objects created by parsing the given +source+. + # + # Argument +source+ contains the \String to be parsed. + # + # Argument +opts+, if given, contains a \Hash of options for the parsing. + # See {Parsing Options}[#module-JSON-label-Parsing+Options]. + # + # --- + # + # When +source+ is a \JSON array, returns a Ruby \Array: + # source = '["foo", 1.0, true, false, null]' + # ruby = JSON.parse(source) + # ruby # => ["foo", 1.0, true, false, nil] + # ruby.class # => Array + # + # When +source+ is a \JSON object, returns a Ruby \Hash: + # source = '{"a": "foo", "b": 1.0, "c": true, "d": false, "e": null}' + # ruby = JSON.parse(source) + # ruby # => {"a"=>"foo", "b"=>1.0, "c"=>true, "d"=>false, "e"=>nil} + # ruby.class # => Hash + # + # For examples of parsing for all \JSON data types, see + # {Parsing \JSON}[#module-JSON-label-Parsing+JSON]. + # + # Parses nested JSON objects: + # source = <<-EOT + # { + # "name": "Dave", + # "age" :40, + # "hats": [ + # "Cattleman's", + # "Panama", + # "Tophat" + # ] + # } + # EOT + # ruby = JSON.parse(source) + # ruby # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # --- + # + # Raises an exception if +source+ is not valid JSON: + # # Raises JSON::ParserError (783: unexpected token at ''): + # JSON.parse('') + # + # source://json//lib/json/common.rb#219 + def parse(source, opts = T.unsafe(nil)); end + + # :call-seq: + # JSON.parse!(source, opts) -> object + # + # Calls + # parse(source, opts) + # with +source+ and possibly modified +opts+. + # + # Differences from JSON.parse: + # - Option +max_nesting+, if not provided, defaults to +false+, + # which disables checking for nesting depth. + # - Option +allow_nan+, if not provided, defaults to +true+. + # + # source://json//lib/json/common.rb#234 + def parse!(source, opts = T.unsafe(nil)); end + + # Returns the JSON parser class that is used by JSON. This is either + # JSON::Ext::Parser or JSON::Pure::Parser: + # JSON.parser # => JSON::Ext::Parser + # + # source://json//lib/json/common.rb#33 + def parser; end + + # Set the JSON parser class _parser_ to be used by JSON. + # + # source://json//lib/json/common.rb#36 + def parser=(parser); end + + # :call-seq: + # JSON.pretty_generate(obj, opts = nil) -> new_string + # + # Arguments +obj+ and +opts+ here are the same as + # arguments +obj+ and +opts+ in JSON.generate. + # + # Default options are: + # { + # indent: ' ', # Two spaces + # space: ' ', # One space + # array_nl: "\n", # Newline + # object_nl: "\n" # Newline + # } + # + # Example: + # obj = {foo: [:bar, :baz], bat: {bam: 0, bad: 1}} + # json = JSON.pretty_generate(obj) + # puts json + # Output: + # { + # "foo": [ + # "bar", + # "baz" + # ], + # "bat": { + # "bam": 0, + # "bad": 1 + # } + # } + # + # source://json//lib/json/common.rb#374 + def pretty_generate(obj, opts = T.unsafe(nil)); end + + # :stopdoc: + # I want to deprecate these later, so I'll first be silent about them, and later delete them. + # + # source://json//lib/json/common.rb#374 + def pretty_unparse(obj, opts = T.unsafe(nil)); end + + # Recursively calls passed _Proc_ if the parsed data structure is an _Array_ or _Hash_ + # + # source://json//lib/json/common.rb#559 + def recurse_proc(result, &proc); end + + # source://json//lib/json/common.rb#541 + def restore(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end + + # Sets or Returns the JSON generator state class that is used by JSON. This is + # either JSON::Ext::Generator::State or JSON::Pure::Generator::State: + # JSON.state # => JSON::Ext::Generator::State + # + # source://json//lib/json/common.rb#112 + def state; end + + # Sets or Returns the JSON generator state class that is used by JSON. This is + # either JSON::Ext::Generator::State or JSON::Pure::Generator::State: + # JSON.state # => JSON::Ext::Generator::State + # + # source://json//lib/json/common.rb#112 + def state=(_arg0); end + + # :stopdoc: + # I want to deprecate these later, so I'll first be silent about them, and + # later delete them. + # + # source://json//lib/json/common.rb#300 + def unparse(obj, opts = T.unsafe(nil)); end + + private + + # source://json//lib/json/common.rb#643 + def merge_dump_options(opts, strict: T.unsafe(nil)); end + end +end + +# source://json//lib/json/common.rb#118 +JSON::CREATE_ID_TLS_KEY = T.let(T.unsafe(nil), String) + +# source://json//lib/json/common.rb#115 +JSON::DEFAULT_CREATE_ID = T.let(T.unsafe(nil), String) + +# source://json//lib/json/generic_object.rb#9 +class JSON::GenericObject < ::OpenStruct + # source://json//lib/json/generic_object.rb#67 + def as_json(*_arg0); end + + # source://json//lib/json/generic_object.rb#51 + def to_hash; end + + # source://json//lib/json/generic_object.rb#71 + def to_json(*a); end + + # source://json//lib/json/generic_object.rb#63 + def |(other); end + + class << self + # source://json//lib/json/generic_object.rb#45 + def dump(obj, *args); end + + # source://json//lib/json/generic_object.rb#25 + def from_hash(object); end + + # Sets the attribute json_creatable + # + # @param value the value to set the attribute json_creatable to. + # + # source://json//lib/json/generic_object.rb#17 + def json_creatable=(_arg0); end + + # @return [Boolean] + # + # source://json//lib/json/generic_object.rb#13 + def json_creatable?; end + + # source://json//lib/json/generic_object.rb#19 + def json_create(data); end + + # source://json//lib/json/generic_object.rb#40 + def load(source, proc = T.unsafe(nil), opts = T.unsafe(nil)); end + end +end + +# The base exception for JSON errors. +# +# source://json//lib/json/common.rb#141 +class JSON::JSONError < ::StandardError + class << self + # source://json//lib/json/common.rb#142 + def wrap(exception); end + end +end + +# source://json//lib/json/common.rb#7 +JSON::NOT_SET = T.let(T.unsafe(nil), Object) + +# source://json//lib/json/common.rb#39 +JSON::Parser = JSON::Ext::Parser + +# source://json//lib/json/common.rb#77 +JSON::State = JSON::Ext::Generator::State + +# For backwards compatibility +# +# source://json//lib/json/common.rb#163 +JSON::UnparserError = JSON::GeneratorError + +# source://json//lib/json/common.rb#653 +module Kernel + private + + # If _object_ is string-like, parse the string and return the parsed result as + # a Ruby data structure. Otherwise, generate a JSON text from the Ruby data + # structure object and return it. + # + # The _opts_ argument is passed through to generate/parse respectively. See + # generate and parse for their documentation. + # + # source://json//lib/json/common.rb#680 + def JSON(object, *args); end + + # Outputs _objs_ to STDOUT as JSON strings in the shortest form, that is in + # one line. + # + # source://json//lib/json/common.rb#658 + def j(*objs); end + + # Outputs _objs_ to STDOUT as JSON strings in a pretty format, with + # indentation and over many lines. + # + # source://json//lib/json/common.rb#667 + def jj(*objs); end +end diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/method_source@1.1.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/method_source@1.1.0.rbi new file mode 100644 index 0000000..2f1a741 --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/method_source@1.1.0.rbi @@ -0,0 +1,304 @@ +# 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`. + + +# source://method_source//lib/method_source.rb#163 +class Method + include ::MethodSource::SourceLocation::MethodExtensions + include ::MethodSource::MethodExtensions +end + +# source://method_source//lib/method_source/version.rb#1 +module MethodSource + extend ::MethodSource::CodeHelpers + + class << self + # Clear cache. + # + # source://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 source_location [Array] The array returned by Method#source_location + # @param method_name [String] + # @raise [SourceNotFoundError] + # @return [String] The comments up to the point of the method. + # + # source://method_source//lib/method_source.rb#38 + def comment_helper(source_location, name = T.unsafe(nil)); end + + # @deprecated — use MethodSource::CodeHelpers#expression_at + # + # source://method_source//lib/method_source.rb#71 + def extract_code(source_location); end + + # Load a memoized copy of the lines in a file. + # + # @param file_name [String] + # @param method_name [String] + # @raise [SourceNotFoundError] + # @return [Array] the contents of the file + # + # source://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 source_location [Array] The array returned by Method#source_location + # @param method_name [String] + # @return [String] The method body + # + # source://method_source//lib/method_source.rb#23 + def source_helper(source_location, name = T.unsafe(nil)); end + + # @deprecated — use MethodSource::CodeHelpers#complete_expression? + # @return [Boolean] + # + # source://method_source//lib/method_source.rb#64 + def valid_expression?(str); end + end +end + +# source://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 file [Array, File, String] The file to parse, either as a File or as + # a String or an Array of lines. + # @param line_number [Integer] The line number at which to look. + # NOTE: The first line in a file is line 1! + # @return [String] The comment + # + # source://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. + # + # @example + # complete_expression?("class Hello") #=> false + # complete_expression?("class Hello; end") #=> true + # complete_expression?("class 123") #=> SyntaxError: unexpected tINTEGER + # @param code [String] The code to validate. + # @raise [SyntaxError] Any SyntaxError that does not represent incompleteness. + # @return [Boolean] Whether or not the code is a complete Ruby expression. + # + # source://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. + # + # line 1! + # + # @option options + # @option options + # @param file [Array, File, String] The file to parse, either as a File or as + # @param line_number [Integer] The line number at which to look. + # NOTE: The first line in a file is + # @param options [Hash] The optional configuration parameters. + # @raise [SyntaxError] If the first complete expression can't be identified + # @return [String] The first complete expression + # + # source://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 lines [Array] + # @param consume [Integer] A number of lines to automatically + # consume (add to the expression buffer) without checking for validity. + # @raise [SyntaxError] + # @return [String] a valid ruby expression + # @yield a clean-up function to run before checking for complete_expression + # + # source://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 lines [Array] + # @return [String] + # + # source://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. +# +# source://method_source//lib/method_source/code_helpers.rb#124 +module MethodSource::CodeHelpers::IncompleteExpression + class << self + # source://method_source//lib/method_source/code_helpers.rb#137 + def ===(ex); end + + # @return [Boolean] + # + # source://method_source//lib/method_source/code_helpers.rb#149 + def rbx?; end + end +end + +# source://method_source//lib/method_source/code_helpers.rb#125 +MethodSource::CodeHelpers::IncompleteExpression::GENERIC_REGEXPS = T.let(T.unsafe(nil), Array) + +# source://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 +# +# source://method_source//lib/method_source.rb#77 +module MethodSource::MethodExtensions + # Return the comments associated with the method class/module. + # + # @example + # MethodSource::MethodExtensions.method(:included).module_comment + # => + # # This module is to be included by `Method` and `UnboundMethod` and + # # provides the `#source` functionality + # @raise SourceNotFoundException + # @return [String] The method's comments as a string + # + # source://method_source//lib/method_source.rb#139 + def class_comment; end + + # Return the comments associated with the method as a string. + # + # @example + # Set.instance_method(:clear).comment.display + # => + # # Removes all elements and returns self. + # @raise SourceNotFoundException + # @return [String] The method's comments as a string + # + # source://method_source//lib/method_source.rb#126 + def comment; end + + # Return the comments associated with the method class/module. + # + # @example + # MethodSource::MethodExtensions.method(:included).module_comment + # => + # # This module is to be included by `Method` and `UnboundMethod` and + # # provides the `#source` functionality + # @raise SourceNotFoundException + # @return [String] The method's comments as a string + # + # source://method_source//lib/method_source.rb#139 + def module_comment; end + + # Return the sourcecode for the method as a string + # + # @example + # Set.instance_method(:clear).source.display + # => + # def clear + # @hash.clear + # self + # end + # @raise SourceNotFoundException + # @return [String] The method sourcecode as a string + # + # source://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 klass [Class] The class that includes the module. + # + # source://method_source//lib/method_source.rb#84 + def included(klass); end + end +end + +# source://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. + # + # source://method_source//lib/method_source/source_location.rb#5 + def source_location; end +end + +# source://method_source//lib/method_source/source_location.rb#10 +module MethodSource::SourceLocation; end + +# source://method_source//lib/method_source/source_location.rb#11 +module MethodSource::SourceLocation::MethodExtensions + # 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. + # + # source://method_source//lib/method_source/source_location.rb#40 + def source_location; end + + private + + # source://method_source//lib/method_source/source_location.rb#26 + def trace_func(event, file, line, id, binding, classname); end +end + +# source://method_source//lib/method_source/source_location.rb#54 +module MethodSource::SourceLocation::ProcExtensions + # 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. + # + # source://method_source//lib/method_source/source_location.rb#74 + def source_location; end +end + +# source://method_source//lib/method_source/source_location.rb#81 +module MethodSource::SourceLocation::UnboundMethodExtensions + # 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. + # + # source://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. +# +# source://method_source//lib/method_source.rb#16 +class MethodSource::SourceNotFoundError < ::StandardError; end + +# source://method_source//lib/method_source/version.rb#2 +MethodSource::VERSION = T.let(T.unsafe(nil), String) + +# source://method_source//lib/method_source.rb#173 +class Proc + include ::MethodSource::SourceLocation::ProcExtensions + include ::MethodSource::MethodExtensions +end + +# source://method_source//lib/method_source.rb#168 +class UnboundMethod + include ::MethodSource::SourceLocation::UnboundMethodExtensions + include ::MethodSource::MethodExtensions +end diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/multi_json@1.15.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/multi_json@1.15.0.rbi new file mode 100644 index 0000000..64c3c0c --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/multi_json@1.15.0.rbi @@ -0,0 +1,268 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `multi_json` gem. +# Please instead update this file by running `bin/tapioca gem multi_json`. + + +# source://multi_json//lib/multi_json/options.rb#1 +module MultiJson + include ::MultiJson::Options + extend ::MultiJson::Options + extend ::MultiJson + + # Get the current adapter class. + # + # source://multi_json//lib/multi_json.rb#70 + def adapter; end + + # Set the JSON parser utilizing a symbol, string, or class. + # Supported by default are: + # + # * :oj + # * :json_gem + # * :json_pure + # * :ok_json + # * :yajl + # * :nsjsonserialization (MacRuby only) + # * :gson (JRuby only) + # * :jr_jackson (JRuby only) + # + # source://multi_json//lib/multi_json.rb#90 + def adapter=(new_adapter); end + + # source://multi_json//lib/multi_json.rb#26 + def cached_options(*_arg0); end + + # source://multi_json//lib/multi_json.rb#129 + def current_adapter(options = T.unsafe(nil)); end + + # Decode a JSON string into Ruby. + # + # Options + # + # :symbolize_keys :: If true, will use symbols instead of strings for the keys. + # :adapter :: If set, the selected adapter will be used for this call. + # + # source://multi_json//lib/multi_json.rb#119 + def decode(string, options = T.unsafe(nil)); end + + # The default adapter based on what you currently + # have loaded and installed. First checks to see + # if any adapters are already loaded, then checks + # to see which are installed if none are loaded. + # + # source://multi_json//lib/multi_json.rb#46 + def default_adapter; end + + # The default adapter based on what you currently + # have loaded and installed. First checks to see + # if any adapters are already loaded, then checks + # to see which are installed if none are loaded. + # + # source://multi_json//lib/multi_json.rb#46 + def default_engine; end + + # source://multi_json//lib/multi_json.rb#18 + def default_options; end + + # source://multi_json//lib/multi_json.rb#11 + def default_options=(value); end + + # Encodes a Ruby object as JSON. + # + # source://multi_json//lib/multi_json.rb#138 + def dump(object, options = T.unsafe(nil)); end + + # Encodes a Ruby object as JSON. + # + # source://multi_json//lib/multi_json.rb#138 + def encode(object, options = T.unsafe(nil)); end + + # Get the current adapter class. + # + # source://multi_json//lib/multi_json.rb#70 + def engine; end + + # Set the JSON parser utilizing a symbol, string, or class. + # Supported by default are: + # + # * :oj + # * :json_gem + # * :json_pure + # * :ok_json + # * :yajl + # * :nsjsonserialization (MacRuby only) + # * :gson (JRuby only) + # * :jr_jackson (JRuby only) + # + # source://multi_json//lib/multi_json.rb#90 + def engine=(new_adapter); end + + # Decode a JSON string into Ruby. + # + # Options + # + # :symbolize_keys :: If true, will use symbols instead of strings for the keys. + # :adapter :: If set, the selected adapter will be used for this call. + # + # source://multi_json//lib/multi_json.rb#119 + def load(string, options = T.unsafe(nil)); end + + # source://multi_json//lib/multi_json.rb#98 + def load_adapter(new_adapter); end + + # source://multi_json//lib/multi_json.rb#26 + def reset_cached_options!(*_arg0); end + + # Set the JSON parser utilizing a symbol, string, or class. + # Supported by default are: + # + # * :oj + # * :json_gem + # * :json_pure + # * :ok_json + # * :yajl + # * :nsjsonserialization (MacRuby only) + # * :gson (JRuby only) + # * :jr_jackson (JRuby only) + # + # source://multi_json//lib/multi_json.rb#90 + def use(new_adapter); end + + # Executes passed block using specified adapter. + # + # source://multi_json//lib/multi_json.rb#144 + def with_adapter(new_adapter); end + + # Executes passed block using specified adapter. + # + # source://multi_json//lib/multi_json.rb#144 + def with_engine(new_adapter); end + + private + + # source://multi_json//lib/multi_json.rb#155 + def load_adapter_from_string_name(name); end +end + +# source://multi_json//lib/multi_json.rb#31 +MultiJson::ALIASES = T.let(T.unsafe(nil), Hash) + +# source://multi_json//lib/multi_json/adapter_error.rb#2 +class MultiJson::AdapterError < ::ArgumentError + # Returns the value of attribute cause. + # + # source://multi_json//lib/multi_json/adapter_error.rb#3 + def cause; end + + class << self + # source://multi_json//lib/multi_json/adapter_error.rb#5 + def build(original_exception); end + end +end + +# Legacy support +# +# source://multi_json//lib/multi_json/parse_error.rb#16 +MultiJson::DecodeError = MultiJson::ParseError + +# source://multi_json//lib/multi_json/parse_error.rb#16 +MultiJson::LoadError = MultiJson::ParseError + +# source://multi_json//lib/multi_json/options.rb#2 +module MultiJson::Options + # source://multi_json//lib/multi_json/options.rb#25 + def default_dump_options; end + + # source://multi_json//lib/multi_json/options.rb#21 + def default_load_options; end + + # source://multi_json//lib/multi_json/options.rb#17 + def dump_options(*args); end + + # source://multi_json//lib/multi_json/options.rb#8 + def dump_options=(options); end + + # source://multi_json//lib/multi_json/options.rb#13 + def load_options(*args); end + + # source://multi_json//lib/multi_json/options.rb#3 + def load_options=(options); end + + private + + # source://multi_json//lib/multi_json/options.rb#31 + def get_options(options, *args); end +end + +# source://multi_json//lib/multi_json/options_cache.rb#2 +module MultiJson::OptionsCache + extend ::MultiJson::OptionsCache + + # source://multi_json//lib/multi_json/options_cache.rb#10 + def fetch(type, key, &block); end + + # source://multi_json//lib/multi_json/options_cache.rb#5 + def reset; end + + private + + # source://multi_json//lib/multi_json/options_cache.rb#24 + def write(cache, key); end +end + +# Normally MultiJson is used with a few option sets for both dump/load +# methods. When options are generated dynamically though, every call would +# cause a cache miss and the cache would grow indefinitely. To prevent +# this, we just reset the cache every time the number of keys outgrows +# 1000. +# +# source://multi_json//lib/multi_json/options_cache.rb#22 +MultiJson::OptionsCache::MAX_CACHE_SIZE = T.let(T.unsafe(nil), Integer) + +# source://multi_json//lib/multi_json/parse_error.rb#2 +class MultiJson::ParseError < ::StandardError + # Returns the value of attribute cause. + # + # source://multi_json//lib/multi_json/parse_error.rb#3 + def cause; end + + # Returns the value of attribute data. + # + # source://multi_json//lib/multi_json/parse_error.rb#3 + def data; end + + class << self + # source://multi_json//lib/multi_json/parse_error.rb#5 + def build(original_exception, data); end + end +end + +# source://multi_json//lib/multi_json.rb#33 +MultiJson::REQUIREMENT_MAP = T.let(T.unsafe(nil), Array) + +# source://multi_json//lib/multi_json/version.rb#16 +MultiJson::VERSION = T.let(T.unsafe(nil), String) + +# source://multi_json//lib/multi_json/version.rb#2 +class MultiJson::Version + class << self + # @return [String] + # + # source://multi_json//lib/multi_json/version.rb#10 + def to_s; end + end +end + +# source://multi_json//lib/multi_json/version.rb#3 +MultiJson::Version::MAJOR = T.let(T.unsafe(nil), Integer) + +# source://multi_json//lib/multi_json/version.rb#4 +MultiJson::Version::MINOR = T.let(T.unsafe(nil), Integer) + +# source://multi_json//lib/multi_json/version.rb#5 +MultiJson::Version::PATCH = T.let(T.unsafe(nil), Integer) + +# source://multi_json//lib/multi_json/version.rb#6 +MultiJson::Version::PRE = T.let(T.unsafe(nil), T.untyped) diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/mustermann@3.0.3.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/mustermann@3.0.3.rbi new file mode 100644 index 0000000..ea1258b --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/mustermann@3.0.3.rbi @@ -0,0 +1,2537 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `mustermann` gem. +# Please instead update this file by running `bin/tapioca gem mustermann`. + + +# Namespace and main entry point for the Mustermann library. +# +# Under normal circumstances the only external API entry point you should be using is {Mustermann.new}. +# +# source://mustermann//lib/mustermann/error.rb#2 +module Mustermann + class << self + # Maps a type to its factory. + # + # @example + # Mustermann[:sinatra] # => Mustermann::Sinatra + # @param name [Symbol] a pattern type identifier + # @raise [ArgumentError] if the type is not supported + # @return [Class, #new] pattern factory + # + # source://mustermann//lib/mustermann.rb#89 + def [](name); end + + # source://mustermann//lib/mustermann.rb#120 + def extend_object(object); end + + # Creates a new pattern based on input. + # + # * From {Mustermann::Pattern}: returns given pattern. + # * From String: creates a pattern from the string, depending on type option (defaults to {Mustermann::Sinatra}) + # * From Regexp: creates a {Mustermann::Regular} pattern. + # * From Symbol: creates a {Mustermann::Sinatra} pattern with a single named capture named after the input. + # * From an Array or multiple inputs: creates a new pattern from each element, combines them to a {Mustermann::Composite}. + # * From anything else: Will try to call to_pattern on it or raise a TypeError. + # + # Note that if the input is a {Mustermann::Pattern}, Regexp or Symbol, the type option is ignored and if to_pattern is + # called on the object, the type will be handed on but might be ignored by the input object. + # + # If you want to enforce the pattern type, you should create them via their expected class. + # + # @example creating patterns + # require 'mustermann' + # + # Mustermann.new("/:name") # => # + # Mustermann.new("/{name}", type: :template) # => # + # Mustermann.new(/.*/) # => # + # Mustermann.new(:name, capture: :word) # => # + # Mustermann.new("/", "/*.jpg", type: :shell) # => # + # @example using custom #to_pattern + # require 'mustermann' + # + # class MyObject + # def to_pattern(**options) + # Mustermann.new("/:name", **options) + # end + # end + # + # Mustermann.new(MyObject.new, type: :rails) # => # + # @example enforcing type + # require 'mustermann/sinatra' + # + # Mustermann::Sinatra.new("/:name") + # @param input [String, Pattern, Regexp, Symbol, #to_pattern, Array] The representation of the pattern + # @param options [Hash] The options hash + # @raise [TypeError] if the passed object cannot be converted to a pattern + # @raise [ArgumentError] if the type is not supported + # @raise [ArgumentError] if some option is not supported + # @raise [Mustermann::Error] if the pattern can't be generated from the string + # @return [Mustermann::Pattern] pattern corresponding to string. + # @see file:README.md#Types_and_Options "Types and Options" in the README + # + # source://mustermann//lib/mustermann.rb#62 + def new(*input, type: T.unsafe(nil), operator: T.unsafe(nil), **options); end + + # source://mustermann//lib/mustermann.rb#115 + def normalized_type(type); end + + # source://mustermann//lib/mustermann.rb#110 + def register(name, type); end + + # @return [LoadError, nil] + # + # source://mustermann//lib/mustermann.rb#101 + def try_require(path); end + end +end + +# @see Mustermann::AST::Pattern +# +# source://mustermann//lib/mustermann/ast/node.rb#3 +module Mustermann::AST; end + +# Make sure #start and #stop is set on every node and within its parents #start and #stop. +# +# source://mustermann//lib/mustermann/ast/boundaries.rb#8 +class Mustermann::AST::Boundaries < ::Mustermann::AST::Translator + # Checks that a node is within the given boundaries. + # + # source://mustermann//lib/mustermann/ast/boundaries.rb#38 + def set_boundaries(node, start, stop); end + + class << self + # @return [Mustermann::AST::Node] the ast passed as first argument + # + # source://mustermann//lib/mustermann/ast/boundaries.rb#11 + def set_boundaries(ast, string: T.unsafe(nil), start: T.unsafe(nil), stop: T.unsafe(nil)); end + end +end + +# source://mustermann//lib/mustermann/ast/boundaries.rb#0 +class Mustermann::AST::Boundaries::NodeTranslator < ::Mustermann::AST::Translator::NodeTranslator + class << self + # source://mustermann//lib/mustermann/ast/translator.rb#62 + def translator; end + end +end + +# Regexp compilation logic. +# +# source://mustermann//lib/mustermann/ast/compiler.rb#9 +class Mustermann::AST::Compiler < ::Mustermann::AST::Translator + # Compiles an AST to a regular expression. + # + # @param ast [Mustermann::AST::Node] the tree + # @return [Regexp] corresponding regular expression. + # + # source://mustermann//lib/mustermann/ast/compiler.rb#151 + def compile(ast, except: T.unsafe(nil), **options); end + + # @return [String] Regular expression for matching the given character in all representations + # + # source://mustermann//lib/mustermann/ast/compiler.rb#126 + def encoded(char, uri_decode: T.unsafe(nil), space_matches_plus: T.unsafe(nil), **options); end + + # source://mustermann//lib/mustermann/ast/translator.rb#70 + def error_class; end + + class << self + # Compiles an AST to a regular expression. + # + # @param ast [Mustermann::AST::Node] the tree + # @return [Regexp] corresponding regular expression. + # + # source://mustermann//lib/mustermann/ast/compiler.rb#142 + def compile(ast, **options); end + end +end + +# Capture compilation is complex. :( +# +# source://mustermann//lib/mustermann/ast/compiler.rb#38 +class Mustermann::AST::Compiler::Capture < ::Mustermann::AST::Compiler::NodeTranslator + # @return [String] regexp without the named capture + # + # source://mustermann//lib/mustermann/ast/compiler.rb#49 + def pattern(capture: T.unsafe(nil), **options); end + + # source://mustermann//lib/mustermann/ast/compiler.rb#42 + def translate(**options); end + + private + + # source://mustermann//lib/mustermann/ast/compiler.rb#68 + def default(**options); end + + # source://mustermann//lib/mustermann/ast/compiler.rb#64 + def from_array(array, **options); end + + # source://mustermann//lib/mustermann/ast/compiler.rb#63 + def from_hash(hash, **options); end + + # source://mustermann//lib/mustermann/ast/compiler.rb#67 + def from_nil(**options); end + + # source://mustermann//lib/mustermann/ast/compiler.rb#66 + def from_string(string, **options); end + + # source://mustermann//lib/mustermann/ast/compiler.rb#65 + def from_symbol(symbol, **options); end + + # source://mustermann//lib/mustermann/ast/compiler.rb#61 + def qualified(string, greedy: T.unsafe(nil), **options); end + + # source://mustermann//lib/mustermann/ast/compiler.rb#62 + def with_lookahead(string, lookahead: T.unsafe(nil), **options); end +end + +# source://mustermann//lib/mustermann/ast/compiler.rb#0 +class Mustermann::AST::Compiler::NodeTranslator < ::Mustermann::AST::Translator::NodeTranslator + class << self + # source://mustermann//lib/mustermann/ast/translator.rb#62 + def translator; end + end +end + +# source://mustermann//lib/mustermann/ast/compiler.rb#72 +class Mustermann::AST::Compiler::Splat < ::Mustermann::AST::Compiler::Capture + # splats are always non-greedy + # + # source://mustermann//lib/mustermann/ast/compiler.rb#76 + def pattern(**options); end +end + +# source://mustermann//lib/mustermann/ast/compiler.rb#82 +class Mustermann::AST::Compiler::Variable < ::Mustermann::AST::Compiler::Capture + # source://mustermann//lib/mustermann/ast/compiler.rb#113 + def default(allow_reserved: T.unsafe(nil), **options); end + + # source://mustermann//lib/mustermann/ast/compiler.rb#103 + def parametric(string); end + + # source://mustermann//lib/mustermann/ast/compiler.rb#94 + def pattern(parametric: T.unsafe(nil), separator: T.unsafe(nil), **options); end + + # source://mustermann//lib/mustermann/ast/compiler.rb#108 + def qualified(string, **options); end + + # source://mustermann//lib/mustermann/ast/compiler.rb#118 + def register_param(parametric: T.unsafe(nil), split_params: T.unsafe(nil), separator: T.unsafe(nil), **options); end + + # source://mustermann//lib/mustermann/ast/compiler.rb#86 + def translate(**options); end +end + +# Looks at an AST, remembers the important bits of information to do an +# ultra fast expansion. +# +# source://mustermann//lib/mustermann/ast/expander.rb#12 +class Mustermann::AST::Expander < ::Mustermann::AST::Translator + # add a tree for expansion + # + # source://mustermann//lib/mustermann/ast/expander.rb#80 + def add(ast); end + + # Creates the product of two of our secret internal data structures. + # + # source://mustermann//lib/mustermann/ast/expander.rb#141 + def add_to(list, result); end + + # source://mustermann//lib/mustermann/ast/translator.rb#70 + def error_class; end + + # helper method for raising an error for unexpandable values + # + # @raise [error_class] + # + # source://mustermann//lib/mustermann/ast/expander.rb#119 + def error_for(values); end + + # @see Mustermann::AST::Translator#expand + # + # source://mustermann//lib/mustermann/ast/expander.rb#126 + def escape(string, *args, **_arg2); end + + # @see Mustermann::Pattern#expand + # + # source://mustermann//lib/mustermann/ast/expander.rb#95 + def expand(values); end + + # @return [Boolean] + # @see Mustermann::Pattern#expandable? + # + # source://mustermann//lib/mustermann/ast/expander.rb#105 + def expandable?(values); end + + # @see Mustermann::Expander#with_rest + # + # source://mustermann//lib/mustermann/ast/expander.rb#113 + def expandable_keys(keys); end + + # helper method for captures + # + # source://mustermann//lib/mustermann/ast/expander.rb#61 + def for_capture(node, **options); end + + # all the known keys + # + # source://mustermann//lib/mustermann/ast/expander.rb#74 + def keys; end + + # maps sorted key list to sprintf patterns and filters + # + # source://mustermann//lib/mustermann/ast/expander.rb#68 + def mappings; end + + # Turns a sprintf pattern into our secret internal data structure. + # + # source://mustermann//lib/mustermann/ast/expander.rb#135 + def pattern(string = T.unsafe(nil), *keys, **filters); end + + # helper method for getting a capture's pattern. + # + # source://mustermann//lib/mustermann/ast/expander.rb#89 + def pattern_for(node, **options); end +end + +# source://mustermann//lib/mustermann/ast/expander.rb#0 +class Mustermann::AST::Expander::NodeTranslator < ::Mustermann::AST::Translator::NodeTranslator + class << self + # source://mustermann//lib/mustermann/ast/translator.rb#62 + def translator; end + end +end + +# source://mustermann//lib/mustermann/ast/node.rb#5 +class Mustermann::AST::Node + # @return [Node] a new instance of Node + # + # source://mustermann//lib/mustermann/ast/node.rb#43 + def initialize(payload = T.unsafe(nil), **options); end + + # Loop through all nodes that don't have child nodes. + # + # @yield [_self] + # @yieldparam _self [Mustermann::AST::Node] the object that the method was called on + # + # source://mustermann//lib/mustermann/ast/node.rb#65 + def each_leaf(&block); end + + # @return [Boolean] + # + # source://mustermann//lib/mustermann/ast/node.rb#49 + def is_a?(type); end + + # @return [Integer] length of the substring + # + # source://mustermann//lib/mustermann/ast/node.rb#78 + def length; end + + # @return [Integer] minimum size for a node + # + # source://mustermann//lib/mustermann/ast/node.rb#84 + def min_size; end + + # Double dispatch helper for reading from the buffer into the payload. + # + # source://mustermann//lib/mustermann/ast/node.rb#56 + def parse; end + + # Returns the value of attribute payload. + # + # source://mustermann//lib/mustermann/ast/node.rb#7 + def payload; end + + # Sets the attribute payload + # + # @param value the value to set the attribute payload to. + # + # source://mustermann//lib/mustermann/ast/node.rb#7 + def payload=(_arg0); end + + # Returns the value of attribute start. + # + # source://mustermann//lib/mustermann/ast/node.rb#7 + def start; end + + # Sets the attribute start + # + # @param value the value to set the attribute start to. + # + # source://mustermann//lib/mustermann/ast/node.rb#7 + def start=(_arg0); end + + # Returns the value of attribute stop. + # + # source://mustermann//lib/mustermann/ast/node.rb#7 + def stop; end + + # Sets the attribute stop + # + # @param value the value to set the attribute stop to. + # + # source://mustermann//lib/mustermann/ast/node.rb#7 + def stop=(_arg0); end + + # Turns a class name into a node identifier. + # + # source://mustermann//lib/mustermann/ast/node.rb#90 + def type; end + + class << self + # @param name [Symbol] of the node + # @return [Class] factory for the node + # + # source://mustermann//lib/mustermann/ast/node.rb#12 + def [](name); end + + # @param name [Symbol] of the node + # @return [String] qualified name of factory for the node + # + # source://mustermann//lib/mustermann/ast/node.rb#29 + def constant_name(name); end + + # Helper for creating a new instance and calling #parse on it. + # + # @return [Mustermann::AST::Node] + # + # source://mustermann//lib/mustermann/ast/node.rb#38 + def parse(payload = T.unsafe(nil), **options, &block); end + + # Turns a class name into a node identifier. + # + # source://mustermann//lib/mustermann/ast/node.rb#22 + def type; end + end +end + +# source://mustermann//lib/mustermann/ast/node.rb#95 +class Mustermann::AST::Node::Capture < ::Mustermann::AST::Node + # @see Mustermann::AST::Compiler::Capture#default + # + # source://mustermann//lib/mustermann/ast/node.rb#98 + def constraint; end + + # @see Mustermann::AST::Compiler::Capture#default + # + # source://mustermann//lib/mustermann/ast/node.rb#98 + def constraint=(_arg0); end + + # @see Mustermann::AST::Pattern#map_param + # + # source://mustermann//lib/mustermann/ast/node.rb#106 + def convert; end + + # @see Mustermann::AST::Pattern#map_param + # + # source://mustermann//lib/mustermann/ast/node.rb#106 + def convert=(_arg0); end + + # source://mustermann//lib/mustermann/ast/node.rb#7 + def name; end + + # @see Mustermann::AST::Node#parse + # + # source://mustermann//lib/mustermann/ast/node.rb#110 + def parse; end + + # @see Mustermann::AST::Compiler::Capture#qualified + # + # source://mustermann//lib/mustermann/ast/node.rb#102 + def qualifier; end + + # @see Mustermann::AST::Compiler::Capture#qualified + # + # source://mustermann//lib/mustermann/ast/node.rb#102 + def qualifier=(_arg0); end +end + +# source://mustermann//lib/mustermann/ast/node.rb#120 +class Mustermann::AST::Node::Char < ::Mustermann::AST::Node + # @return [Integer] minimum size for a node + # + # source://mustermann//lib/mustermann/ast/node.rb#123 + def min_size; end +end + +# source://mustermann//lib/mustermann/ast/node.rb#136 +class Mustermann::AST::Node::Composition < ::Mustermann::AST::Node + # @return [Composition] a new instance of Composition + # + # source://mustermann//lib/mustermann/ast/node.rb#138 + def initialize(payload = T.unsafe(nil), **options); end +end + +# AST node for template expressions. +# +# source://mustermann//lib/mustermann/ast/node.rb#130 +class Mustermann::AST::Node::Expression < ::Mustermann::AST::Node + # Returns the value of attribute operator. + # + # source://mustermann//lib/mustermann/ast/node.rb#132 + def operator; end + + # Sets the attribute operator + # + # @param value the value to set the attribute operator to. + # + # source://mustermann//lib/mustermann/ast/node.rb#132 + def operator=(_arg0); end +end + +# source://mustermann//lib/mustermann/ast/node.rb#144 +class Mustermann::AST::Node::Group < ::Mustermann::AST::Node::Composition; end + +# source://mustermann//lib/mustermann/ast/node.rb#195 +class Mustermann::AST::Node::NamedSplat < ::Mustermann::AST::Node::Splat + # @see Mustermann::AST::Node::Capture#name + # + # source://mustermann//lib/mustermann/ast/node.rb#7 + def name; end +end + +# source://mustermann//lib/mustermann/ast/node.rb#152 +class Mustermann::AST::Node::Optional < ::Mustermann::AST::Node; end + +# source://mustermann//lib/mustermann/ast/node.rb#156 +class Mustermann::AST::Node::Or < ::Mustermann::AST::Node; end + +# source://mustermann//lib/mustermann/ast/node.rb#160 +class Mustermann::AST::Node::Root < ::Mustermann::AST::Node + # Returns the value of attribute pattern. + # + # source://mustermann//lib/mustermann/ast/node.rb#162 + def pattern; end + + # Sets the attribute pattern + # + # @param value the value to set the attribute pattern to. + # + # source://mustermann//lib/mustermann/ast/node.rb#162 + def pattern=(_arg0); end + + class << self + # Will trigger transform. + # + # @see Mustermann::AST::Node.parse + # + # source://mustermann//lib/mustermann/ast/node.rb#168 + def parse(string, &block); end + end +end + +# source://mustermann//lib/mustermann/ast/node.rb#177 +class Mustermann::AST::Node::Separator < ::Mustermann::AST::Node + # @return [Integer] minimum size for a node + # + # source://mustermann//lib/mustermann/ast/node.rb#180 + def min_size; end +end + +# source://mustermann//lib/mustermann/ast/node.rb#186 +class Mustermann::AST::Node::Splat < ::Mustermann::AST::Node::Capture + # @see Mustermann::AST::Node::Capture#name + # + # source://mustermann//lib/mustermann/ast/node.rb#189 + def name; end +end + +# source://mustermann//lib/mustermann/ast/node.rb#148 +class Mustermann::AST::Node::Union < ::Mustermann::AST::Node::Composition; end + +# AST node for template variables. +# +# source://mustermann//lib/mustermann/ast/node.rb#203 +class Mustermann::AST::Node::Variable < ::Mustermann::AST::Node::Capture + # Returns the value of attribute explode. + # + # source://mustermann//lib/mustermann/ast/node.rb#205 + def explode; end + + # Sets the attribute explode + # + # @param value the value to set the attribute explode to. + # + # source://mustermann//lib/mustermann/ast/node.rb#205 + def explode=(_arg0); end + + # Returns the value of attribute prefix. + # + # source://mustermann//lib/mustermann/ast/node.rb#205 + def prefix; end + + # Sets the attribute prefix + # + # @param value the value to set the attribute prefix to. + # + # source://mustermann//lib/mustermann/ast/node.rb#205 + def prefix=(_arg0); end +end + +# source://mustermann//lib/mustermann/ast/node.rb#209 +class Mustermann::AST::Node::WithLookAhead < ::Mustermann::AST::Node + # @return [WithLookAhead] a new instance of WithLookAhead + # + # source://mustermann//lib/mustermann/ast/node.rb#214 + def initialize(payload, at_end, **options); end + + # Returns the value of attribute at_end. + # + # source://mustermann//lib/mustermann/ast/node.rb#211 + def at_end; end + + # Sets the attribute at_end + # + # @param value the value to set the attribute at_end to. + # + # source://mustermann//lib/mustermann/ast/node.rb#211 + def at_end=(_arg0); end + + # Returns the value of attribute head. + # + # source://mustermann//lib/mustermann/ast/node.rb#211 + def head; end + + # Sets the attribute head + # + # @param value the value to set the attribute head to. + # + # source://mustermann//lib/mustermann/ast/node.rb#211 + def head=(_arg0); end +end + +# Scans an AST for param converters. +# +# @see Mustermann::AST::Pattern#to_templates +# +# source://mustermann//lib/mustermann/ast/param_scanner.rb#9 +class Mustermann::AST::ParamScanner < ::Mustermann::AST::Translator + class << self + # source://mustermann//lib/mustermann/ast/param_scanner.rb#11 + def scan_params(ast); end + end +end + +# source://mustermann//lib/mustermann/ast/param_scanner.rb#0 +class Mustermann::AST::ParamScanner::NodeTranslator < ::Mustermann::AST::Translator::NodeTranslator + class << self + # source://mustermann//lib/mustermann/ast/translator.rb#62 + def translator; end + end +end + +# Simple, StringScanner based parser. +# +# source://mustermann//lib/mustermann/ast/parser.rb#12 +class Mustermann::AST::Parser + extend ::Forwardable + + # @return [Parser] a new instance of Parser + # + # source://mustermann//lib/mustermann/ast/parser.rb#49 + def initialize(pattern: T.unsafe(nil), **options); end + + # Returns the value of attribute buffer. + # + # source://mustermann//lib/mustermann/ast/parser.rb#43 + def buffer; end + + # Create a node for a character we don't have an explicit rule for. + # + # @param char [String] the character + # @return [Mustermann::AST::Node] the node + # + # source://mustermann//lib/mustermann/ast/parser.rb#80 + def default_node(char); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def eos?(*args, **_arg1, &block); end + + # Asserts a regular expression matches what's next on the buffer. + # Will return corresponding MatchData if regexp includes named captures. + # + # @param regexp [Regexp] expected to match + # @raise [Mustermann::ParseError] if expectation wasn't met + # @return [String, MatchData] the match + # + # source://mustermann//lib/mustermann/ast/parser.rb#141 + def expect(regexp, char: T.unsafe(nil), **options); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def getch(*args, **_arg1, &block); end + + # sets start on node to start if it's not set to a lower value. + # sets stop on node to stop if it's not set to a higher value. + # + # @return [Mustermann::AST::Node] the node passed as third argument + # + # source://mustermann//lib/mustermann/ast/parser.rb#100 + def min_size(start, stop, node); end + + # @example + # node(:char, 'x').compile =~ 'x' # => true + # @param type [Symbol] node type + # @return [Mustermann::AST::Node] + # + # source://mustermann//lib/mustermann/ast/parser.rb#68 + def node(type, *args, **_arg2, &block); end + + # @param string [String] to be parsed + # @return [Mustermann::AST::Node] parse tree for string + # + # source://mustermann//lib/mustermann/ast/parser.rb#56 + def parse(string); end + + # Returns the value of attribute pattern. + # + # source://mustermann//lib/mustermann/ast/parser.rb#43 + def pattern; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def pos(*args, **_arg1, &block); end + + # Reads the next element from the buffer. + # + # @return [Mustermann::AST::Node] next element + # + # source://mustermann//lib/mustermann/ast/parser.rb#87 + def read; end + + # Reads an argument string of the format arg1,args2,key:value + # + # source://mustermann//lib/mustermann/ast/parser.rb#172 + def read_args(key_separator, close, separator: T.unsafe(nil), symbol_keys: T.unsafe(nil), **options); end + + # Allows to read a string inside brackets. It does not expect the string + # to start with an opening bracket. + # + # @example + # buffer.string = "fo>ba" + # read_brackets(?<, ?>) # => "fo" + # buffer.rest # => "ba" + # + # source://mustermann//lib/mustermann/ast/parser.rb#154 + def read_brackets(open, close, char: T.unsafe(nil), escape: T.unsafe(nil), quote: T.unsafe(nil), **options); end + + # Read a string until a terminating character, ignoring escaped versions of said character. + # + # source://mustermann//lib/mustermann/ast/parser.rb#210 + def read_escaped(close, escape: T.unsafe(nil), **options); end + + # Reads a separated list with the ability to quote, escape and add spaces. + # + # source://mustermann//lib/mustermann/ast/parser.rb#191 + def read_list(*close, separator: T.unsafe(nil), escape: T.unsafe(nil), quotes: T.unsafe(nil), ignore: T.unsafe(nil), **options); end + + # Checks for a potential suffix on the buffer. + # + # @param element [Mustermann::AST::Node] node without suffix + # @return [Mustermann::AST::Node] node with suffix + # + # source://mustermann//lib/mustermann/ast/parser.rb#112 + def read_suffix(element); end + + # Wrapper around {StringScanner#scan} that turns strings into escaped + # regular expressions and returns a MatchData if the regexp has any + # named captures. + # + # @param regexp [Regexp, String] + # @return [String, MatchData, nil] + # @see StringScanner#scan + # + # source://mustermann//lib/mustermann/ast/parser.rb#128 + def scan(regexp); end + + # Returns the value of attribute string. + # + # source://mustermann//lib/mustermann/ast/parser.rb#43 + def string; end + + # Helper for raising an exception for an unexpected character. + # Will read character from buffer if buffer is passed in. + # + # @param char [String, nil] the unexpected character + # @raise [Mustermann::ParseError, Exception] + # + # source://mustermann//lib/mustermann/ast/parser.rb#228 + def unexpected(char = T.unsafe(nil), exception: T.unsafe(nil)); end + + class << self + # Defines another grammar rule for first character. + # + # @see Mustermann::Rails + # @see Mustermann::Sinatra + # @see Mustermann::Template + # + # source://mustermann//lib/mustermann/ast/parser.rb#26 + def on(*chars, &block); end + + # @param string [String] to be parsed + # @return [Mustermann::AST::Node] parse tree for string + # + # source://mustermann//lib/mustermann/ast/parser.rb#16 + def parse(string, **options); end + + # Defines another grammar rule for a suffix. + # + # @see Mustermann::Sinatra + # + # source://mustermann//lib/mustermann/ast/parser.rb#36 + def suffix(pattern = T.unsafe(nil), after: T.unsafe(nil), &block); end + end +end + +# Superclass for pattern styles that parse an AST from the string pattern. +# +# @abstract +# +# source://mustermann//lib/mustermann/ast/pattern.rb#18 +class Mustermann::AST::Pattern < ::Mustermann::RegexpBased + extend ::SingleForwardable + + # source://forwardable/1.3.3/forwardable.rb#231 + def boundaries(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def compiler(*args, **_arg1, &block); end + + # All AST-based pattern implementations support expanding. + # + # @example Expanding a pattern + # pattern = Mustermann.new('/:name(.:ext)?') + # pattern.expand(name: 'hello') # => "/hello" + # pattern.expand(name: 'hello', ext: 'png') # => "/hello.png" + # @example Checking if a pattern supports expanding + # if pattern.respond_to? :expand + # pattern.expand(name: "foo") + # else + # warn "does not support expanding" + # end + # @param behavior [Symbol] What to do with additional key/value pairs not present in the values hash. + # Possible options: :raise, :ignore, :append. + # @param values [Hash{Symbol: #to_s, Array<#to_s>}] Values to use for expansion. + # @raise [NotImplementedError] raised if expand is not supported. + # @raise [Mustermann::ExpandError] raised if a value is missing or unknown + # @return [String] expanded string + # @see Mustermann::Pattern#expand + # @see Mustermann::Expander + # + # source://mustermann//lib/mustermann/ast/pattern.rb#106 + def expand(behavior = T.unsafe(nil), values = T.unsafe(nil)); end + + # @see Mustermann::Pattern#map_param + # + # source://mustermann//lib/mustermann/ast/pattern.rb#123 + def map_param(key, value); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def param_scanner(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def parser(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def template_generator(*args, **_arg1, &block); end + + # Internal AST representation of pattern. + # + # source://mustermann//lib/mustermann/ast/pattern.rb#88 + def to_ast; end + + # All AST-based pattern implementations support generating templates. + # + # @example generating templates + # Mustermann.new("/:name").to_templates # => ["/{name}"] + # Mustermann.new("/:foo(@:bar)?/*baz").to_templates # => ["/{foo}@{bar}/{+baz}", "/{foo}/{+baz}"] + # Mustermann.new("/{name}", type: :template).to_templates # => ["/{name}"] + # @example generating templates from composite patterns + # pattern = Mustermann.new('/:name') + # pattern |= Mustermann.new('/{name}', type: :template) + # pattern |= Mustermann.new('/example/*nested') + # pattern.to_templates # => ["/{name}", "/example/{+nested}"] + # @example Checking if a pattern supports expanding + # if pattern.respond_to? :to_templates + # pattern.to_templates + # else + # warn "does not support template generation" + # end + # @return [Array] list of URI templates + # @see Mustermann::Pattern#to_templates + # + # source://mustermann//lib/mustermann/ast/pattern.rb#117 + def to_templates; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def transformer(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def validation(*args, **_arg1, &block); end + + private + + # source://mustermann//lib/mustermann/ast/pattern.rb#79 + def compile(**options); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def generate_templates(*args, **_arg1, &block); end + + # source://mustermann//lib/mustermann/ast/pattern.rb#129 + def param_converters; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def parse(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def scan_params(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def set_boundaries(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def transform(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def validate(*args, **_arg1, &block); end + + class << self + # @api private + # @return [#set_boundaries] translator making sure start and stop is set on all nodes + # + # source://mustermann//lib/mustermann/ast/pattern.rb#46 + def boundaries; end + + # @api private + # @return [#compile] compiler object for pattern + # + # source://mustermann//lib/mustermann/ast/pattern.rb#39 + def compiler; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def on(*args, **_arg1, &block); end + + # @api private + # @return [#scan_params] param scanner for pattern + # + # source://mustermann//lib/mustermann/ast/pattern.rb#74 + def param_scanner; end + + # @api private + # @return [#parse] parser object for pattern + # + # source://mustermann//lib/mustermann/ast/pattern.rb#30 + def parser; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def suffix(*args, **_arg1, &block); end + + # @api private + # @return [#generate_templates] generates URI templates for pattern + # + # source://mustermann//lib/mustermann/ast/pattern.rb#67 + def template_generator; end + + # @api private + # @return [#transform] transformer object for pattern + # + # source://mustermann//lib/mustermann/ast/pattern.rb#53 + def transformer; end + + # @api private + # @return [#validate] validation object for pattern + # + # source://mustermann//lib/mustermann/ast/pattern.rb#60 + def validation; end + end +end + +# Turns an AST into an Array of URI templates representing the AST. +# +# @see Mustermann::AST::Pattern#to_templates +# +# source://mustermann//lib/mustermann/ast/template_generator.rb#9 +class Mustermann::AST::TemplateGenerator < ::Mustermann::AST::Translator + class << self + # source://mustermann//lib/mustermann/ast/template_generator.rb#11 + def generate_templates(ast); end + end +end + +# source://mustermann//lib/mustermann/ast/template_generator.rb#0 +class Mustermann::AST::TemplateGenerator::NodeTranslator < ::Mustermann::AST::Translator::NodeTranslator + class << self + # source://mustermann//lib/mustermann/ast/translator.rb#62 + def translator; end + end +end + +# Takes a tree, turns it into an even better tree. +# +# source://mustermann//lib/mustermann/ast/transformer.rb#8 +class Mustermann::AST::Transformer < ::Mustermann::AST::Translator + class << self + # Transforms a tree. + # + # @note might mutate handed in tree instead of creating a new one + # @param tree [Mustermann::AST::Node] to be transformed + # @return [Mustermann::AST::Node] transformed tree + # + # source://mustermann//lib/mustermann/ast/transformer.rb#15 + def transform(tree); end + end +end + +# Inserts with_look_ahead nodes wherever appropriate +# +# source://mustermann//lib/mustermann/ast/transformer.rb#105 +class Mustermann::AST::Transformer::ArrayTransform < ::Mustermann::AST::Transformer::NodeTranslator + # turn look ahead buffer into look ahead node + # + # source://mustermann//lib/mustermann/ast/transformer.rb#142 + def create_lookahead(elements, *args); end + + # can the current element deal with a look-ahead? + # + # @return [Boolean] + # + # source://mustermann//lib/mustermann/ast/transformer.rb#166 + def expect_lookahead?(element); end + + # helper method for deciding where to put an element for now + # + # source://mustermann//lib/mustermann/ast/transformer.rb#173 + def list_for(element); end + + # can the given element be used in a look-ahead? + # + # @return [Boolean] + # + # source://mustermann//lib/mustermann/ast/transformer.rb#149 + def lookahead?(element, in_lookahead = T.unsafe(nil)); end + + # buffer for potential look ahead + # + # source://mustermann//lib/mustermann/ast/transformer.rb#116 + def lookahead_buffer; end + + # does the list of elements look look-ahead-ish to you? + # + # @return [Boolean] + # + # source://mustermann//lib/mustermann/ast/transformer.rb#159 + def lookahead_payload?(payload, in_lookahead); end + + # the new array + # + # source://mustermann//lib/mustermann/ast/transformer.rb#110 + def payload; end + + # handle a single element from the array + # + # source://mustermann//lib/mustermann/ast/transformer.rb#129 + def track(element); end + + # transform the array + # + # source://mustermann//lib/mustermann/ast/transformer.rb#122 + def translate; end +end + +# URI expression transformations depending on operator +# +# source://mustermann//lib/mustermann/ast/transformer.rb#76 +class Mustermann::AST::Transformer::ExpressionTransform < ::Mustermann::AST::Transformer::NodeTranslator + # Sets operator and inserts separators in between variables. + # + # source://mustermann//lib/mustermann/ast/transformer.rb#93 + def translate; end +end + +# source://mustermann//lib/mustermann/ast/transformer.rb#84 +Mustermann::AST::Transformer::ExpressionTransform::OPERATORS = T.let(T.unsafe(nil), Hash) + +# source://mustermann//lib/mustermann/ast/transformer.rb#80 +class Mustermann::AST::Transformer::ExpressionTransform::Operator < ::Struct + def allow_reserved; end + def allow_reserved=(_); end + def parametric; end + def parametric=(_); end + def prefix; end + def prefix=(_); end + def separator; end + def separator=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# turn a group containing or nodes into a union +# +# source://mustermann//lib/mustermann/ast/transformer.rb#30 +class Mustermann::AST::Transformer::GroupTransformer < ::Mustermann::AST::Transformer::NodeTranslator + # source://mustermann//lib/mustermann/ast/transformer.rb#48 + def group(elements); end + + # source://mustermann//lib/mustermann/ast/transformer.rb#55 + def split_payload; end + + # source://mustermann//lib/mustermann/ast/transformer.rb#34 + def translate; end + + # source://mustermann//lib/mustermann/ast/transformer.rb#42 + def union; end +end + +# source://mustermann//lib/mustermann/ast/transformer.rb#0 +class Mustermann::AST::Transformer::NodeTranslator < ::Mustermann::AST::Translator::NodeTranslator + class << self + # source://mustermann//lib/mustermann/ast/translator.rb#62 + def translator; end + end +end + +# inject a union node right inside the root node if it contains or nodes +# +# source://mustermann//lib/mustermann/ast/transformer.rb#64 +class Mustermann::AST::Transformer::RootTransformer < ::Mustermann::AST::Transformer::GroupTransformer + # source://mustermann//lib/mustermann/ast/transformer.rb#68 + def union; end +end + +# Implements translator pattern +# +# @abstract +# +# source://mustermann//lib/mustermann/ast/translator.rb#13 +class Mustermann::AST::Translator + # @param node [Mustermann::AST::Node, Object] to translate + # @raise [error_class] + # @return decorator encapsulating translation + # + # source://mustermann//lib/mustermann/ast/translator.rb#108 + def decorator_for(node); end + + # source://mustermann//lib/mustermann/ast/translator.rb#70 + def error_class; end + + # @return [String] escaped character + # + # source://mustermann//lib/mustermann/ast/translator.rb#124 + def escape(char, parser: T.unsafe(nil), escape: T.unsafe(nil), also_escape: T.unsafe(nil)); end + + # Start the translation dance for a (sub)tree. + # + # source://mustermann//lib/mustermann/ast/translator.rb#116 + def translate(node, *args, **_arg2, &block); end + + class << self + # Enables quick creation of a translator object. + # + # @example + # require 'mustermann' + # require 'mustermann/ast/translator' + # + # translator = Mustermann::AST::Translator.create do + # translate(:node) { [type, *t(payload)].flatten.compact } + # translate(Array) { map { |e| t(e) } } + # translate(Object) { } + # end + # + # ast = Mustermann.new('/:name').to_ast + # translator.translate(ast) # => [:root, :separator, :capture] + # + # source://mustermann//lib/mustermann/ast/translator.rb#98 + def create(&block); end + + # maps types to translations + # + # source://mustermann//lib/mustermann/ast/translator.rb#54 + def dispatch_table; end + + # some magic sauce so {NodeTranslator}s know whom to talk to for {#register} + # + # source://mustermann//lib/mustermann/ast/translator.rb#60 + def inherited(subclass); end + + # DSL-ish method for specifying the exception class to use. + # + # source://mustermann//lib/mustermann/ast/translator.rb#69 + def raises(error); end + + # DSL method for defining single method translations. + # + # source://mustermann//lib/mustermann/ast/translator.rb#75 + def translate(*types, &block); end + end +end + +# Encapsulates a single node translation +# +# source://mustermann//lib/mustermann/ast/translator.rb#19 +class Mustermann::AST::Translator::NodeTranslator + # @param node [Mustermann::AST::Node, Object] + # @param translator [Mustermann::AST::Translator] + # @return [NodeTranslator] a new instance of NodeTranslator + # + # source://mustermann//lib/mustermann/ast/translator.rb#33 + def initialize(node, translator); end + + # source://delegate/0.3.1/delegate.rb#402 + def node; end + + # shorthand for translating a nested object + # + # source://mustermann//lib/mustermann/ast/translator.rb#43 + def t(*args, **_arg1, &block); end + + # Returns the value of attribute translator. + # + # source://mustermann//lib/mustermann/ast/translator.rb#39 + def translator; end + + class << self + # @param types [Array] list of types to register for. + # + # source://mustermann//lib/mustermann/ast/translator.rb#22 + def register(*types); end + end +end + +# source://mustermann//lib/mustermann/ast/translator.rb#15 +Mustermann::AST::Translator::URI_PARSER = T.let(T.unsafe(nil), URI::RFC2396_Parser) + +# Checks the AST for certain validations, like correct capture names. +# +# Internally a poor man's visitor (abusing translator to not have to implement a visitor). +# +# source://mustermann//lib/mustermann/ast/validation.rb#10 +class Mustermann::AST::Validation < ::Mustermann::AST::Translator + # @raise [Mustermann::CompileError] if name is not acceptable + # + # source://mustermann//lib/mustermann/ast/validation.rb#30 + def check_name(name, forbidden: T.unsafe(nil)); end + + # @return [Array] list of capture names in tree + # + # source://mustermann//lib/mustermann/ast/validation.rb#40 + def names; end + + class << self + # Runs validations. + # + # @param ast [Mustermann::AST::Node] to be validated + # @raise [Mustermann::AST::CompileError] if validation fails + # @return [Mustermann::AST::Node] the validated ast + # + # source://mustermann//lib/mustermann/ast/validation.rb#17 + def validate(ast); end + end +end + +# source://mustermann//lib/mustermann/ast/validation.rb#0 +class Mustermann::AST::Validation::NodeTranslator < ::Mustermann::AST::Translator::NodeTranslator + class << self + # source://mustermann//lib/mustermann/ast/translator.rb#62 + def translator; end + end +end + +# Class for defining and running simple Hash transformations. +# +# @example +# caster = Mustermann::Caster.new +# caster.register(:foo) { |value| { bar: value.upcase } } +# caster.cast(foo: "hello", baz: "world") # => { bar: "HELLO", baz: "world" } +# @see Mustermann::Expander#cast +# +# source://mustermann//lib/mustermann/caster.rb#15 +class Mustermann::Caster + # @param types [Array] identifier for cast type (some need block) + # @return [Caster] a new instance of Caster + # + # source://mustermann//lib/mustermann/caster.rb#18 + def initialize(*types, &block); end + + # Transforms a Hash. + # + # @param hash [Hash] pre-transform Hash + # @return [Hash] post-transform Hash + # + # source://mustermann//lib/mustermann/caster.rb#45 + def cast(hash); end + + # @param type [Symbol, Regexp, #cast, #===] identifier for cast type (some need block) + # @return [#cast] specific cast operation + # + # source://mustermann//lib/mustermann/caster.rb#34 + def caster_for(type, &block); end + + # @param types [Array] identifier for cast type (some need block) + # + # source://mustermann//lib/mustermann/caster.rb#25 + def register(*types, &block); end +end + +# Class for block based casts that are triggered for every key/value pair. +# +# source://mustermann//lib/mustermann/caster.rb#58 +class Mustermann::Caster::Any + # @return [Any] a new instance of Any + # + # source://mustermann//lib/mustermann/caster.rb#60 + def initialize(&block); end + + # @see Mustermann::Caster#cast + # + # source://mustermann//lib/mustermann/caster.rb#66 + def cast(key, value); end +end + +# Class for block based casts that are triggered for key/value pairs with a matching key. +# +# source://mustermann//lib/mustermann/caster.rb#94 +class Mustermann::Caster::Key < ::Mustermann::Caster::Any + # @param type [#===] used for matching keys + # @return [Key] a new instance of Key + # + # source://mustermann//lib/mustermann/caster.rb#97 + def initialize(type, &block); end + + # @see Mustermann::Caster#cast + # + # source://mustermann//lib/mustermann/caster.rb#104 + def cast(key, value); end +end + +# Class for block based casts that are triggered for key/value pairs with a matching value. +# +# source://mustermann//lib/mustermann/caster.rb#77 +class Mustermann::Caster::Value < ::Mustermann::Caster::Any + # @param type [#===] used for matching values + # @return [Value] a new instance of Value + # + # source://mustermann//lib/mustermann/caster.rb#80 + def initialize(type, &block); end + + # @see Mustermann::Caster#cast + # + # source://mustermann//lib/mustermann/caster.rb#87 + def cast(key, value); end +end + +# Raised if anything goes wrong while compiling a {Pattern}. +# +# source://mustermann//lib/mustermann/error.rb#5 +class Mustermann::CompileError < ::Mustermann::Error; end + +# Class for pattern objects composed of multiple patterns using binary logic. +# +# @see Mustermann::Pattern#& +# @see Mustermann::Pattern#| +# @see Mustermann::Pattern#^ +# +# source://mustermann//lib/mustermann/composite.rb#7 +class Mustermann::Composite < ::Mustermann::Pattern + # @return [Composite] a new instance of Composite + # + # source://mustermann//lib/mustermann/composite.rb#27 + def initialize(patterns, operator: T.unsafe(nil), **options); end + + # @see Mustermann::Pattern#== + # + # source://mustermann//lib/mustermann/composite.rb#33 + def ==(pattern); end + + # @see Mustermann::Pattern#=== + # + # source://mustermann//lib/mustermann/composite.rb#48 + def ===(string); end + + # @return [Boolean] + # @see Mustermann::Pattern#eql? + # + # source://mustermann//lib/mustermann/composite.rb#38 + def eql?(pattern); end + + # Expanding is supported by almost all patterns (notable exceptions are {Mustermann::Shell}, + # {Mustermann::Regular} and {Mustermann::Simple}). + # + # Union {Mustermann::Composite} patterns (with the | operator) support expanding if all + # patterns they are composed of also support it. + # + # @example Checking if a pattern supports expanding + # if pattern.respond_to? :expand + # pattern.expand(name: "foo") + # else + # warn "does not support expanding" + # end + # @example Expanding a pattern + # pattern = Mustermann.new('/:name(.:ext)?') + # pattern.expand(name: 'hello') # => "/hello" + # pattern.expand(name: 'hello', ext: 'png') # => "/hello.png" + # @note This method is only implemented by certain subclasses. + # @param values [Hash{Symbol: #to_s, Array<#to_s>}] Values to use for expansion. + # @param behavior [Symbol] What to do with additional key/value pairs not present in the values hash. + # Possible options: :raise, :ignore, :append. + # @raise [NotImplementedError] raised if expand is not supported. + # @raise [Mustermann::ExpandError] raised if a value is missing or unknown + # @return [String] expanded string + # @see Mustermann::Expander + # + # source://mustermann//lib/mustermann/composite.rb#69 + def expand(behavior = T.unsafe(nil), values = T.unsafe(nil)); end + + # @see Mustermann::Pattern#hash + # + # source://mustermann//lib/mustermann/composite.rb#43 + def hash; end + + # source://mustermann//lib/mustermann/composite.rb#87 + def inspect; end + + # @see Mustermann::Pattern#match + # + # source://mustermann//lib/mustermann/composite.rb#58 + def match(string); end + + # Returns the value of attribute operator. + # + # source://mustermann//lib/mustermann/composite.rb#8 + def operator; end + + # @see Mustermann::Pattern#params + # + # source://mustermann//lib/mustermann/composite.rb#53 + def params(string); end + + # Returns the value of attribute patterns. + # + # source://mustermann//lib/mustermann/composite.rb#8 + def patterns; end + + # @return [Boolean] + # + # source://mustermann//lib/mustermann/composite.rb#63 + def respond_to_special?(method); end + + # source://mustermann//lib/mustermann/composite.rb#92 + def simple_inspect; end + + # @return [String] the string representation of the pattern + # + # source://mustermann//lib/mustermann/composite.rb#82 + def to_s; end + + # Generates a list of URI template strings representing the pattern. + # + # Note that this transformation is lossy and the strings matching these + # templates might not match the pattern (and vice versa). + # + # This comes in quite handy since URI templates are not made for pattern matching. + # That way you can easily use a more precise template syntax and have it automatically + # generate hypermedia links for you. + # + # Template generation is supported by almost all patterns (notable exceptions are + # {Mustermann::Shell}, {Mustermann::Regular} and {Mustermann::Simple}). + # Union {Mustermann::Composite} patterns (with the | operator) support template generation + # if all patterns they are composed of also support it. + # + # @example generating templates + # Mustermann.new("/:name").to_templates # => ["/{name}"] + # Mustermann.new("/:foo(@:bar)?/*baz").to_templates # => ["/{foo}@{bar}/{+baz}", "/{foo}/{+baz}"] + # Mustermann.new("/{name}", type: :template).to_templates # => ["/{name}"] + # @example generating templates from composite patterns + # pattern = Mustermann.new('/:name') + # pattern |= Mustermann.new('/{name}', type: :template) + # pattern |= Mustermann.new('/example/*nested') + # pattern.to_templates # => ["/{name}", "/example/{+nested}"] + # @example Checking if a pattern supports expanding + # if pattern.respond_to? :to_templates + # pattern.to_templates + # else + # warn "does not support template generation" + # end + # @note This method is only implemented by certain subclasses. + # @return [Array] list of URI templates + # + # source://mustermann//lib/mustermann/composite.rb#76 + def to_templates; end + + private + + # source://mustermann//lib/mustermann/composite.rb#105 + def patterns_from(pattern, **options); end + + # source://mustermann//lib/mustermann/composite.rb#98 + def with_matching(string, method); end + + class << self + # @return [Mustermann::Pattern] a new composite pattern + # + # source://mustermann//lib/mustermann/composite.rb#18 + def new(*patterns, **options); end + + # @return [Boolean] + # @see Mustermann::Pattern.supported? + # + # source://mustermann//lib/mustermann/composite.rb#12 + def supported?(option, type: T.unsafe(nil), **options); end + end +end + +# Class for pattern objects that are a concatenation of other patterns. +# +# @see Mustermann::Pattern#+ +# +# source://mustermann//lib/mustermann/concat.rb#5 +class Mustermann::Concat < ::Mustermann::Composite + # Should not be used directly. + # + # @return [Concat] a new instance of Concat + # + # source://mustermann//lib/mustermann/concat.rb#43 + def initialize(*_arg0, **_arg1); end + + # @see Mustermann::Pattern#=== + # + # source://mustermann//lib/mustermann/concat.rb#55 + def ===(string); end + + # Expanding is supported by almost all patterns (notable exceptions are {Mustermann::Shell}, + # {Mustermann::Regular} and {Mustermann::Simple}). + # + # Union {Mustermann::Composite} patterns (with the | operator) support expanding if all + # patterns they are composed of also support it. + # + # @example Checking if a pattern supports expanding + # if pattern.respond_to? :expand + # pattern.expand(name: "foo") + # else + # warn "does not support expanding" + # end + # @example Expanding a pattern + # pattern = Mustermann.new('/:name(.:ext)?') + # pattern.expand(name: 'hello') # => "/hello" + # pattern.expand(name: 'hello', ext: 'png') # => "/hello.png" + # @note This method is only implemented by certain subclasses. + # @param values [Hash{Symbol: #to_s, Array<#to_s>}] Values to use for expansion. + # @param behavior [Symbol] What to do with additional key/value pairs not present in the values hash. + # Possible options: :raise, :ignore, :append. + # @raise [NotImplementedError] raised if expand is not supported. + # @raise [Mustermann::ExpandError] raised if a value is missing or unknown + # @return [String] expanded string + # @see Mustermann::Expander + # + # source://mustermann//lib/mustermann/concat.rb#90 + def expand(behavior = T.unsafe(nil), values = T.unsafe(nil)); end + + # @see Mustermann::Pattern#match + # + # source://mustermann//lib/mustermann/concat.rb#60 + def match(string); end + + # @return [Symbol] always :+ + # @see Mustermann::Composite#operator + # + # source://mustermann//lib/mustermann/concat.rb#50 + def operator; end + + # @see Mustermann::Pattern#params + # + # source://mustermann//lib/mustermann/concat.rb#66 + def params(string); end + + # @see Mustermann::Pattern#peek_match + # + # source://mustermann//lib/mustermann/concat.rb#77 + def peek_match(string); end + + # @see Mustermann::Pattern#peek_params + # + # source://mustermann//lib/mustermann/concat.rb#85 + def peek_params(string); end + + # @see Mustermann::Pattern#peek_size + # + # source://mustermann//lib/mustermann/concat.rb#72 + def peek_size(string); end + + # @return [Boolean] + # + # source://mustermann//lib/mustermann/concat.rb#103 + def respond_to_special?(method); end + + # Generates a list of URI template strings representing the pattern. + # + # Note that this transformation is lossy and the strings matching these + # templates might not match the pattern (and vice versa). + # + # This comes in quite handy since URI templates are not made for pattern matching. + # That way you can easily use a more precise template syntax and have it automatically + # generate hypermedia links for you. + # + # Template generation is supported by almost all patterns (notable exceptions are + # {Mustermann::Shell}, {Mustermann::Regular} and {Mustermann::Simple}). + # Union {Mustermann::Composite} patterns (with the | operator) support template generation + # if all patterns they are composed of also support it. + # + # @example generating templates + # Mustermann.new("/:name").to_templates # => ["/{name}"] + # Mustermann.new("/:foo(@:bar)?/*baz").to_templates # => ["/{foo}@{bar}/{+baz}", "/{foo}/{+baz}"] + # Mustermann.new("/{name}", type: :template).to_templates # => ["/{name}"] + # @example generating templates from composite patterns + # pattern = Mustermann.new('/:name') + # pattern |= Mustermann.new('/{name}', type: :template) + # pattern |= Mustermann.new('/example/*nested') + # pattern.to_templates # => ["/{name}", "/example/{+nested}"] + # @example Checking if a pattern supports expanding + # if pattern.respond_to? :to_templates + # pattern.to_templates + # else + # warn "does not support template generation" + # end + # @note This method is only implemented by certain subclasses. + # @return [Array] list of URI templates + # + # source://mustermann//lib/mustermann/concat.rb#97 + def to_templates; end + + private + + # generates one big AST from all patterns + # will not check if patterns support AST generation + # + # source://mustermann//lib/mustermann/concat.rb#129 + def combined_ast; end + + # used to generate results for various methods by scanning through an input string + # + # source://mustermann//lib/mustermann/concat.rb#110 + def pump(string, inject_with: T.unsafe(nil), initial: T.unsafe(nil), with_size: T.unsafe(nil)); end +end + +# Mixin for patterns to support native concatenation. +# +# source://mustermann//lib/mustermann/concat.rb#8 +module Mustermann::Concat::Native + # @see Mustermann::Pattern#+ + # + # source://mustermann//lib/mustermann/concat.rb#11 + def +(other); end + + # source://mustermann//lib/mustermann/concat.rb#23 + def look_ahead(other); end + + private + + # source://mustermann//lib/mustermann/concat.rb#29 + def native_concat(other); end + + # @return [Boolean] + # + # source://mustermann//lib/mustermann/concat.rb#34 + def native_concat?(other); end +end + +# Type to use if no type is given. +# +# @api private +# +# source://mustermann//lib/mustermann.rb#13 +Mustermann::DEFAULT_TYPE = T.let(T.unsafe(nil), Symbol) + +# A simple wrapper around ObjectSpace::WeakMap that allows matching keys by equality rather than identity. +# Used for caching. Note that `fetch` is not guaranteed to return the object, even if it has not been +# garbage collected yet, especially when used concurrently. Therefore, the block passed to `fetch` has to +# be idempotent. +# +# @example +# class ExpensiveComputation +# @map = Mustermann::EqualityMap.new +# +# def self.new(*args) +# @map.fetch(args) { super } +# end +# end +# @see #fetch +# +# source://mustermann//lib/mustermann/equality_map.rb#18 +class Mustermann::EqualityMap + # @return [EqualityMap] a new instance of EqualityMap + # + # source://mustermann//lib/mustermann/equality_map.rb#25 + def initialize; end + + # @param key [#hash] for caching + # @return value stored in map or result of block + # @yield block that will be called to populate entry if missing (has to be idempotent) + # + # source://mustermann//lib/mustermann/equality_map.rb#33 + def fetch(key); end + + # Returns the value of attribute map. + # + # source://mustermann//lib/mustermann/equality_map.rb#19 + def map; end + + private + + # Finalizer proc needs to be generated in different scope so it doesn't keep a reference to the object. + # + # @param hash [Integer] for key + # @return [Proc] finalizer callback + # + # source://mustermann//lib/mustermann/equality_map.rb#60 + def finalizer(hash); end + + # @param key [#hash] for identifying the object + # @param object [Object] to be stored + # @return [Object] same as the second parameter + # + # source://mustermann//lib/mustermann/equality_map.rb#49 + def track(key, object); end + + class << self + # source://mustermann//lib/mustermann/equality_map.rb#21 + def new; end + end +end + +# Raised if anything goes wrong while generating a {Pattern}. +# +# source://mustermann//lib/mustermann/error.rb#4 +class Mustermann::Error < ::StandardError; end + +# Raised if anything goes wrong while expanding a {Pattern}. +# +# source://mustermann//lib/mustermann/error.rb#7 +class Mustermann::ExpandError < ::Mustermann::Error; end + +# Allows fine-grained control over pattern expansion. +# +# @example +# expander = Mustermann::Expander.new(additional_values: :append) +# expander << "/users/:user_id" +# expander << "/pages/:page_id" +# +# expander.expand(page_id: 58, format: :html5) # => "/pages/58?format=html5" +# +# source://mustermann//lib/mustermann/expander.rb#15 +class Mustermann::Expander + # @param patterns [Array<#to_str, Mustermann::Pattern>] list of patterns to expand, see {#add}. + # @param additional_values [Symbol] behavior when encountering additional values, see {#expand}. + # @param options [Hash] used when creating/expanding patterns, see {Mustermann.new}. + # @return [Expander] a new instance of Expander + # + # source://mustermann//lib/mustermann/expander.rb#21 + def initialize(*patterns, additional_values: T.unsafe(nil), **options, &block); end + + # Add patterns to expand. + # + # @example + # expander = Mustermann::Expander.new + # expander.add("/:a.jpg", "/:b.png") + # expander.expand(a: "pony") # => "/pony.jpg" + # @param patterns [Array<#to_str, Mustermann::Pattern>] list of to add for expansion, Strings will be compiled to patterns. + # @return [Mustermann::Expander] the expander + # + # source://mustermann//lib/mustermann/expander.rb#43 + def <<(*patterns); end + + # @see Object#== + # + # source://mustermann//lib/mustermann/expander.rb#158 + def ==(other); end + + # Add patterns to expand. + # + # @example + # expander = Mustermann::Expander.new + # expander.add("/:a.jpg", "/:b.png") + # expander.expand(a: "pony") # => "/pony.jpg" + # @param patterns [Array<#to_str, Mustermann::Pattern>] list of to add for expansion, Strings will be compiled to patterns. + # @return [Mustermann::Expander] the expander + # + # source://mustermann//lib/mustermann/expander.rb#43 + def add(*patterns); end + + # Returns the value of attribute additional_values. + # + # source://mustermann//lib/mustermann/expander.rb#16 + def additional_values; end + + # Register a block as simple hash transformation that runs before expanding the pattern. + # + # @overload cast + # @overload cast + # @overload cast + # @return [Mustermann::Expander] the expander + # + # source://mustermann//lib/mustermann/expander.rb#115 + def cast(*types, &block); end + + # @return [Boolean] + # @see Object#eql? + # + # source://mustermann//lib/mustermann/expander.rb#164 + def eql?(other); end + + # @example Handling additional values + # pattern = Mustermann::Expander.new('/:name', '/:name.:ext') + # pattern.expand(:ignore, name: 'hello', ext: 'png', scale: '2x') # => "/hello.png" + # pattern.expand(:append, name: 'hello', ext: 'png', scale: '2x') # => "/hello.png?scale=2x" + # pattern.expand(:raise, name: 'hello', ext: 'png', scale: '2x') # raises Mustermann::ExpandError + # @example Expanding a pattern + # pattern = Mustermann::Expander.new('/:name', '/:name.:ext') + # pattern.expand(name: 'hello') # => "/hello" + # pattern.expand(name: 'hello', ext: 'png') # => "/hello.png" + # @example Setting additional values behavior for the expander object + # pattern = Mustermann::Expander.new('/:name', '/:name.:ext', additional_values: :append) + # pattern.expand(name: 'hello', ext: 'png', scale: '2x') # => "/hello.png?scale=2x" + # @param values [Hash{Symbol: #to_s, Array<#to_s>}] Values to use for expansion. + # @param behavior [Symbol] What to do with additional key/value pairs not present in the values hash. + # Possible options: :raise, :ignore, :append. + # @raise [NotImplementedError] raised if expand is not supported. + # @raise [Mustermann::ExpandError] raised if a value is missing or unknown + # @return [String] expanded string + # + # source://mustermann//lib/mustermann/expander.rb#145 + def expand(behavior = T.unsafe(nil), values = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://mustermann//lib/mustermann/expander.rb#174 + def expandable?(values); end + + # @see Object#hash + # + # source://mustermann//lib/mustermann/expander.rb#170 + def hash; end + + # Returns the value of attribute patterns. + # + # source://mustermann//lib/mustermann/expander.rb#16 + def patterns; end + + private + + # source://mustermann//lib/mustermann/expander.rb#195 + def append(uri, values); end + + # Returns the value of attribute caster. + # + # source://mustermann//lib/mustermann/expander.rb#16 + def caster; end + + # source://mustermann//lib/mustermann/expander.rb#201 + def map_values(values); end + + # source://mustermann//lib/mustermann/expander.rb#191 + def slice(hash, keys); end + + # source://mustermann//lib/mustermann/expander.rb#185 + def split_values(values); end + + # @yield [expand(:raise, slice(values, expandable)), slice(values, non_expandable)] + # + # source://mustermann//lib/mustermann/expander.rb#180 + def with_rest(values); end +end + +# Matches strings that are identical to the pattern. +# +# @example +# Mustermann.new('/:foo', type: :identity) === '/bar' # => false +# @see Mustermann::Pattern +# @see file:README.md#identity Syntax description in the README +# +# source://mustermann//lib/mustermann/identity.rb#14 +class Mustermann::Identity < ::Mustermann::Pattern + include ::Mustermann::Concat::Native + + # @param string [String] The string to match against + # @return [Boolean] Whether or not the pattern matches the given string + # @see http://ruby-doc.org/core-2.0/Regexp.html#method-i-3D-3D-3D Regexp#=== + # + # source://mustermann//lib/mustermann/identity.rb#21 + def ===(string); end + + # Identity patterns support expanding. + # + # This implementation does not use {Mustermann::Expander} internally to save memory and + # compilation time. + # + # @example Checking if a pattern supports expanding + # if pattern.respond_to? :expand + # pattern.expand(name: "foo") + # else + # warn "does not support expanding" + # end + # @example Expanding a pattern + # pattern = Mustermann.new('/:name(.:ext)?') + # pattern.expand(name: 'hello') # => "/hello" + # pattern.expand(name: 'hello', ext: 'png') # => "/hello.png" + # @param behavior [Symbol] What to do with additional key/value pairs not present in the values hash. + # Possible options: :raise, :ignore, :append. + # @param values [Hash{Symbol: #to_s, Array<#to_s>}] Values to use for expansion. + # @raise [NotImplementedError] raised if expand is not supported. + # @raise [ExpandError] + # @raise [Mustermann::ExpandError] raised if a value is missing or unknown + # @return [String] expanded string + # @see Mustermann::Pattern#expand + # @see Mustermann::Expander + # + # source://mustermann//lib/mustermann/identity.rb#68 + def expand(behavior = T.unsafe(nil), values = T.unsafe(nil)); end + + # @param string [String] The string to match against + # @return [Integer, nil] the number of characters that match + # + # source://mustermann//lib/mustermann/identity.rb#28 + def peek_size(string); end + + # Generates an AST so it's compatible with {Mustermann::AST::Pattern}. + # Not used internally by {Mustermann::Identity}. + # + # source://mustermann//lib/mustermann/identity.rb#52 + def to_ast; end + + # URI templates support generating templates (the logic is quite complex, though). + # + # @example generating templates + # Mustermann.new("/:name").to_templates # => ["/{name}"] + # Mustermann.new("/:foo(@:bar)?/*baz").to_templates # => ["/{foo}@{bar}/{+baz}", "/{foo}/{+baz}"] + # Mustermann.new("/{name}", type: :template).to_templates # => ["/{name}"] + # @example generating templates from composite patterns + # pattern = Mustermann.new('/:name') + # pattern |= Mustermann.new('/{name}', type: :template) + # pattern |= Mustermann.new('/example/*nested') + # pattern.to_templates # => ["/{name}", "/example/{+nested}"] + # @example Checking if a pattern supports expanding + # if pattern.respond_to? :to_templates + # pattern.to_templates + # else + # warn "does not support template generation" + # end + # @return [Array] list of URI templates + # @see Mustermann::Pattern#to_templates + # + # source://mustermann//lib/mustermann/identity.rb#45 + def to_templates; end +end + +# Raised if anything goes wrong while parsing a {Pattern}. +# +# source://mustermann//lib/mustermann/error.rb#6 +class Mustermann::ParseError < ::Mustermann::Error; end + +# Superclass for all pattern implementations. +# +# @abstract +# +# source://mustermann//lib/mustermann/pattern.rb#10 +class Mustermann::Pattern + include ::Mustermann + + # @overload initialize + # @param string [String] the string representation of the pattern + # @param options [Hash] options for fine-tuning the pattern behavior + # @raise [Mustermann::Error] if the pattern can't be generated from the string + # @return [Pattern] a new instance of Pattern + # @see file:README.md#Types_and_Options "Types and Options" in the README + # @see Mustermann.new + # + # source://mustermann//lib/mustermann/pattern.rb#75 + def initialize(string, uri_decode: T.unsafe(nil), **options); end + + # @overload | + # @overload & + # @overload ^ + # @param other [Mustermann::Pattern, String] the other pattern + # @return [Mustermann::Pattern] a composite pattern + # + # source://mustermann//lib/mustermann/pattern.rb#315 + def &(other); end + + # Creates a concatenated pattern by combingin self with the other pattern supplied. + # Patterns of different types can be mixed. The availability of `to_templates` and + # `expand` depends on the patterns being concatenated. + # + # String input is treated as identity pattern. + # + # @example + # require 'mustermann' + # prefix = Mustermann.new("/:prefix") + # about = prefix + "/about" + # about.params("/main/about") # => {"prefix" => "main"} + # @param other [Mustermann::Pattern, String] pattern to be appended + # @return [Mustermann::Pattern] concatenated pattern + # + # source://mustermann//lib/mustermann/pattern.rb#336 + def +(other); end + + # Two patterns are considered equal if they are of the same type, have the same pattern string + # and the same options. + # + # @return [true, false] + # + # source://mustermann//lib/mustermann/pattern.rb#119 + def ==(other); end + + # @note Needs to be overridden by subclass. + # @param string [String] The string to match against + # @raise [NotImplementedError] + # @return [Boolean] Whether or not the pattern matches the given string + # @see http://ruby-doc.org/core-2.0/Regexp.html#method-i-3D-3D-3D Regexp#=== + # + # source://mustermann//lib/mustermann/pattern.rb#106 + def ===(string); end + + # @param string [String] The string to match against + # @return [Integer, nil] nil if pattern does not match the string, zero if it does. + # @see http://ruby-doc.org/core-2.0/Regexp.html#method-i-3D-7E Regexp#=~ + # + # source://mustermann//lib/mustermann/pattern.rb#98 + def =~(string); end + + # @overload | + # @overload & + # @overload ^ + # @param other [Mustermann::Pattern, String] the other pattern + # @return [Mustermann::Pattern] a composite pattern + # + # source://mustermann//lib/mustermann/pattern.rb#315 + def ^(other); end + + # @return [Boolean] + # + # source://mustermann//lib/mustermann/pattern.rb#391 + def always_array?(key); end + + # Two patterns are considered equal if they are of the same type, have the same pattern string + # and the same options. + # + # @return [true, false] + # + # source://mustermann//lib/mustermann/pattern.rb#126 + def eql?(other); end + + # Expanding is supported by almost all patterns (notable exceptions are {Mustermann::Shell}, + # {Mustermann::Regular} and {Mustermann::Simple}). + # + # Union {Mustermann::Composite} patterns (with the | operator) support expanding if all + # patterns they are composed of also support it. + # + # @example Checking if a pattern supports expanding + # if pattern.respond_to? :expand + # pattern.expand(name: "foo") + # else + # warn "does not support expanding" + # end + # @example Expanding a pattern + # pattern = Mustermann.new('/:name(.:ext)?') + # pattern.expand(name: 'hello') # => "/hello" + # pattern.expand(name: 'hello', ext: 'png') # => "/hello.png" + # @note This method is only implemented by certain subclasses. + # @param values [Hash{Symbol: #to_s, Array<#to_s>}] Values to use for expansion. + # @param behavior [Symbol] What to do with additional key/value pairs not present in the values hash. + # Possible options: :raise, :ignore, :append. + # @raise [NotImplementedError] raised if expand is not supported. + # @raise [Mustermann::ExpandError] raised if a value is missing or unknown + # @return [String] expanded string + # @see Mustermann::Expander + # + # source://mustermann//lib/mustermann/pattern.rb#240 + def expand(behavior = T.unsafe(nil), values = T.unsafe(nil)); end + + # Used by Ruby internally for hashing. + # + # @return [Integer] same has value for patterns that are equal + # + # source://mustermann//lib/mustermann/pattern.rb#112 + def hash; end + + # source://mustermann//lib/mustermann/pattern.rb#366 + def inspect; end + + # @param string [String] The string to match against + # @return [MatchData, Mustermann::SimpleMatch, nil] MatchData or similar object if the pattern matches. + # @see http://ruby-doc.org/core-2.0/Regexp.html#method-i-match Regexp#match + # @see http://ruby-doc.org/core-2.0/MatchData.html MatchData + # @see Mustermann::SimpleMatch + # + # source://mustermann//lib/mustermann/pattern.rb#91 + def match(string); end + + # @return [Hash{String: Array}] capture names mapped to capture index. + # @see http://ruby-doc.org/core-2.0/Regexp.html#method-i-named_captures Regexp#named_captures + # + # source://mustermann//lib/mustermann/pattern.rb#192 + def named_captures; end + + # @return [Array] capture names. + # @see http://ruby-doc.org/core-2.0/Regexp.html#method-i-names Regexp#names + # + # source://mustermann//lib/mustermann/pattern.rb#198 + def names; end + + # options hash passed to new (with unsupported options removed) + # + # source://mustermann//lib/mustermann/pattern.rb#67 + def options; end + + # @param string [String] the string to match against + # @return [Hash{String: String, Array}, nil] Sinatra style params if pattern matches. + # + # source://mustermann//lib/mustermann/pattern.rb#204 + def params(string = T.unsafe(nil), captures: T.unsafe(nil), offset: T.unsafe(nil)); end + + # Tries to match the pattern against the beginning of the string (as opposed to the full string). + # Will return the substring if it matches. + # + # @example + # pattern = Mustermann.new('/:name') + # pattern.peek("/Frank/Sinatra") # => "/Frank" + # @param string [String] The string to match against + # @return [String, nil] matched subsctring + # + # source://mustermann//lib/mustermann/pattern.rb#153 + def peek(string); end + + # Tries to match the pattern against the beginning of the string (as opposed to the full string). + # Will return a MatchData or similar instance for the matched substring. + # + # @example + # pattern = Mustermann.new('/:name') + # pattern.peek("/Frank/Sinatra") # => # + # @param string [String] The string to match against + # @return [MatchData, Mustermann::SimpleMatch, nil] MatchData or similar object if the pattern matches. + # @see #peek_params + # + # source://mustermann//lib/mustermann/pattern.rb#168 + def peek_match(string); end + + # Tries to match the pattern against the beginning of the string (as opposed to the full string). + # Will return a two element Array with the params parsed from the substring as first entry and the length of + # the substring as second. + # + # @example + # pattern = Mustermann.new('/:name') + # params, _ = pattern.peek_params("/Frank/Sinatra") + # + # puts "Hello, #{params['name']}!" # Hello, Frank! + # @param string [String] The string to match against + # @return [Array, nil] Array with params hash and length of substing if matched, nil otherwise + # + # source://mustermann//lib/mustermann/pattern.rb#185 + def peek_params(string); end + + # Tries to match the pattern against the beginning of the string (as opposed to the full string). + # Will return the count of the matching characters if it matches. + # + # @example + # pattern = Mustermann.new('/:name') + # pattern.size("/Frank/Sinatra") # => 6 + # @param string [String] The string to match against + # @return [Integer, nil] the number of characters that match + # + # source://mustermann//lib/mustermann/pattern.rb#139 + def peek_size(string); end + + # @return [Boolean] + # @see Object#respond_to? + # + # source://mustermann//lib/mustermann/pattern.rb#353 + def respond_to?(method, *args); end + + # source://mustermann//lib/mustermann/pattern.rb#371 + def simple_inspect; end + + # @example + # pattern = Mustermann.new('/:a/:b') + # strings = ["foo/bar", "/foo/bar", "/foo/bar/"] + # strings.detect(&pattern) # => "/foo/bar" + # @return [Proc] proc wrapping {#===} + # + # source://mustermann//lib/mustermann/pattern.rb#346 + def to_proc; end + + # @return [String] the string representation of the pattern + # + # source://mustermann//lib/mustermann/pattern.rb#82 + def to_s; end + + # Generates a list of URI template strings representing the pattern. + # + # Note that this transformation is lossy and the strings matching these + # templates might not match the pattern (and vice versa). + # + # This comes in quite handy since URI templates are not made for pattern matching. + # That way you can easily use a more precise template syntax and have it automatically + # generate hypermedia links for you. + # + # Template generation is supported by almost all patterns (notable exceptions are + # {Mustermann::Shell}, {Mustermann::Regular} and {Mustermann::Simple}). + # Union {Mustermann::Composite} patterns (with the | operator) support template generation + # if all patterns they are composed of also support it. + # + # @example generating templates + # Mustermann.new("/:name").to_templates # => ["/{name}"] + # Mustermann.new("/:foo(@:bar)?/*baz").to_templates # => ["/{foo}@{bar}/{+baz}", "/{foo}/{+baz}"] + # Mustermann.new("/{name}", type: :template).to_templates # => ["/{name}"] + # @example generating templates from composite patterns + # pattern = Mustermann.new('/:name') + # pattern |= Mustermann.new('/{name}', type: :template) + # pattern |= Mustermann.new('/example/*nested') + # pattern.to_templates # => ["/{name}", "/example/{+nested}"] + # @example Checking if a pattern supports expanding + # if pattern.respond_to? :to_templates + # pattern.to_templates + # else + # warn "does not support template generation" + # end + # @note This method is only implemented by certain subclasses. + # @raise [NotImplementedError] + # @return [Array] list of URI templates + # + # source://mustermann//lib/mustermann/pattern.rb#279 + def to_templates; end + + # Returns the value of attribute uri_decode. + # + # source://mustermann//lib/mustermann/pattern.rb#63 + def uri_decode; end + + # @overload | + # @overload & + # @overload ^ + # @param other [Mustermann::Pattern, String] the other pattern + # @return [Mustermann::Pattern] a composite pattern + # + # source://mustermann//lib/mustermann/pattern.rb#315 + def |(other); end + + private + + # source://mustermann//lib/mustermann/pattern.rb#377 + def map_param(key, value); end + + # @return [Boolean] + # @see #respond_to? + # + # source://mustermann//lib/mustermann/pattern.rb#361 + def respond_to_special?(method); end + + # source://mustermann//lib/mustermann/pattern.rb#382 + def unescape(string, decode = T.unsafe(nil)); end + + class << self + # @overload new + # @param string [String] the string representation of the pattern + # @param options [Hash] options for fine-tuning the pattern behavior + # @raise [ArgumentError] if some option is not supported + # @raise [Mustermann::Error] if the pattern can't be generated from the string + # @return [Mustermann::Pattern] a new instance of Mustermann::Pattern + # @see #initialize + # + # source://mustermann//lib/mustermann/pattern.rb#50 + def new(string, ignore_unknown_options: T.unsafe(nil), **options); end + + # Registers the pattern with Mustermann. + # + # @see Mustermann.register + # + # source://mustermann//lib/mustermann/pattern.rb#34 + def register(*names); end + + # @param option [Symbol] The option to check. + # @return [Boolean] Whether or not option is supported. + # + # source://mustermann//lib/mustermann/pattern.rb#40 + def supported?(option, **options); end + + # List of supported options. + # + # @overload supported_options + # @overload supported_options + # + # source://mustermann//lib/mustermann/pattern.rb#24 + def supported_options(*list); end + end +end + +# source://mustermann//lib/mustermann/pattern.rb#388 +Mustermann::Pattern::ALWAYS_ARRAY = T.let(T.unsafe(nil), Array) + +# Superclass for patterns that internally compile to a regular expression. +# +# @abstract +# @see Mustermann::Pattern +# +# source://mustermann//lib/mustermann/regexp_based.rb#9 +class Mustermann::RegexpBased < ::Mustermann::Pattern + extend ::Forwardable + + # @param string [String] the string representation of the pattern + # @param options [Hash] options for fine-tuning the pattern behavior + # @return [Pattern] a new instance of Pattern + # @see file:README.md#Types_and_Options "Types and Options" in the README + # @see Mustermann.new + # + # source://mustermann//lib/mustermann/regexp_based.rb#17 + def initialize(string, **options); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def ===(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def =~(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def match(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def named_captures(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def names(*args, **_arg1, &block); end + + # @param string [String] The string to match against + # @return [MatchData, Mustermann::SimpleMatch, nil] MatchData or similar object if the pattern matches. + # @see #peek_params + # + # source://mustermann//lib/mustermann/regexp_based.rb#35 + def peek_match(string); end + + # @param string [String] The string to match against + # @return [Integer, nil] the number of characters that match + # + # source://mustermann//lib/mustermann/regexp_based.rb#27 + def peek_size(string); end + + # @return [Regexp] regular expression equivalent to the pattern. + # + # source://mustermann//lib/mustermann/regexp_based.rb#11 + def regexp; end + + # @return [Regexp] regular expression equivalent to the pattern. + # + # source://mustermann//lib/mustermann/regexp_based.rb#11 + def to_regexp; end + + private + + # @raise [NotImplementedError] + # + # source://mustermann//lib/mustermann/regexp_based.rb#42 + def compile(**options); end +end + +# Regexp pattern implementation. +# +# @example +# Mustermann.new('/.*', type: :regexp) === '/bar' # => true +# @see Mustermann::Pattern +# @see file:README.md#simple Syntax description in the README +# +# source://mustermann//lib/mustermann/regular.rb#14 +class Mustermann::Regular < ::Mustermann::RegexpBased + include ::Mustermann::Concat::Native + + # @param string [String] the string representation of the pattern + # @param options [Hash] options for fine-tuning the pattern behavior + # @return [Pattern] a new instance of Pattern + # @see file:README.md#Types_and_Options "Types and Options" in the README + # @see Mustermann.new + # + # source://mustermann//lib/mustermann/regular.rb#22 + def initialize(string, check_anchors: T.unsafe(nil), **options); end + + private + + # @raise [CompileError] + # + # source://mustermann//lib/mustermann/regular.rb#38 + def check_anchors(scanner); end + + # source://mustermann//lib/mustermann/regular.rb#29 + def compile(**options); end + + # @return [Boolean] + # + # source://mustermann//lib/mustermann/regular.rb#44 + def extended_regexp?(string); end +end + +# Fakes MatchData for patterns that do not support capturing. +# +# @see http://ruby-doc.org/core-2.0/MatchData.html MatchData +# +# source://mustermann//lib/mustermann/simple_match.rb#5 +class Mustermann::SimpleMatch + # @api private + # @return [SimpleMatch] a new instance of SimpleMatch + # + # source://mustermann//lib/mustermann/simple_match.rb#7 + def initialize(string = T.unsafe(nil), names: T.unsafe(nil), captures: T.unsafe(nil)); end + + # source://mustermann//lib/mustermann/simple_match.rb#38 + def +(other); end + + # @return [nil] imitates MatchData interface + # + # source://mustermann//lib/mustermann/simple_match.rb#29 + def [](*args); end + + # @return [Array] empty array for imitating MatchData interface + # + # source://mustermann//lib/mustermann/simple_match.rb#24 + def captures; end + + # @return [String] string representation + # + # source://mustermann//lib/mustermann/simple_match.rb#45 + def inspect; end + + # @return [Array] empty array for imitating MatchData interface + # + # source://mustermann//lib/mustermann/simple_match.rb#19 + def names; end + + # @return [String] the string that was matched against + # + # source://mustermann//lib/mustermann/simple_match.rb#14 + def to_s; end +end + +# Sinatra 2.0 style pattern implementation. +# +# @example +# Mustermann.new('/:foo') === '/bar' # => true +# @see Mustermann::Pattern +# @see file:README.md#sinatra Syntax description in the README +# +# source://mustermann//lib/mustermann/sinatra/parser.rb#3 +class Mustermann::Sinatra < ::Mustermann::AST::Pattern + include ::Mustermann::Concat::Native + + # Generates a string represenation of the pattern that can safely be used for def interpolation + # without changing its semantics. + # + # @example + # require 'mustermann' + # unsafe = Mustermann.new("/:name") + # + # Mustermann.new("#{unsafe}bar").params("/foobar") # => { "namebar" => "foobar" } + # Mustermann.new("#{unsafe.safe_string}bar").params("/foobar") # => { "name" => "bar" } + # @return [String] string representatin of the pattern + # + # source://mustermann//lib/mustermann/sinatra.rb#76 + def safe_string; end + + # Creates a pattern that matches any string matching either one of the patterns. + # If a string is supplied, it is treated as a fully escaped Sinatra pattern. + # + # If the other pattern is also a Sintara pattern, it might join the two to a third + # sinatra pattern instead of generating a composite for efficiency reasons. + # + # This only happens if the sinatra pattern behaves exactly the same as a composite + # would in regards to matching, parsing, expanding and template generation. + # + # @example + # pattern = Mustermann.new('/foo/:name') | Mustermann.new('/:first/:second') + # pattern === '/foo/bar' # => true + # pattern === '/fox/bar' # => true + # pattern === '/foo' # => false + # @param other [Mustermann::Pattern, String] the other pattern + # @return [Mustermann::Pattern] a composite pattern + # @see Mustermann::Pattern#| + # + # source://mustermann//lib/mustermann/sinatra.rb#59 + def |(other); end + + private + + # source://mustermann//lib/mustermann/sinatra.rb#81 + def native_concat(other); end + + class << self + # Takes a string and espaces any characters that have special meaning for Sinatra patterns. + # + # @example + # require 'mustermann/sinatra' + # Mustermann::Sinatra.escape("/:name") # => "/\\:name" + # @param string [#to_s] the input string + # @return [String] the escaped string + # + # source://mustermann//lib/mustermann/sinatra.rb#29 + def escape(string); end + + # Tries to convert the given input object to a Sinatra pattern with the given options, without + # changing its parsing semantics. + # + # @return [Mustermann::Sinatra, nil] the converted pattern, if possible + # + # source://mustermann//lib/mustermann/sinatra.rb#37 + def try_convert(input, **options); end + end +end + +# Sinatra syntax definition. +# +# source://mustermann//lib/mustermann/sinatra/parser.rb#6 +class Mustermann::Sinatra::Parser < ::Mustermann::AST::Parser; end + +# Generates a string that can safely be concatenated with other strings +# without chaning its semantics +# +# @see #safe_string +# +# source://mustermann//lib/mustermann/sinatra/safe_renderer.rb#8 +Mustermann::Sinatra::SafeRenderer = T.let(T.unsafe(nil), T.untyped) + +# Tries to translate objects to Sinatra patterns. +# +# source://mustermann//lib/mustermann/sinatra/try_convert.rb#6 +class Mustermann::Sinatra::TryConvert < ::Mustermann::AST::Translator + # @return [TryConvert] a new instance of TryConvert + # + # source://mustermann//lib/mustermann/sinatra/try_convert.rb#18 + def initialize(options); end + + # @return [Mustermann::Sinatra] + # + # source://mustermann//lib/mustermann/sinatra/try_convert.rb#24 + def new(input, escape = T.unsafe(nil)); end + + # Expected options for the resulting pattern. + # + # source://mustermann//lib/mustermann/sinatra/try_convert.rb#15 + def options; end + + # @return [true, false] whether or not expected pattern should have uri_decode option set + # + # source://mustermann//lib/mustermann/sinatra/try_convert.rb#31 + def uri_decode; end + + class << self + # @return [Mustermann::Sinatra, nil] + # + # source://mustermann//lib/mustermann/sinatra/try_convert.rb#9 + def convert(input, **options); end + end +end + +# source://mustermann//lib/mustermann/sinatra/try_convert.rb#0 +class Mustermann::Sinatra::TryConvert::NodeTranslator < ::Mustermann::AST::Translator::NodeTranslator + class << self + # source://mustermann//lib/mustermann/ast/translator.rb#62 + def translator; end + end +end diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/netrc@0.11.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/netrc@0.11.0.rbi new file mode 100644 index 0000000..4ae989b --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/netrc@0.11.0.rbi @@ -0,0 +1,159 @@ +# 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`. + + +# source://netrc//lib/netrc.rb#3 +class Netrc + # @return [Netrc] a new instance of Netrc + # + # source://netrc//lib/netrc.rb#166 + def initialize(path, data); end + + # source://netrc//lib/netrc.rb#180 + def [](k); end + + # source://netrc//lib/netrc.rb#188 + def []=(k, info); end + + # source://netrc//lib/netrc.rb#200 + def delete(key); end + + # source://netrc//lib/netrc.rb#211 + def each(&block); end + + # source://netrc//lib/netrc.rb#196 + def length; end + + # source://netrc//lib/netrc.rb#215 + def new_item(m, l, p); end + + # Returns the value of attribute new_item_prefix. + # + # source://netrc//lib/netrc.rb#178 + def new_item_prefix; end + + # Sets the attribute new_item_prefix + # + # @param value the value to set the attribute new_item_prefix to. + # + # source://netrc//lib/netrc.rb#178 + def new_item_prefix=(_arg0); end + + # source://netrc//lib/netrc.rb#219 + def save; end + + # source://netrc//lib/netrc.rb#233 + def unparse; end + + class << self + # source://netrc//lib/netrc.rb#42 + def check_permissions(path); end + + # source://netrc//lib/netrc.rb#33 + def config; end + + # @yield [self.config] + # + # source://netrc//lib/netrc.rb#37 + def configure; end + + # source://netrc//lib/netrc.rb#10 + def default_path; end + + # source://netrc//lib/netrc.rb#14 + def home_path; end + + # source://netrc//lib/netrc.rb#85 + def lex(lines); end + + # source://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. + # + # source://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. + # + # source://netrc//lib/netrc.rb#51 + def read(path = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://netrc//lib/netrc.rb#112 + def skip?(s); end + end +end + +# source://netrc//lib/netrc.rb#8 +Netrc::CYGWIN = T.let(T.unsafe(nil), T.untyped) + +# source://netrc//lib/netrc.rb#244 +class Netrc::Entry < ::Struct + # Returns the value of attribute login + # + # @return [Object] the current value of login + def login; end + + # Sets the attribute login + # + # @param value [Object] the value to set the attribute login to. + # @return [Object] the newly set value + def login=(_); end + + # Returns the value of attribute password + # + # @return [Object] the current value of password + def password; end + + # Sets the attribute password + # + # @param value [Object] the value to set the attribute password to. + # @return [Object] the newly set value + def password=(_); end + + def to_ary; end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# source://netrc//lib/netrc.rb#250 +class Netrc::Error < ::StandardError; end + +# source://netrc//lib/netrc.rb#68 +class Netrc::TokenArray < ::Array + # source://netrc//lib/netrc.rb#76 + def readto; end + + # source://netrc//lib/netrc.rb#69 + def take; end +end + +# source://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 +# +# source://netrc//lib/netrc.rb#7 +Netrc::WINDOWS = T.let(T.unsafe(nil), T.untyped) diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/parallel@1.26.3.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/parallel@1.26.3.rbi new file mode 100644 index 0000000..854c487 --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/parallel@1.26.3.rbi @@ -0,0 +1,291 @@ +# 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`. + + +# source://parallel//lib/parallel/version.rb#2 +module Parallel + class << self + # @return [Boolean] + # + # source://parallel//lib/parallel.rb#243 + def all?(*args, &block); end + + # @return [Boolean] + # + # source://parallel//lib/parallel.rb#238 + def any?(*args, &block); end + + # source://parallel//lib/parallel.rb#234 + def each(array, options = T.unsafe(nil), &block); end + + # source://parallel//lib/parallel.rb#248 + def each_with_index(array, options = T.unsafe(nil), &block); end + + # source://parallel//lib/parallel.rb#307 + def filter_map(*_arg0, **_arg1, &_arg2); end + + # source://parallel//lib/parallel.rb#303 + def flat_map(*_arg0, **_arg1, &_arg2); end + + # source://parallel//lib/parallel.rb#228 + def in_processes(options = T.unsafe(nil), &block); end + + # source://parallel//lib/parallel.rb#212 + def in_threads(options = T.unsafe(nil)); end + + # source://parallel//lib/parallel.rb#252 + def map(source, options = T.unsafe(nil), &block); end + + # source://parallel//lib/parallel.rb#299 + def map_with_index(array, options = T.unsafe(nil), &block); end + + # Number of physical processor cores on the current system. + # + # source://parallel//lib/parallel.rb#312 + 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 + # + # source://parallel//lib/parallel.rb#342 + def processor_count; end + + # source://parallel//lib/parallel.rb#346 + def worker_number; end + + # TODO: this does not work when doing threads in forks, so should remove and yield the number instead if needed + # + # source://parallel//lib/parallel.rb#351 + def worker_number=(worker_num); end + + private + + # source://parallel//lib/parallel.rb#384 + def add_progress_bar!(job_factory, options); end + + # source://parallel//lib/parallel.rb#699 + def available_processor_count; end + + # source://parallel//lib/parallel.rb#647 + def call_with_index(item, index, options, &block); end + + # source://parallel//lib/parallel.rb#579 + def create_workers(job_factory, options, &block); end + + # options is either a Integer or a Hash with :count + # + # source://parallel//lib/parallel.rb#637 + def extract_count_from_options(options); end + + # source://parallel//lib/parallel.rb#665 + 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 + # + # source://parallel//lib/parallel.rb#674 + def instrument_finish_in_order(item, index, result, options); end + + # source://parallel//lib/parallel.rb#694 + def instrument_start(item, index, options); end + + # source://parallel//lib/parallel.rb#357 + def physical_processor_count_windows; end + + # source://parallel//lib/parallel.rb#613 + def process_incoming_jobs(read, write, job_factory, options, &block); end + + # source://parallel//lib/parallel.rb#567 + def replace_worker(job_factory, workers, index, options, blk); end + + # source://parallel//lib/parallel.rb#378 + def run(command); end + + # source://parallel//lib/parallel.rb#658 + def with_instrumentation(item, index, options); end + + # source://parallel//lib/parallel.rb#409 + def work_direct(job_factory, options, &block); end + + # source://parallel//lib/parallel.rb#519 + def work_in_processes(job_factory, options, &blk); end + + # source://parallel//lib/parallel.rb#453 + def work_in_ractors(job_factory, options); end + + # source://parallel//lib/parallel.rb#428 + def work_in_threads(job_factory, options, &block); end + + # source://parallel//lib/parallel.rb#587 + def worker(job_factory, options, &block); end + end +end + +# source://parallel//lib/parallel.rb#11 +class Parallel::Break < ::StandardError + # @return [Break] a new instance of Break + # + # source://parallel//lib/parallel.rb#14 + def initialize(value = T.unsafe(nil)); end + + # Returns the value of attribute value. + # + # source://parallel//lib/parallel.rb#12 + def value; end +end + +# source://parallel//lib/parallel.rb#8 +class Parallel::DeadWorker < ::StandardError; end + +# source://parallel//lib/parallel.rb#32 +class Parallel::ExceptionWrapper + # @return [ExceptionWrapper] a new instance of ExceptionWrapper + # + # source://parallel//lib/parallel.rb#35 + def initialize(exception); end + + # Returns the value of attribute exception. + # + # source://parallel//lib/parallel.rb#33 + def exception; end +end + +# source://parallel//lib/parallel.rb#98 +class Parallel::JobFactory + # @return [JobFactory] a new instance of JobFactory + # + # source://parallel//lib/parallel.rb#99 + def initialize(source, mutex); end + + # source://parallel//lib/parallel.rb#107 + def next; end + + # generate item that is sent to workers + # just index is faster + less likely to blow up with unserializable errors + # + # source://parallel//lib/parallel.rb#136 + def pack(item, index); end + + # source://parallel//lib/parallel.rb#126 + def size; end + + # unpack item that is sent to workers + # + # source://parallel//lib/parallel.rb#141 + def unpack(data); end + + private + + # @return [Boolean] + # + # source://parallel//lib/parallel.rb#147 + def producer?; end + + # source://parallel//lib/parallel.rb#151 + def queue_wrapper(array); end +end + +# source://parallel//lib/parallel.rb#20 +class Parallel::Kill < ::Parallel::Break; end + +# source://parallel//lib/parallel.rb#6 +Parallel::Stop = T.let(T.unsafe(nil), Object) + +# source://parallel//lib/parallel.rb#23 +class Parallel::UndumpableException < ::StandardError + # @return [UndumpableException] a new instance of UndumpableException + # + # source://parallel//lib/parallel.rb#26 + def initialize(original); end + + # Returns the value of attribute backtrace. + # + # source://parallel//lib/parallel.rb#24 + def backtrace; end +end + +# source://parallel//lib/parallel.rb#156 +class Parallel::UserInterruptHandler + class << self + # source://parallel//lib/parallel.rb#181 + def kill(thing); end + + # kill all these pids or threads if user presses Ctrl+c + # + # source://parallel//lib/parallel.rb#161 + def kill_on_ctrl_c(pids, options); end + + private + + # source://parallel//lib/parallel.rb#205 + def restore_interrupt(old, signal); end + + # source://parallel//lib/parallel.rb#190 + def trap_interrupt(signal); end + end +end + +# source://parallel//lib/parallel.rb#157 +Parallel::UserInterruptHandler::INTERRUPT_SIGNAL = T.let(T.unsafe(nil), Symbol) + +# source://parallel//lib/parallel/version.rb#3 +Parallel::VERSION = T.let(T.unsafe(nil), String) + +# source://parallel//lib/parallel/version.rb#3 +Parallel::Version = T.let(T.unsafe(nil), String) + +# source://parallel//lib/parallel.rb#51 +class Parallel::Worker + # @return [Worker] a new instance of Worker + # + # source://parallel//lib/parallel.rb#55 + 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 + # + # source://parallel//lib/parallel.rb#68 + def close_pipes; end + + # Returns the value of attribute pid. + # + # source://parallel//lib/parallel.rb#52 + def pid; end + + # Returns the value of attribute read. + # + # source://parallel//lib/parallel.rb#52 + def read; end + + # source://parallel//lib/parallel.rb#61 + def stop; end + + # Returns the value of attribute thread. + # + # source://parallel//lib/parallel.rb#53 + def thread; end + + # Sets the attribute thread + # + # @param value the value to set the attribute thread to. + # + # source://parallel//lib/parallel.rb#53 + def thread=(_arg0); end + + # source://parallel//lib/parallel.rb#73 + def work(data); end + + # Returns the value of attribute write. + # + # source://parallel//lib/parallel.rb#52 + def write; end + + private + + # source://parallel//lib/parallel.rb#91 + def wait; end +end diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/polyfill@1.9.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/polyfill@1.9.0.rbi new file mode 100644 index 0000000..26ed1d0 --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/polyfill@1.9.0.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `polyfill` gem. +# Please instead update this file by running `bin/tapioca gem polyfill`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/prism@0.30.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/prism@0.30.0.rbi new file mode 100644 index 0000000..3d6fe3e --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/prism@0.30.0.rbi @@ -0,0 +1,37863 @@ +# 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/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 + +# The Prism Ruby parser. +# +# "Parsing Ruby is suddenly manageable!" +# - You, hopefully +# +# source://prism//lib/prism.rb#8 +module Prism + class << self + # Mirror the Prism.dump API by using the serialization API. + def dump(*_arg0); end + + # Mirror the Prism.dump_file API by using the serialization API. + def dump_file(*_arg0); end + + # Mirror the Prism.lex API by using the serialization API. + 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. The main difference is that the + # `:on_sp` token is not emitted. + # + # For supported options, see Prism::parse. + # + # source://prism//lib/prism.rb#45 + 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. + def lex_file(*_arg0); end + + # :call-seq: + # Prism::lex_ripper(source) -> Array + # + # This lexes with the Ripper lex. It drops any space events but otherwise + # returns the same tokens. Raises SyntaxError if the syntax in source is + # invalid. + # + # source://prism//lib/prism.rb#55 + sig { params(source: String).returns(T::Array[T.untyped]) } + def lex_ripper(source); end + + # :call-seq: + # Prism::load(source, serialized) -> ParseResult + # + # Load the serialized AST using the source as a reference into a tree. + # + # source://prism//lib/prism.rb#63 + sig { params(source: String, serialized: String).returns(Prism::ParseResult) } + def load(source, serialized); end + + # Mirror the Prism.parse API by using the serialization API. + def parse(*_arg0); end + + # Mirror the Prism.parse_comments API by using the serialization API. + def parse_comments(*_arg0); end + + # Mirror the Prism.parse_failure? API by using the serialization API. + # + # @return [Boolean] + 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. + 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. + def parse_file_comments(*_arg0); end + + # Mirror the Prism.parse_file_failure? API by using the serialization API. + # + # @return [Boolean] + def parse_file_failure?(*_arg0); end + + # Mirror the Prism.parse_file_success? API by using the serialization API. + # + # @return [Boolean] + def parse_file_success?(*_arg0); end + + # Mirror the Prism.parse_lex API by using the serialization API. + def parse_lex(*_arg0); end + + # Mirror the Prism.parse_lex_file API by using the serialization API. + def parse_lex_file(*_arg0); end + + # Mirror the Prism.parse_stream API by using the serialization API. + def parse_stream(*_arg0); end + + # Mirror the Prism.parse_success? API by using the serialization API. + # + # @return [Boolean] + def parse_success?(*_arg0); end + + # Mirror the Prism.profile API by using the serialization API. + def profile(*_arg0); end + + # Mirror the Prism.profile_file API by using the serialization API. + def profile_file(*_arg0); 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. Sources that +# include multibyte characters are represented by the Prism::Source class. +# +# source://prism//lib/prism/parse_result.rb#126 +class Prism::ASCIISource < ::Prism::Source + # Return the column number in characters for the given byte offset. + # + # source://prism//lib/prism/parse_result.rb#133 + sig { params(byte_offset: Integer).returns(Integer) } + def character_column(byte_offset); end + + # Return the character offset for the given byte offset. + # + # source://prism//lib/prism/parse_result.rb#128 + sig { params(byte_offset: Integer).returns(Integer) } + def character_offset(byte_offset); end + + # Specialized version of `code_units_column` that does not depend on + # `code_units_offset`, which is a more expensive operation. This is + # essentialy the same as `Prism::Source#column`. + # + # source://prism//lib/prism/parse_result.rb#150 + 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. + # + # source://prism//lib/prism/parse_result.rb#143 + 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 +# ^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#176 +class Prism::AliasGlobalVariableNode < ::Prism::Node + # def initialize: (Prism::node new_name, Prism::node old_name, Location keyword_loc, Location location) -> void + # + # @return [AliasGlobalVariableNode] a new instance of AliasGlobalVariableNode + # + # source://prism//lib/prism/node.rb#178 + sig do + params( + source: Prism::Source, + new_name: Prism::Node, + old_name: Prism::Node, + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, new_name, old_name, keyword_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#281 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#187 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#192 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#202 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#197 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?new_name: Prism::node, ?old_name: Prism::node, ?keyword_loc: Location, ?location: Location) -> AliasGlobalVariableNode + # + # source://prism//lib/prism/node.rb#207 + sig do + params( + new_name: Prism::Node, + old_name: Prism::Node, + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::AliasGlobalVariableNode) + end + def copy(new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#192 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { new_name: Prism::node, old_name: Prism::node, keyword_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#215 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#247 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#242 + sig { returns(String) } + def keyword; end + + # The location of the `alias` keyword. + # + # alias $foo $bar + # ^^^^^ + # + # source://prism//lib/prism/node.rb#235 + sig { returns(Prism::Location) } + def keyword_loc; end + + # Represents the new name of the global variable that can be used after aliasing. This can be either a global variable, a back reference, or a numbered reference. + # + # alias $foo $bar + # ^^^^ + # + # source://prism//lib/prism/node.rb#223 + sig { returns(Prism::Node) } + def new_name; end + + # Represents the old name of the global variable that could be used before aliasing. This can be either a global variable, a back reference, or a numbered reference. + # + # alias $foo $bar + # ^^^^ + # + # source://prism//lib/prism/node.rb#229 + sig { returns(Prism::Node) } + def old_name; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#265 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#275 + def type; end + end +end + +# Represents the use of the `alias` keyword to alias a method. +# +# alias foo bar +# ^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#293 +class Prism::AliasMethodNode < ::Prism::Node + # def initialize: (Prism::node new_name, Prism::node old_name, Location keyword_loc, Location location) -> void + # + # @return [AliasMethodNode] a new instance of AliasMethodNode + # + # source://prism//lib/prism/node.rb#295 + sig do + params( + source: Prism::Source, + new_name: Prism::Node, + old_name: Prism::Node, + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, new_name, old_name, keyword_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#389 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#304 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#309 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#319 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#314 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?new_name: Prism::node, ?old_name: Prism::node, ?keyword_loc: Location, ?location: Location) -> AliasMethodNode + # + # source://prism//lib/prism/node.rb#324 + sig do + params( + new_name: Prism::Node, + old_name: Prism::Node, + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::AliasMethodNode) + end + def copy(new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#309 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { new_name: Prism::node, old_name: Prism::node, keyword_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#332 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#355 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#350 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#343 + sig { returns(Prism::Location) } + def keyword_loc; end + + # attr_reader new_name: Prism::node + # + # source://prism//lib/prism/node.rb#337 + sig { returns(Prism::Node) } + def new_name; end + + # attr_reader old_name: Prism::node + # + # source://prism//lib/prism/node.rb#340 + sig { returns(Prism::Node) } + def old_name; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#373 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#383 + def type; end + end +end + +# Represents an alternation pattern in pattern matching. +# +# foo => bar | baz +# ^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#401 +class Prism::AlternationPatternNode < ::Prism::Node + # def initialize: (Prism::node left, Prism::node right, Location operator_loc, Location location) -> void + # + # @return [AlternationPatternNode] a new instance of AlternationPatternNode + # + # source://prism//lib/prism/node.rb#403 + sig do + params( + source: Prism::Source, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, left, right, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#497 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#412 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#417 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#427 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#422 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?left: Prism::node, ?right: Prism::node, ?operator_loc: Location, ?location: Location) -> AlternationPatternNode + # + # source://prism//lib/prism/node.rb#432 + sig do + params( + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::AlternationPatternNode) + end + def copy(left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#417 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { left: Prism::node, right: Prism::node, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#440 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#463 + sig { override.returns(String) } + def inspect; end + + # attr_reader left: Prism::node + # + # source://prism//lib/prism/node.rb#445 + sig { returns(Prism::Node) } + def left; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#458 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#451 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader right: Prism::node + # + # source://prism//lib/prism/node.rb#448 + sig { returns(Prism::Node) } + def right; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#481 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#491 + def type; end + end +end + +# Represents the use of the `&&` operator or the `and` keyword. +# +# left and right +# ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#509 +class Prism::AndNode < ::Prism::Node + # def initialize: (Prism::node left, Prism::node right, Location operator_loc, Location location) -> void + # + # @return [AndNode] a new instance of AndNode + # + # source://prism//lib/prism/node.rb#511 + sig do + params( + source: Prism::Source, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, left, right, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#620 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#520 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#525 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#535 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#530 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?left: Prism::node, ?right: Prism::node, ?operator_loc: Location, ?location: Location) -> AndNode + # + # source://prism//lib/prism/node.rb#540 + sig do + params( + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::AndNode) + end + def copy(left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#525 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { left: Prism::node, right: Prism::node, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#548 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#586 + 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 + # ^ + # + # source://prism//lib/prism/node.rb#559 + sig { returns(Prism::Node) } + def left; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#581 + sig { returns(String) } + def operator; end + + # The location of the `and` keyword or the `&&` operator. + # + # left and right + # ^^^ + # + # source://prism//lib/prism/node.rb#574 + sig { returns(Prism::Location) } + def operator_loc; end + + # Represents the right 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 && right + # ^^^^^ + # + # 1 and 2 + # ^ + # + # source://prism//lib/prism/node.rb#568 + sig { returns(Prism::Node) } + def right; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#604 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#614 + def type; end + end +end + +# Represents a set of arguments to a method or a keyword. +# +# return foo, bar, baz +# ^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#632 +class Prism::ArgumentsNode < ::Prism::Node + # def initialize: (Integer flags, Array[Prism::node] arguments, Location location) -> void + # + # @return [ArgumentsNode] a new instance of ArgumentsNode + # + # source://prism//lib/prism/node.rb#634 + sig do + params( + source: Prism::Source, + flags: Integer, + arguments: T::Array[Prism::Node], + location: Prism::Location + ).void + end + def initialize(source, flags, arguments, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#726 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#642 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: Array[Prism::node] + # + # source://prism//lib/prism/node.rb#679 + sig { returns(T::Array[Prism::Node]) } + def arguments; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#647 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#657 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#652 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def contains_keyword_splat?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#687 + sig { returns(T::Boolean) } + def contains_keyword_splat?; end + + # def contains_keywords?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#682 + sig { returns(T::Boolean) } + def contains_keywords?; end + + # def copy: (?flags: Integer, ?arguments: Array[Prism::node], ?location: Location) -> ArgumentsNode + # + # source://prism//lib/prism/node.rb#662 + sig do + params( + flags: Integer, + arguments: T::Array[Prism::Node], + location: Prism::Location + ).returns(Prism::ArgumentsNode) + end + def copy(flags: T.unsafe(nil), arguments: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#647 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, arguments: Array[Prism::node], location: Location } + # + # source://prism//lib/prism/node.rb#670 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#692 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#710 + sig { override.returns(Symbol) } + def type; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#675 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#720 + def type; end + end +end + +# Flags for arguments nodes. +# +# source://prism//lib/prism/node.rb#19127 +module Prism::ArgumentsNodeFlags; end + +# if arguments contain keywords +# +# source://prism//lib/prism/node.rb#19129 +Prism::ArgumentsNodeFlags::CONTAINS_KEYWORDS = T.let(T.unsafe(nil), Integer) + +# if arguments contain keyword splat +# +# source://prism//lib/prism/node.rb#19132 +Prism::ArgumentsNodeFlags::CONTAINS_KEYWORD_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] +# ^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#738 +class Prism::ArrayNode < ::Prism::Node + # def initialize: (Integer flags, Array[Prism::node] elements, Location? opening_loc, Location? closing_loc, Location location) -> void + # + # @return [ArrayNode] a new instance of ArrayNode + # + # source://prism//lib/prism/node.rb#740 + sig do + params( + source: Prism::Source, + flags: Integer, + elements: T::Array[Prism::Node], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end + def initialize(source, flags, elements, opening_loc, closing_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#875 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#750 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#755 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # source://prism//lib/prism/node.rb#836 + 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 + # + # source://prism//lib/prism/node.rb#813 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#765 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#760 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def contains_splat?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#826 + sig { returns(T::Boolean) } + def contains_splat?; end + + # def copy: (?flags: Integer, ?elements: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> ArrayNode + # + # source://prism//lib/prism/node.rb#770 + sig do + params( + flags: Integer, + elements: T::Array[Prism::Node], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::ArrayNode) + end + def copy(flags: T.unsafe(nil), elements: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#755 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, elements: Array[Prism::node], opening_loc: Location?, closing_loc: Location?, location: Location } + # + # source://prism//lib/prism/node.rb#778 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); 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. + # + # source://prism//lib/prism/node.rb#787 + sig { returns(T::Array[Prism::Node]) } + def elements; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#841 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String? + # + # source://prism//lib/prism/node.rb#831 + 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 + # + # source://prism//lib/prism/node.rb#795 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#859 + sig { override.returns(Symbol) } + def type; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#783 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#869 + def type; end + end +end + +# Flags for array nodes. +# +# source://prism//lib/prism/node.rb#19136 +module Prism::ArrayNodeFlags; end + +# if array contains splat nodes +# +# source://prism//lib/prism/node.rb#19138 +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 *1 +# ^^^^^^^^^ +# +# foo in Bar[] +# ^^^^^^^^^^^^ +# +# foo in Bar[1, 2, 3] +# ^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#901 +class Prism::ArrayPatternNode < ::Prism::Node + # def initialize: (Prism::node? constant, Array[Prism::node] requireds, Prism::node? rest, Array[Prism::node] posts, Location? opening_loc, Location? closing_loc, Location location) -> void + # + # @return [ArrayPatternNode] a new instance of ArrayPatternNode + # + # source://prism//lib/prism/node.rb#903 + sig do + params( + source: Prism::Source, + constant: T.nilable(Prism::Node), + 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), + location: Prism::Location + ).void + end + def initialize(source, constant, requireds, rest, posts, opening_loc, closing_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#1035 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#915 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#920 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # source://prism//lib/prism/node.rb#996 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism//lib/prism/node.rb#978 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#935 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#925 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # attr_reader constant: Prism::node? + # + # source://prism//lib/prism/node.rb#953 + sig { returns(T.nilable(Prism::Node)) } + def constant; end + + # def copy: (?constant: Prism::node?, ?requireds: Array[Prism::node], ?rest: Prism::node?, ?posts: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> ArrayPatternNode + # + # source://prism//lib/prism/node.rb#940 + sig do + params( + constant: T.nilable(Prism::Node), + 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), + location: Prism::Location + ).returns(Prism::ArrayPatternNode) + end + def copy(constant: T.unsafe(nil), requireds: T.unsafe(nil), rest: T.unsafe(nil), posts: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#920 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { constant: Prism::node?, requireds: Array[Prism::node], rest: Prism::node?, posts: Array[Prism::node], opening_loc: Location?, closing_loc: Location?, location: Location } + # + # source://prism//lib/prism/node.rb#948 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#1001 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String? + # + # source://prism//lib/prism/node.rb#991 + sig { returns(T.nilable(String)) } + def opening; end + + # attr_reader opening_loc: Location? + # + # source://prism//lib/prism/node.rb#965 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # attr_reader posts: Array[Prism::node] + # + # source://prism//lib/prism/node.rb#962 + sig { returns(T::Array[Prism::Node]) } + def posts; end + + # attr_reader requireds: Array[Prism::node] + # + # source://prism//lib/prism/node.rb#956 + sig { returns(T::Array[Prism::Node]) } + def requireds; end + + # attr_reader rest: Prism::node? + # + # source://prism//lib/prism/node.rb#959 + sig { returns(T.nilable(Prism::Node)) } + def rest; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1019 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1029 + def type; end + end +end + +# Represents a hash key/value pair. +# +# { a => b } +# ^^^^^^ +# +# source://prism//lib/prism/node.rb#1052 +class Prism::AssocNode < ::Prism::Node + # def initialize: (Prism::node key, Prism::node value, Location? operator_loc, Location location) -> void + # + # @return [AssocNode] a new instance of AssocNode + # + # source://prism//lib/prism/node.rb#1054 + sig do + params( + source: Prism::Source, + key: Prism::Node, + value: Prism::Node, + operator_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end + def initialize(source, key, value, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#1172 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#1063 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#1068 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#1078 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#1073 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?key: Prism::node, ?value: Prism::node, ?operator_loc: Location?, ?location: Location) -> AssocNode + # + # source://prism//lib/prism/node.rb#1083 + sig do + params( + key: Prism::Node, + value: Prism::Node, + operator_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::AssocNode) + end + def copy(key: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#1068 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { key: Prism::node, value: Prism::node, operator_loc: Location?, location: Location } + # + # source://prism//lib/prism/node.rb#1091 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#1138 + 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 } + # ^^^^^^^^^^ + # + # source://prism//lib/prism/node.rb#1105 + sig { returns(Prism::Node) } + def key; end + + # def operator: () -> String? + # + # source://prism//lib/prism/node.rb#1133 + sig { returns(T.nilable(String)) } + def operator; end + + # The location of the `=>` operator, if present. + # + # { foo => bar } + # ^^ + # + # source://prism//lib/prism/node.rb#1120 + sig { returns(T.nilable(Prism::Location)) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1156 + 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 } + # ^ + # + # source://prism//lib/prism/node.rb#1114 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1166 + def type; end + end +end + +# Represents a splat in a hash literal. +# +# { **foo } +# ^^^^^ +# +# source://prism//lib/prism/node.rb#1184 +class Prism::AssocSplatNode < ::Prism::Node + # def initialize: (Prism::node? value, Location operator_loc, Location location) -> void + # + # @return [AssocSplatNode] a new instance of AssocSplatNode + # + # source://prism//lib/prism/node.rb#1186 + sig do + params( + source: Prism::Source, + value: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, value, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#1284 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#1194 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#1199 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#1211 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#1204 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?value: Prism::node?, ?operator_loc: Location, ?location: Location) -> AssocSplatNode + # + # source://prism//lib/prism/node.rb#1216 + sig do + params( + value: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::AssocSplatNode) + end + def copy(value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#1199 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node?, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#1224 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#1250 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#1245 + sig { returns(String) } + def operator; end + + # The location of the `**` operator. + # + # { **x } + # ^^ + # + # source://prism//lib/prism/node.rb#1238 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1268 + 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 } + # ^^^ + # + # source://prism//lib/prism/node.rb#1232 + sig { returns(T.nilable(Prism::Node)) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1278 + def type; end + end +end + +# The FFI backend is used on other Ruby implementations. +# +# source://prism//lib/prism.rb#81 +Prism::BACKEND = T.let(T.unsafe(nil), Symbol) + +# Represents reading a reference to a field in the previous match. +# +# $' +# ^^ +# +# source://prism//lib/prism/node.rb#1295 +class Prism::BackReferenceReadNode < ::Prism::Node + # def initialize: (Symbol name, Location location) -> void + # + # @return [BackReferenceReadNode] a new instance of BackReferenceReadNode + # + # source://prism//lib/prism/node.rb#1297 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } + def initialize(source, name, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#1378 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#1304 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#1309 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#1319 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#1314 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?location: Location) -> BackReferenceReadNode + # + # source://prism//lib/prism/node.rb#1324 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::BackReferenceReadNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#1309 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#1332 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#1344 + sig { override.returns(String) } + def inspect; end + + # The name of the back-reference variable, including the leading `$`. + # + # $& # name `:$&` + # + # $+ # name `:$+` + # + # source://prism//lib/prism/node.rb#1341 + sig { returns(Symbol) } + def name; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1362 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1372 + 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. +# +# source://prism//lib/prism/visitor.rb#14 +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. + # + # source://prism//lib/prism/visitor.rb#17 + sig { params(node: T.nilable(Prism::Node)).void } + def visit(node); end + + # Visits each node in `nodes` by calling `accept` on each one. + # + # source://prism//lib/prism/visitor.rb#23 + 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. + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::Node).void } + def visit_child_nodes(node); end +end + +# Represents a begin statement. +# +# begin +# foo +# end +# ^^^^^ +# +# source://prism//lib/prism/node.rb#1390 +class Prism::BeginNode < ::Prism::Node + # def initialize: (Location? begin_keyword_loc, StatementsNode? statements, RescueNode? rescue_clause, ElseNode? else_clause, EnsureNode? ensure_clause, Location? end_keyword_loc, Location location) -> void + # + # @return [BeginNode] a new instance of BeginNode + # + # source://prism//lib/prism/node.rb#1392 + sig do + params( + source: Prism::Source, + 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), + location: Prism::Location + ).void + end + def initialize(source, begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#1524 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#1404 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def begin_keyword: () -> String? + # + # source://prism//lib/prism/node.rb#1480 + sig { returns(T.nilable(String)) } + def begin_keyword; end + + # attr_reader begin_keyword_loc: Location? + # + # source://prism//lib/prism/node.rb#1442 + sig { returns(T.nilable(Prism::Location)) } + def begin_keyword_loc; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#1409 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#1424 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#1414 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?begin_keyword_loc: Location?, ?statements: StatementsNode?, ?rescue_clause: RescueNode?, ?else_clause: ElseNode?, ?ensure_clause: EnsureNode?, ?end_keyword_loc: Location?, ?location: Location) -> BeginNode + # + # source://prism//lib/prism/node.rb#1429 + sig do + params( + 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), + location: Prism::Location + ).returns(Prism::BeginNode) + end + def copy(begin_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), rescue_clause: T.unsafe(nil), else_clause: T.unsafe(nil), ensure_clause: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#1409 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { begin_keyword_loc: Location?, statements: StatementsNode?, rescue_clause: RescueNode?, else_clause: ElseNode?, ensure_clause: EnsureNode?, end_keyword_loc: Location?, location: Location } + # + # source://prism//lib/prism/node.rb#1437 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # attr_reader else_clause: ElseNode? + # + # source://prism//lib/prism/node.rb#1461 + sig { returns(T.nilable(Prism::ElseNode)) } + def else_clause; end + + # def end_keyword: () -> String? + # + # source://prism//lib/prism/node.rb#1485 + sig { returns(T.nilable(String)) } + def end_keyword; end + + # attr_reader end_keyword_loc: Location? + # + # source://prism//lib/prism/node.rb#1467 + sig { returns(T.nilable(Prism::Location)) } + def end_keyword_loc; end + + # attr_reader ensure_clause: EnsureNode? + # + # source://prism//lib/prism/node.rb#1464 + sig { returns(T.nilable(Prism::EnsureNode)) } + def ensure_clause; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#1490 + sig { override.returns(String) } + def inspect; end + + # source://prism//lib/prism/parse_result/newlines.rb#79 + def newline!(lines); end + + # attr_reader rescue_clause: RescueNode? + # + # source://prism//lib/prism/node.rb#1458 + sig { returns(T.nilable(Prism::RescueNode)) } + def rescue_clause; end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#1455 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1508 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1518 + def type; end + end +end + +# Represents block method arguments. +# +# bar(&args) +# ^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#1539 +class Prism::BlockArgumentNode < ::Prism::Node + # def initialize: (Prism::node? expression, Location operator_loc, Location location) -> void + # + # @return [BlockArgumentNode] a new instance of BlockArgumentNode + # + # source://prism//lib/prism/node.rb#1541 + sig do + params( + source: Prism::Source, + expression: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, expression, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#1633 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#1549 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#1554 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#1566 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#1559 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?expression: Prism::node?, ?operator_loc: Location, ?location: Location) -> BlockArgumentNode + # + # source://prism//lib/prism/node.rb#1571 + sig do + params( + expression: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::BlockArgumentNode) + end + def copy(expression: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#1554 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Prism::node?, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#1579 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # attr_reader expression: Prism::node? + # + # source://prism//lib/prism/node.rb#1584 + sig { returns(T.nilable(Prism::Node)) } + def expression; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#1599 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#1594 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#1587 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1617 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1627 + def type; end + end +end + +# Represents a block local variable. +# +# a { |; b| } +# ^ +# +# source://prism//lib/prism/node.rb#1644 +class Prism::BlockLocalVariableNode < ::Prism::Node + # def initialize: (Integer flags, Symbol name, Location location) -> void + # + # @return [BlockLocalVariableNode] a new instance of BlockLocalVariableNode + # + # source://prism//lib/prism/node.rb#1646 + sig { params(source: Prism::Source, flags: Integer, name: Symbol, location: Prism::Location).void } + def initialize(source, flags, name, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#1733 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#1654 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#1659 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#1669 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#1664 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?name: Symbol, ?location: Location) -> BlockLocalVariableNode + # + # source://prism//lib/prism/node.rb#1674 + sig { params(flags: Integer, name: Symbol, location: Prism::Location).returns(Prism::BlockLocalVariableNode) } + def copy(flags: T.unsafe(nil), name: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#1659 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#1682 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#1699 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#1691 + sig { returns(Symbol) } + def name; end + + # def repeated_parameter?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#1694 + sig { returns(T::Boolean) } + def repeated_parameter?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1717 + sig { override.returns(Symbol) } + def type; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#1687 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1727 + def type; end + end +end + +# Represents a block of ruby code. +# +# [1, 2, 3].each { |i| puts x } +# ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#1744 +class Prism::BlockNode < ::Prism::Node + # def initialize: (Array[Symbol] locals, Prism::node? parameters, Prism::node? body, Location opening_loc, Location closing_loc, Location location) -> void + # + # @return [BlockNode] a new instance of BlockNode + # + # source://prism//lib/prism/node.rb#1746 + sig do + params( + source: Prism::Source, + locals: T::Array[Symbol], + parameters: T.nilable(Prism::Node), + body: T.nilable(Prism::Node), + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, locals, parameters, body, opening_loc, closing_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#1860 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#1757 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader body: Prism::node? + # + # source://prism//lib/prism/node.rb#1799 + sig { returns(T.nilable(Prism::Node)) } + def body; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#1762 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#1821 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#1809 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#1775 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#1767 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?locals: Array[Symbol], ?parameters: Prism::node?, ?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> BlockNode + # + # source://prism//lib/prism/node.rb#1780 + sig do + params( + locals: T::Array[Symbol], + parameters: T.nilable(Prism::Node), + body: T.nilable(Prism::Node), + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::BlockNode) + end + def copy(locals: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#1762 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], parameters: Prism::node?, body: Prism::node?, opening_loc: Location, closing_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#1788 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#1826 + sig { override.returns(String) } + def inspect; end + + # attr_reader locals: Array[Symbol] + # + # source://prism//lib/prism/node.rb#1793 + sig { returns(T::Array[Symbol]) } + def locals; end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#1816 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#1802 + sig { returns(Prism::Location) } + def opening_loc; end + + # attr_reader parameters: Prism::node? + # + # source://prism//lib/prism/node.rb#1796 + sig { returns(T.nilable(Prism::Node)) } + def parameters; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1844 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1854 + def type; end + end +end + +# Represents a block parameter to a method, block, or lambda definition. +# +# def a(&b) +# ^^ +# end +# +# source://prism//lib/prism/node.rb#1876 +class Prism::BlockParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void + # + # @return [BlockParameterNode] a new instance of BlockParameterNode + # + # source://prism//lib/prism/node.rb#1878 + sig do + params( + source: Prism::Source, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, flags, name, name_loc, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#1992 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#1888 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#1893 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#1903 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#1898 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location, ?location: Location) -> BlockParameterNode + # + # source://prism//lib/prism/node.rb#1908 + sig do + params( + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::BlockParameterNode) + end + def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#1893 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#1916 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#1958 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol? + # + # source://prism//lib/prism/node.rb#1925 + sig { returns(T.nilable(Symbol)) } + def name; end + + # attr_reader name_loc: Location? + # + # source://prism//lib/prism/node.rb#1928 + sig { returns(T.nilable(Prism::Location)) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#1953 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#1941 + sig { returns(Prism::Location) } + def operator_loc; end + + # def repeated_parameter?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#1948 + sig { returns(T::Boolean) } + def repeated_parameter?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1976 + sig { override.returns(Symbol) } + def type; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#1921 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#1986 + def type; end + end +end + +# Represents a block's parameters declaration. +# +# -> (a, b = 1; local) { } +# ^^^^^^^^^^^^^^^^^ +# +# foo do |a, b = 1; local| +# ^^^^^^^^^^^^^^^^^ +# end +# +# source://prism//lib/prism/node.rb#2009 +class Prism::BlockParametersNode < ::Prism::Node + # def initialize: (ParametersNode? parameters, Array[BlockLocalVariableNode] locals, Location? opening_loc, Location? closing_loc, Location location) -> void + # + # @return [BlockParametersNode] a new instance of BlockParametersNode + # + # source://prism//lib/prism/node.rb#2011 + sig do + params( + source: Prism::Source, + parameters: T.nilable(Prism::ParametersNode), + locals: T::Array[Prism::BlockLocalVariableNode], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end + def initialize(source, parameters, locals, opening_loc, closing_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#2133 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#2021 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#2026 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # source://prism//lib/prism/node.rb#2094 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism//lib/prism/node.rb#2076 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#2039 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#2031 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?parameters: ParametersNode?, ?locals: Array[BlockLocalVariableNode], ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> BlockParametersNode + # + # source://prism//lib/prism/node.rb#2044 + sig do + params( + parameters: T.nilable(Prism::ParametersNode), + locals: T::Array[Prism::BlockLocalVariableNode], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::BlockParametersNode) + end + def copy(parameters: T.unsafe(nil), locals: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#2026 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { parameters: ParametersNode?, locals: Array[BlockLocalVariableNode], opening_loc: Location?, closing_loc: Location?, location: Location } + # + # source://prism//lib/prism/node.rb#2052 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#2099 + sig { override.returns(String) } + def inspect; end + + # attr_reader locals: Array[BlockLocalVariableNode] + # + # source://prism//lib/prism/node.rb#2060 + sig { returns(T::Array[Prism::BlockLocalVariableNode]) } + def locals; end + + # def opening: () -> String? + # + # source://prism//lib/prism/node.rb#2089 + sig { returns(T.nilable(String)) } + def opening; end + + # attr_reader opening_loc: Location? + # + # source://prism//lib/prism/node.rb#2063 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # attr_reader parameters: ParametersNode? + # + # source://prism//lib/prism/node.rb#2057 + sig { returns(T.nilable(Prism::ParametersNode)) } + def parameters; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#2117 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#2127 + def type; end + end +end + +# Represents the use of the `break` keyword. +# +# break foo +# ^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#2147 +class Prism::BreakNode < ::Prism::Node + # def initialize: (ArgumentsNode? arguments, Location keyword_loc, Location location) -> void + # + # @return [BreakNode] a new instance of BreakNode + # + # source://prism//lib/prism/node.rb#2149 + sig do + params( + source: Prism::Source, + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, arguments, keyword_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#2247 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#2157 + 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 + # ^^^ + # + # source://prism//lib/prism/node.rb#2195 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#2162 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#2174 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#2167 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?arguments: ArgumentsNode?, ?keyword_loc: Location, ?location: Location) -> BreakNode + # + # source://prism//lib/prism/node.rb#2179 + sig do + params( + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::BreakNode) + end + def copy(arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#2162 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { arguments: ArgumentsNode?, keyword_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#2187 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#2213 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#2208 + sig { returns(String) } + def keyword; end + + # The location of the `break` keyword. + # + # break foo + # ^^^^^ + # + # source://prism//lib/prism/node.rb#2201 + sig { returns(Prism::Location) } + def keyword_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#2231 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#2241 + def type; end + end +end + +# Represents the use of the `&&=` operator on a call. +# +# foo.bar &&= value +# ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#2258 +class Prism::CallAndWriteNode < ::Prism::Node + # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Location operator_loc, Prism::node value, Location location) -> void + # + # @return [CallAndWriteNode] a new instance of CallAndWriteNode + # + # source://prism//lib/prism/node.rb#2260 + sig do + params( + source: Prism::Source, + 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, + location: Prism::Location + ).void + end + def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#2428 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#2274 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def attribute_write?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2369 + sig { returns(T::Boolean) } + def attribute_write?; end + + # def call_operator: () -> String? + # + # source://prism//lib/prism/node.rb#2379 + sig { returns(T.nilable(String)) } + def call_operator; end + + # attr_reader call_operator_loc: Location? + # + # source://prism//lib/prism/node.rb#2317 + sig { returns(T.nilable(Prism::Location)) } + def call_operator_loc; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#2279 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://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] + # + # source://prism//lib/prism/node.rb#2284 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> CallAndWriteNode + # + # source://prism//lib/prism/node.rb#2297 + sig do + params( + 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, + location: Prism::Location + ).returns(Prism::CallAndWriteNode) + end + def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#2279 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Prism::node, location: Location } + # + # source://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 + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def ignore_visibility?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2374 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#2394 + sig { override.returns(String) } + def inspect; end + + # def message: () -> String? + # + # source://prism//lib/prism/node.rb#2384 + sig { returns(T.nilable(String)) } + def message; end + + # attr_reader message_loc: Location? + # + # source://prism//lib/prism/node.rb#2330 + sig { returns(T.nilable(Prism::Location)) } + def message_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#2389 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#2349 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader read_name: Symbol + # + # source://prism//lib/prism/node.rb#2343 + sig { returns(Symbol) } + def read_name; end + + # attr_reader receiver: Prism::node? + # + # source://prism//lib/prism/node.rb#2314 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2359 + sig { returns(T::Boolean) } + def safe_navigation?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#2412 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#2356 + sig { returns(Prism::Node) } + def value; end + + # def variable_call?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2364 + sig { returns(T::Boolean) } + def variable_call?; end + + # attr_reader write_name: Symbol + # + # source://prism//lib/prism/node.rb#2346 + sig { returns(Symbol) } + def write_name; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#2310 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#2422 + 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 +# ^^^^^^^^ +# +# source://prism//lib/prism/node.rb#2460 +class Prism::CallNode < ::Prism::Node + # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Symbol name, Location? message_loc, Location? opening_loc, ArgumentsNode? arguments, Location? closing_loc, Prism::node? block, Location location) -> void + # + # @return [CallNode] a new instance of CallNode + # + # source://prism//lib/prism/node.rb#2462 + sig do + params( + source: Prism::Source, + 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), + block: T.nilable(Prism::Node), + location: Prism::Location + ).void + end + def initialize(source, flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#2665 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#2477 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # source://prism//lib/prism/node.rb#2572 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def attribute_write?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2601 + sig { returns(T::Boolean) } + def attribute_write?; end + + # attr_reader block: Prism::node? + # + # source://prism//lib/prism/node.rb#2588 + sig { returns(T.nilable(Prism::Node)) } + def block; end + + # def call_operator: () -> String? + # + # source://prism//lib/prism/node.rb#2611 + sig { returns(T.nilable(String)) } + def call_operator; end + + # attr_reader call_operator_loc: Location? + # + # source://prism//lib/prism/node.rb#2530 + sig { returns(T.nilable(Prism::Location)) } + def call_operator_loc; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#2482 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # source://prism//lib/prism/node.rb#2626 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism//lib/prism/node.rb#2575 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#2496 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#2487 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?name: Symbol, ?message_loc: Location?, ?opening_loc: Location?, ?arguments: ArgumentsNode?, ?closing_loc: Location?, ?block: Prism::node?, ?location: Location) -> CallNode + # + # source://prism//lib/prism/node.rb#2501 + sig do + params( + 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), + block: T.nilable(Prism::Node), + location: Prism::Location + ).returns(Prism::CallNode) + end + def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), name: T.unsafe(nil), message_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#2482 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, name: Symbol, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, block: Prism::node?, location: Location } + # + # source://prism//lib/prism/node.rb#2509 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); 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. + # + # source://prism//lib/prism/node_ext.rb#315 + sig { returns(T.nilable(Prism::Location)) } + def full_message_loc; end + + # def ignore_visibility?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2606 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#2631 + sig { override.returns(String) } + def inspect; end + + # def message: () -> String? + # + # source://prism//lib/prism/node.rb#2616 + sig { returns(T.nilable(String)) } + def message; end + + # attr_reader message_loc: Location? + # + # source://prism//lib/prism/node.rb#2546 + sig { returns(T.nilable(Prism::Location)) } + def message_loc; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#2543 + sig { returns(Symbol) } + def name; end + + # def opening: () -> String? + # + # source://prism//lib/prism/node.rb#2621 + sig { returns(T.nilable(String)) } + def opening; end + + # attr_reader opening_loc: Location? + # + # source://prism//lib/prism/node.rb#2559 + 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 + # ^^^ + # + # source://prism//lib/prism/node.rb#2527 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2591 + sig { returns(T::Boolean) } + def safe_navigation?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#2649 + sig { override.returns(Symbol) } + def type; end + + # def variable_call?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2596 + sig { returns(T::Boolean) } + def variable_call?; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#2514 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#2659 + def type; end + end +end + +# Flags for call nodes. +# +# source://prism//lib/prism/node.rb#19142 +module Prism::CallNodeFlags; end + +# a call that is an attribute write, so the value being written should be returned +# +# source://prism//lib/prism/node.rb#19150 +Prism::CallNodeFlags::ATTRIBUTE_WRITE = T.let(T.unsafe(nil), Integer) + +# a call that ignores method visibility +# +# source://prism//lib/prism/node.rb#19153 +Prism::CallNodeFlags::IGNORE_VISIBILITY = T.let(T.unsafe(nil), Integer) + +# &. operator +# +# source://prism//lib/prism/node.rb#19144 +Prism::CallNodeFlags::SAFE_NAVIGATION = T.let(T.unsafe(nil), Integer) + +# a call that could have been a local variable +# +# source://prism//lib/prism/node.rb#19147 +Prism::CallNodeFlags::VARIABLE_CALL = T.let(T.unsafe(nil), Integer) + +# Represents the use of an assignment operator on a call. +# +# foo.bar += baz +# ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#2683 +class Prism::CallOperatorWriteNode < ::Prism::Node + # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Symbol binary_operator, Location binary_operator_loc, Prism::node value, Location location) -> void + # + # @return [CallOperatorWriteNode] a new instance of CallOperatorWriteNode + # + # source://prism//lib/prism/node.rb#2685 + sig do + params( + source: Prism::Source, + 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, + location: Prism::Location + ).void + end + def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, binary_operator, binary_operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#2852 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#2700 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def attribute_write?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2798 + sig { returns(T::Boolean) } + def attribute_write?; end + + # attr_reader binary_operator: Symbol + # + # source://prism//lib/prism/node.rb#2775 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # source://prism//lib/prism/node.rb#2778 + sig { returns(Prism::Location) } + def binary_operator_loc; end + + # def call_operator: () -> String? + # + # source://prism//lib/prism/node.rb#2808 + sig { returns(T.nilable(String)) } + def call_operator; end + + # attr_reader call_operator_loc: Location? + # + # source://prism//lib/prism/node.rb#2743 + sig { returns(T.nilable(Prism::Location)) } + def call_operator_loc; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#2705 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#2718 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#2710 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?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, ?location: Location) -> CallOperatorWriteNode + # + # source://prism//lib/prism/node.rb#2723 + sig do + params( + 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, + location: Prism::Location + ).returns(Prism::CallOperatorWriteNode) + end + def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#2705 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { 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, location: Location } + # + # source://prism//lib/prism/node.rb#2731 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def ignore_visibility?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2803 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#2818 + sig { override.returns(String) } + def inspect; end + + # def message: () -> String? + # + # source://prism//lib/prism/node.rb#2813 + sig { returns(T.nilable(String)) } + def message; end + + # attr_reader message_loc: Location? + # + # source://prism//lib/prism/node.rb#2756 + 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. + # + # source://prism//lib/prism/node_ext.rb#323 + 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. + # + # source://prism//lib/prism/node_ext.rb#330 + def operator_loc; end + + # attr_reader read_name: Symbol + # + # source://prism//lib/prism/node.rb#2769 + sig { returns(Symbol) } + def read_name; end + + # attr_reader receiver: Prism::node? + # + # source://prism//lib/prism/node.rb#2740 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2788 + sig { returns(T::Boolean) } + def safe_navigation?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#2836 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#2785 + sig { returns(Prism::Node) } + def value; end + + # def variable_call?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2793 + sig { returns(T::Boolean) } + def variable_call?; end + + # attr_reader write_name: Symbol + # + # source://prism//lib/prism/node.rb#2772 + sig { returns(Symbol) } + def write_name; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#2736 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#2846 + def type; end + end +end + +# Represents the use of the `||=` operator on a call. +# +# foo.bar ||= value +# ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#2870 +class Prism::CallOrWriteNode < ::Prism::Node + # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Location operator_loc, Prism::node value, Location location) -> void + # + # @return [CallOrWriteNode] a new instance of CallOrWriteNode + # + # source://prism//lib/prism/node.rb#2872 + sig do + params( + source: Prism::Source, + 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, + location: Prism::Location + ).void + end + def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#3040 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#2886 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def attribute_write?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2981 + sig { returns(T::Boolean) } + def attribute_write?; end + + # def call_operator: () -> String? + # + # source://prism//lib/prism/node.rb#2991 + sig { returns(T.nilable(String)) } + def call_operator; end + + # attr_reader call_operator_loc: Location? + # + # source://prism//lib/prism/node.rb#2929 + sig { returns(T.nilable(Prism::Location)) } + def call_operator_loc; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#2891 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#2904 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#2896 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> CallOrWriteNode + # + # source://prism//lib/prism/node.rb#2909 + sig do + params( + 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, + location: Prism::Location + ).returns(Prism::CallOrWriteNode) + end + def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#2891 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#2917 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def ignore_visibility?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2986 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#3006 + sig { override.returns(String) } + def inspect; end + + # def message: () -> String? + # + # source://prism//lib/prism/node.rb#2996 + sig { returns(T.nilable(String)) } + def message; end + + # attr_reader message_loc: Location? + # + # source://prism//lib/prism/node.rb#2942 + sig { returns(T.nilable(Prism::Location)) } + def message_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#3001 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#2961 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader read_name: Symbol + # + # source://prism//lib/prism/node.rb#2955 + sig { returns(Symbol) } + def read_name; end + + # attr_reader receiver: Prism::node? + # + # source://prism//lib/prism/node.rb#2926 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2971 + sig { returns(T::Boolean) } + def safe_navigation?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#3024 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#2968 + sig { returns(Prism::Node) } + def value; end + + # def variable_call?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2976 + sig { returns(T::Boolean) } + def variable_call?; end + + # attr_reader write_name: Symbol + # + # source://prism//lib/prism/node.rb#2958 + sig { returns(Symbol) } + def write_name; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#2922 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#3034 + 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 +# ^^^^^^^ +# +# source://prism//lib/prism/node.rb#3065 +class Prism::CallTargetNode < ::Prism::Node + # def initialize: (Integer flags, Prism::node receiver, Location call_operator_loc, Symbol name, Location message_loc, Location location) -> void + # + # @return [CallTargetNode] a new instance of CallTargetNode + # + # source://prism//lib/prism/node.rb#3067 + sig do + params( + source: Prism::Source, + flags: Integer, + receiver: Prism::Node, + call_operator_loc: Prism::Location, + name: Symbol, + message_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, flags, receiver, call_operator_loc, name, message_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#3199 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#3078 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def attribute_write?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#3145 + sig { returns(T::Boolean) } + def attribute_write?; end + + # def call_operator: () -> String + # + # source://prism//lib/prism/node.rb#3155 + sig { returns(String) } + def call_operator; end + + # attr_reader call_operator_loc: Location + # + # source://prism//lib/prism/node.rb#3118 + sig { returns(Prism::Location) } + def call_operator_loc; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#3083 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#3093 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#3088 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?receiver: Prism::node, ?call_operator_loc: Location, ?name: Symbol, ?message_loc: Location, ?location: Location) -> CallTargetNode + # + # source://prism//lib/prism/node.rb#3098 + sig do + params( + flags: Integer, + receiver: Prism::Node, + call_operator_loc: Prism::Location, + name: Symbol, + message_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::CallTargetNode) + end + def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), name: T.unsafe(nil), message_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#3083 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node, call_operator_loc: Location, name: Symbol, message_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#3106 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def ignore_visibility?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#3150 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#3165 + sig { override.returns(String) } + def inspect; end + + # def message: () -> String + # + # source://prism//lib/prism/node.rb#3160 + sig { returns(String) } + def message; end + + # attr_reader message_loc: Location + # + # source://prism//lib/prism/node.rb#3128 + sig { returns(Prism::Location) } + def message_loc; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#3125 + sig { returns(Symbol) } + def name; end + + # attr_reader receiver: Prism::node + # + # source://prism//lib/prism/node.rb#3115 + sig { returns(Prism::Node) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#3135 + sig { returns(T::Boolean) } + def safe_navigation?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#3183 + sig { override.returns(Symbol) } + def type; end + + # def variable_call?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#3140 + sig { returns(T::Boolean) } + def variable_call?; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#3111 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#3193 + def type; end + end +end + +# Represents assigning to a local variable in pattern matching. +# +# foo => [bar => baz] +# ^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#3213 +class Prism::CapturePatternNode < ::Prism::Node + # def initialize: (Prism::node value, Prism::node target, Location operator_loc, Location location) -> void + # + # @return [CapturePatternNode] a new instance of CapturePatternNode + # + # source://prism//lib/prism/node.rb#3215 + sig do + params( + source: Prism::Source, + value: Prism::Node, + target: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, value, target, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#3309 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#3224 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#3229 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#3239 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#3234 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?value: Prism::node, ?target: Prism::node, ?operator_loc: Location, ?location: Location) -> CapturePatternNode + # + # source://prism//lib/prism/node.rb#3244 + sig do + params( + value: Prism::Node, + target: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::CapturePatternNode) + end + def copy(value: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#3229 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, target: Prism::node, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#3252 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#3275 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#3270 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#3263 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader target: Prism::node + # + # source://prism//lib/prism/node.rb#3260 + sig { returns(Prism::Node) } + def target; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#3293 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#3257 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#3303 + def type; end + end +end + +# Represents the use of a case statement for pattern matching. +# +# case true +# in false +# end +# ^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#3323 +class Prism::CaseMatchNode < ::Prism::Node + # def initialize: (Prism::node? predicate, Array[Prism::node] conditions, ElseNode? consequent, Location case_keyword_loc, Location end_keyword_loc, Location location) -> void + # + # @return [CaseMatchNode] a new instance of CaseMatchNode + # + # source://prism//lib/prism/node.rb#3325 + sig do + params( + source: Prism::Source, + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::Node], + consequent: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#3440 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#3336 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def case_keyword: () -> String + # + # source://prism//lib/prism/node.rb#3396 + sig { returns(String) } + def case_keyword; end + + # attr_reader case_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#3382 + sig { returns(Prism::Location) } + def case_keyword_loc; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#3341 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#3355 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#3346 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # attr_reader conditions: Array[Prism::node] + # + # source://prism//lib/prism/node.rb#3376 + sig { returns(T::Array[Prism::Node]) } + def conditions; end + + # attr_reader consequent: ElseNode? + # + # source://prism//lib/prism/node.rb#3379 + sig { returns(T.nilable(Prism::ElseNode)) } + def consequent; end + + # def copy: (?predicate: Prism::node?, ?conditions: Array[Prism::node], ?consequent: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location, ?location: Location) -> CaseMatchNode + # + # source://prism//lib/prism/node.rb#3360 + sig do + params( + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::Node], + consequent: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::CaseMatchNode) + end + def copy(predicate: T.unsafe(nil), conditions: T.unsafe(nil), consequent: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#3341 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { predicate: Prism::node?, conditions: Array[Prism::node], consequent: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#3368 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def end_keyword: () -> String + # + # source://prism//lib/prism/node.rb#3401 + sig { returns(String) } + def end_keyword; end + + # attr_reader end_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#3389 + sig { returns(Prism::Location) } + def end_keyword_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#3406 + sig { override.returns(String) } + def inspect; end + + # attr_reader predicate: Prism::node? + # + # source://prism//lib/prism/node.rb#3373 + sig { returns(T.nilable(Prism::Node)) } + def predicate; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#3424 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#3434 + def type; end + end +end + +# Represents the use of a case statement. +# +# case true +# when false +# end +# ^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#3457 +class Prism::CaseNode < ::Prism::Node + # def initialize: (Prism::node? predicate, Array[Prism::node] conditions, ElseNode? consequent, Location case_keyword_loc, Location end_keyword_loc, Location location) -> void + # + # @return [CaseNode] a new instance of CaseNode + # + # source://prism//lib/prism/node.rb#3459 + sig do + params( + source: Prism::Source, + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::Node], + consequent: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#3574 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#3470 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def case_keyword: () -> String + # + # source://prism//lib/prism/node.rb#3530 + sig { returns(String) } + def case_keyword; end + + # attr_reader case_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#3516 + sig { returns(Prism::Location) } + def case_keyword_loc; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#3475 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#3489 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#3480 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # attr_reader conditions: Array[Prism::node] + # + # source://prism//lib/prism/node.rb#3510 + sig { returns(T::Array[Prism::Node]) } + def conditions; end + + # attr_reader consequent: ElseNode? + # + # source://prism//lib/prism/node.rb#3513 + sig { returns(T.nilable(Prism::ElseNode)) } + def consequent; end + + # def copy: (?predicate: Prism::node?, ?conditions: Array[Prism::node], ?consequent: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location, ?location: Location) -> CaseNode + # + # source://prism//lib/prism/node.rb#3494 + sig do + params( + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::Node], + consequent: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::CaseNode) + end + def copy(predicate: T.unsafe(nil), conditions: T.unsafe(nil), consequent: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#3475 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { predicate: Prism::node?, conditions: Array[Prism::node], consequent: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#3502 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def end_keyword: () -> String + # + # source://prism//lib/prism/node.rb#3535 + sig { returns(String) } + def end_keyword; end + + # attr_reader end_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#3523 + sig { returns(Prism::Location) } + def end_keyword_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#3540 + sig { override.returns(String) } + def inspect; end + + # attr_reader predicate: Prism::node? + # + # source://prism//lib/prism/node.rb#3507 + sig { returns(T.nilable(Prism::Node)) } + def predicate; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#3558 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#3568 + def type; end + end +end + +# Represents a class declaration involving the `class` keyword. +# +# class Foo end +# ^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#3589 +class Prism::ClassNode < ::Prism::Node + # def initialize: (Array[Symbol] locals, Location class_keyword_loc, Prism::node constant_path, Location? inheritance_operator_loc, Prism::node? superclass, Prism::node? body, Location end_keyword_loc, Symbol name, Location location) -> void + # + # @return [ClassNode] a new instance of ClassNode + # + # source://prism//lib/prism/node.rb#3591 + sig do + params( + source: Prism::Source, + locals: T::Array[Symbol], + class_keyword_loc: Prism::Location, + constant_path: Prism::Node, + inheritance_operator_loc: T.nilable(Prism::Location), + superclass: T.nilable(Prism::Node), + body: T.nilable(Prism::Node), + end_keyword_loc: Prism::Location, + name: Symbol, + location: Prism::Location + ).void + end + def initialize(source, locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#3733 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#3605 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader body: Prism::node? + # + # source://prism//lib/prism/node.rb#3671 + sig { returns(T.nilable(Prism::Node)) } + def body; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#3610 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def class_keyword: () -> String + # + # source://prism//lib/prism/node.rb#3684 + sig { returns(String) } + def class_keyword; end + + # attr_reader class_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#3645 + sig { returns(Prism::Location) } + def class_keyword_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#3624 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#3615 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # attr_reader constant_path: Prism::node + # + # source://prism//lib/prism/node.rb#3652 + sig { returns(Prism::Node) } + def constant_path; end + + # def copy: (?locals: Array[Symbol], ?class_keyword_loc: Location, ?constant_path: Prism::node, ?inheritance_operator_loc: Location?, ?superclass: Prism::node?, ?body: Prism::node?, ?end_keyword_loc: Location, ?name: Symbol, ?location: Location) -> ClassNode + # + # source://prism//lib/prism/node.rb#3629 + sig do + params( + locals: T::Array[Symbol], + class_keyword_loc: Prism::Location, + constant_path: Prism::Node, + inheritance_operator_loc: T.nilable(Prism::Location), + superclass: T.nilable(Prism::Node), + body: T.nilable(Prism::Node), + end_keyword_loc: Prism::Location, + name: Symbol, + location: Prism::Location + ).returns(Prism::ClassNode) + end + def copy(locals: T.unsafe(nil), class_keyword_loc: T.unsafe(nil), constant_path: T.unsafe(nil), inheritance_operator_loc: T.unsafe(nil), superclass: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), name: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#3610 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], class_keyword_loc: Location, constant_path: Prism::node, inheritance_operator_loc: Location?, superclass: Prism::node?, body: Prism::node?, end_keyword_loc: Location, name: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#3637 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def end_keyword: () -> String + # + # source://prism//lib/prism/node.rb#3694 + sig { returns(String) } + def end_keyword; end + + # attr_reader end_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#3674 + sig { returns(Prism::Location) } + def end_keyword_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inheritance_operator: () -> String? + # + # source://prism//lib/prism/node.rb#3689 + sig { returns(T.nilable(String)) } + def inheritance_operator; end + + # attr_reader inheritance_operator_loc: Location? + # + # source://prism//lib/prism/node.rb#3655 + sig { returns(T.nilable(Prism::Location)) } + def inheritance_operator_loc; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#3699 + sig { override.returns(String) } + def inspect; end + + # attr_reader locals: Array[Symbol] + # + # source://prism//lib/prism/node.rb#3642 + sig { returns(T::Array[Symbol]) } + def locals; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#3681 + sig { returns(Symbol) } + def name; end + + # attr_reader superclass: Prism::node? + # + # source://prism//lib/prism/node.rb#3668 + sig { returns(T.nilable(Prism::Node)) } + def superclass; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#3717 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#3727 + def type; end + end +end + +# Represents the use of the `&&=` operator for assignment to a class variable. +# +# @@target &&= value +# ^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#3751 +class Prism::ClassVariableAndWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # + # @return [ClassVariableAndWriteNode] a new instance of ClassVariableAndWriteNode + # + # source://prism//lib/prism/node.rb#3753 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#3855 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#3763 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#3768 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#3778 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#3773 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ClassVariableAndWriteNode + # + # source://prism//lib/prism/node.rb#3783 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::ClassVariableAndWriteNode) + end + def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#3768 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#3791 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # source://prism//lib/prism/desugar_compiler.rb#127 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#3821 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#3796 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#3799 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#3816 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#3806 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#3839 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#3813 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#3849 + def type; end + end +end + +# Represents assigning to a class variable using an operator that isn't `=`. +# +# @@target += value +# ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#3868 +class Prism::ClassVariableOperatorWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void + # + # @return [ClassVariableOperatorWriteNode] a new instance of ClassVariableOperatorWriteNode + # + # source://prism//lib/prism/node.rb#3870 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#3971 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#3881 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader binary_operator: Symbol + # + # source://prism//lib/prism/node.rb#3934 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # source://prism//lib/prism/node.rb#3924 + sig { returns(Prism::Location) } + def binary_operator_loc; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#3886 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#3896 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#3891 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ClassVariableOperatorWriteNode + # + # source://prism//lib/prism/node.rb#3901 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).returns(Prism::ClassVariableOperatorWriteNode) + end + def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#3886 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#3909 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # source://prism//lib/prism/desugar_compiler.rb#139 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#3937 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#3914 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#3917 + 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. + # + # source://prism//lib/prism/node_ext.rb#339 + 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. + # + # source://prism//lib/prism/node_ext.rb#346 + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#3955 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#3931 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#3965 + def type; end + end +end + +# Represents the use of the `||=` operator for assignment to a class variable. +# +# @@target ||= value +# ^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#3985 +class Prism::ClassVariableOrWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # + # @return [ClassVariableOrWriteNode] a new instance of ClassVariableOrWriteNode + # + # source://prism//lib/prism/node.rb#3987 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#4089 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#3997 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4002 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#4012 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#4007 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ClassVariableOrWriteNode + # + # source://prism//lib/prism/node.rb#4017 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::ClassVariableOrWriteNode) + end + def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4002 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#4025 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # source://prism//lib/prism/desugar_compiler.rb#133 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#4055 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#4030 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#4033 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#4050 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#4040 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4073 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#4047 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4083 + def type; end + end +end + +# Represents referencing a class variable. +# +# @@foo +# ^^^^^ +# +# source://prism//lib/prism/node.rb#4102 +class Prism::ClassVariableReadNode < ::Prism::Node + # def initialize: (Symbol name, Location location) -> void + # + # @return [ClassVariableReadNode] a new instance of ClassVariableReadNode + # + # source://prism//lib/prism/node.rb#4104 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } + def initialize(source, name, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#4185 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#4111 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4116 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#4126 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#4121 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?location: Location) -> ClassVariableReadNode + # + # source://prism//lib/prism/node.rb#4131 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::ClassVariableReadNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4116 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#4139 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#4151 + 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` + # + # source://prism//lib/prism/node.rb#4148 + sig { returns(Symbol) } + def name; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4169 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4179 + def type; end + end +end + +# Represents writing to a class variable in a context that doesn't have an explicit value. +# +# @@foo, @@bar = baz +# ^^^^^ ^^^^^ +# +# source://prism//lib/prism/node.rb#4195 +class Prism::ClassVariableTargetNode < ::Prism::Node + # def initialize: (Symbol name, Location location) -> void + # + # @return [ClassVariableTargetNode] a new instance of ClassVariableTargetNode + # + # source://prism//lib/prism/node.rb#4197 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } + def initialize(source, name, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#4274 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#4204 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4209 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#4219 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#4214 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?location: Location) -> ClassVariableTargetNode + # + # source://prism//lib/prism/node.rb#4224 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::ClassVariableTargetNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4209 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#4232 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#4240 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#4237 + sig { returns(Symbol) } + def name; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4258 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4268 + def type; end + end +end + +# Represents writing to a class variable. +# +# @@foo = 1 +# ^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#4284 +class Prism::ClassVariableWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void + # + # @return [ClassVariableWriteNode] a new instance of ClassVariableWriteNode + # + # source://prism//lib/prism/node.rb#4286 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, value, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#4404 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#4296 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4301 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#4311 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#4306 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> ClassVariableWriteNode + # + # source://prism//lib/prism/node.rb#4316 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::ClassVariableWriteNode) + end + def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4301 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#4324 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#4370 + 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` + # + # source://prism//lib/prism/node.rb#4333 + sig { returns(Symbol) } + def name; end + + # The location of the variable name. + # + # @@foo = :bar + # ^^^^^ + # + # source://prism//lib/prism/node.rb#4339 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#4365 + sig { returns(String) } + def operator; end + + # The location of the `=` operator. + # + # @@foo = :bar + # ^ + # + # source://prism//lib/prism/node.rb#4358 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4388 + 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 + # ^^^ + # + # source://prism//lib/prism/node.rb#4352 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4398 + def type; end + end +end + +# This represents a comment that was encountered during parsing. It is the +# base class for all comment types. +# +# source://prism//lib/prism/parse_result.rb#366 +class Prism::Comment + abstract! + + # Create a new comment object with the given location. + # + # @return [Comment] a new instance of Comment + # + # source://prism//lib/prism/parse_result.rb#371 + sig { params(location: Prism::Location).void } + def initialize(location); end + + # Implement the hash pattern matching interface for Comment. + # + # source://prism//lib/prism/parse_result.rb#376 + 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. + # + # source://prism//lib/prism/parse_result.rb#368 + sig { returns(Prism::Location) } + def location; end + + # Returns the content of the comment by slicing it from the source code. + # + # source://prism//lib/prism/parse_result.rb#381 + 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]]]]]]]] +# +# source://prism//lib/prism/compiler.rb#27 +class Prism::Compiler < ::Prism::Visitor + # Visit an individual node. + # + # source://prism//lib/prism/compiler.rb#29 + sig { params(node: T.nilable(Prism::Node)).returns(T.untyped) } + def visit(node); end + + # Visit the child nodes of the given node. + # Compile a AliasGlobalVariableNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_alias_global_variable_node(node); end + + # Visit the child nodes of the given node. + # Compile a AliasMethodNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_alias_method_node(node); end + + # Visit a list of nodes. + # + # source://prism//lib/prism/compiler.rb#34 + sig { params(nodes: T::Array[T.nilable(Prism::Node)]).returns(T::Array[T.untyped]) } + def visit_all(nodes); end + + # Visit the child nodes of the given node. + # Compile a AlternationPatternNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_alternation_pattern_node(node); end + + # Visit the child nodes of the given node. + # Compile a AndNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_and_node(node); end + + # Visit the child nodes of the given node. + # Compile a ArgumentsNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_arguments_node(node); end + + # Visit the child nodes of the given node. + # Compile a ArrayNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_array_node(node); end + + # Visit the child nodes of the given node. + # Compile a ArrayPatternNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_array_pattern_node(node); end + + # Visit the child nodes of the given node. + # Compile a AssocNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_assoc_node(node); end + + # Visit the child nodes of the given node. + # Compile a AssocSplatNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_assoc_splat_node(node); end + + # Visit the child nodes of the given node. + # Compile a BackReferenceReadNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_back_reference_read_node(node); end + + # Visit the child nodes of the given node. + # Compile a BeginNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_begin_node(node); end + + # Visit the child nodes of the given node. + # Compile a BlockArgumentNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_block_argument_node(node); end + + # Visit the child nodes of the given node. + # Compile a BlockLocalVariableNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_block_local_variable_node(node); end + + # Visit the child nodes of the given node. + # Compile a BlockNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_block_node(node); end + + # Visit the child nodes of the given node. + # Compile a BlockParameterNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_block_parameter_node(node); end + + # Visit the child nodes of the given node. + # Compile a BlockParametersNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_block_parameters_node(node); end + + # Visit the child nodes of the given node. + # Compile a BreakNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_break_node(node); end + + # Visit the child nodes of the given node. + # Compile a CallAndWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_call_and_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a CallNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_call_node(node); end + + # Visit the child nodes of the given node. + # Compile a CallOperatorWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_call_operator_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a CallOrWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_call_or_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a CallTargetNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_call_target_node(node); end + + # Visit the child nodes of the given node. + # Compile a CapturePatternNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_capture_pattern_node(node); end + + # Visit the child nodes of the given node. + # Compile a CaseMatchNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_case_match_node(node); end + + # Visit the child nodes of the given node. + # Compile a CaseNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_case_node(node); end + + # Visit the child nodes of the given node. + # + # source://prism//lib/prism/compiler.rb#39 + sig { params(node: Prism::Node).returns(T::Array[T.untyped]) } + def visit_child_nodes(node); end + + # Visit the child nodes of the given node. + # Compile a ClassNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_class_node(node); end + + # Visit the child nodes of the given node. + # Compile a ClassVariableAndWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_class_variable_and_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a ClassVariableOperatorWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_class_variable_operator_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a ClassVariableOrWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_class_variable_or_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a ClassVariableReadNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_class_variable_read_node(node); end + + # Visit the child nodes of the given node. + # Compile a ClassVariableTargetNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_class_variable_target_node(node); end + + # Visit the child nodes of the given node. + # Compile a ClassVariableWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_class_variable_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a ConstantAndWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_constant_and_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a ConstantOperatorWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_constant_operator_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a ConstantOrWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_constant_or_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a ConstantPathAndWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_constant_path_and_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a ConstantPathNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_constant_path_node(node); end + + # Visit the child nodes of the given node. + # Compile a ConstantPathOperatorWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_constant_path_operator_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a ConstantPathOrWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_constant_path_or_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a ConstantPathTargetNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_constant_path_target_node(node); end + + # Visit the child nodes of the given node. + # Compile a ConstantPathWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_constant_path_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a ConstantReadNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_constant_read_node(node); end + + # Visit the child nodes of the given node. + # Compile a ConstantTargetNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_constant_target_node(node); end + + # Visit the child nodes of the given node. + # Compile a ConstantWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_constant_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a DefNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_def_node(node); end + + # Visit the child nodes of the given node. + # Compile a DefinedNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_defined_node(node); end + + # Visit the child nodes of the given node. + # Compile a ElseNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_else_node(node); end + + # Visit the child nodes of the given node. + # Compile a EmbeddedStatementsNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_embedded_statements_node(node); end + + # Visit the child nodes of the given node. + # Compile a EmbeddedVariableNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_embedded_variable_node(node); end + + # Visit the child nodes of the given node. + # Compile a EnsureNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_ensure_node(node); end + + # Visit the child nodes of the given node. + # Compile a FalseNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_false_node(node); end + + # Visit the child nodes of the given node. + # Compile a FindPatternNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_find_pattern_node(node); end + + # Visit the child nodes of the given node. + # Compile a FlipFlopNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_flip_flop_node(node); end + + # Visit the child nodes of the given node. + # Compile a FloatNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_float_node(node); end + + # Visit the child nodes of the given node. + # Compile a ForNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_for_node(node); end + + # Visit the child nodes of the given node. + # Compile a ForwardingArgumentsNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_forwarding_arguments_node(node); end + + # Visit the child nodes of the given node. + # Compile a ForwardingParameterNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_forwarding_parameter_node(node); end + + # Visit the child nodes of the given node. + # Compile a ForwardingSuperNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_forwarding_super_node(node); end + + # Visit the child nodes of the given node. + # Compile a GlobalVariableAndWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_global_variable_and_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a GlobalVariableOperatorWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_global_variable_operator_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a GlobalVariableOrWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_global_variable_or_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a GlobalVariableReadNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_global_variable_read_node(node); end + + # Visit the child nodes of the given node. + # Compile a GlobalVariableTargetNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_global_variable_target_node(node); end + + # Visit the child nodes of the given node. + # Compile a GlobalVariableWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_global_variable_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a HashNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_hash_node(node); end + + # Visit the child nodes of the given node. + # Compile a HashPatternNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_hash_pattern_node(node); end + + # Visit the child nodes of the given node. + # Compile a IfNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_if_node(node); end + + # Visit the child nodes of the given node. + # Compile a ImaginaryNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_imaginary_node(node); end + + # Visit the child nodes of the given node. + # Compile a ImplicitNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_implicit_node(node); end + + # Visit the child nodes of the given node. + # Compile a ImplicitRestNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_implicit_rest_node(node); end + + # Visit the child nodes of the given node. + # Compile a InNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_in_node(node); end + + # Visit the child nodes of the given node. + # Compile a IndexAndWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_index_and_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a IndexOperatorWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_index_operator_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a IndexOrWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_index_or_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a IndexTargetNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_index_target_node(node); end + + # Visit the child nodes of the given node. + # Compile a InstanceVariableAndWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_instance_variable_and_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a InstanceVariableOperatorWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_instance_variable_operator_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a InstanceVariableOrWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_instance_variable_or_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a InstanceVariableReadNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_instance_variable_read_node(node); end + + # Visit the child nodes of the given node. + # Compile a InstanceVariableTargetNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_instance_variable_target_node(node); end + + # Visit the child nodes of the given node. + # Compile a InstanceVariableWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_instance_variable_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a IntegerNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_integer_node(node); end + + # Visit the child nodes of the given node. + # Compile a InterpolatedMatchLastLineNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_interpolated_match_last_line_node(node); end + + # Visit the child nodes of the given node. + # Compile a InterpolatedRegularExpressionNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_interpolated_regular_expression_node(node); end + + # Visit the child nodes of the given node. + # Compile a InterpolatedStringNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_interpolated_string_node(node); end + + # Visit the child nodes of the given node. + # Compile a InterpolatedSymbolNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_interpolated_symbol_node(node); end + + # Visit the child nodes of the given node. + # Compile a InterpolatedXStringNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_interpolated_x_string_node(node); end + + # Visit the child nodes of the given node. + # Compile a ItLocalVariableReadNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_it_local_variable_read_node(node); end + + # Visit the child nodes of the given node. + # Compile a ItParametersNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_it_parameters_node(node); end + + # Visit the child nodes of the given node. + # Compile a KeywordHashNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_keyword_hash_node(node); end + + # Visit the child nodes of the given node. + # Compile a KeywordRestParameterNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_keyword_rest_parameter_node(node); end + + # Visit the child nodes of the given node. + # Compile a LambdaNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_lambda_node(node); end + + # Visit the child nodes of the given node. + # Compile a LocalVariableAndWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_local_variable_and_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a LocalVariableOperatorWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_local_variable_operator_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a LocalVariableOrWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_local_variable_or_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a LocalVariableReadNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_local_variable_read_node(node); end + + # Visit the child nodes of the given node. + # Compile a LocalVariableTargetNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_local_variable_target_node(node); end + + # Visit the child nodes of the given node. + # Compile a LocalVariableWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_local_variable_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a MatchLastLineNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_match_last_line_node(node); end + + # Visit the child nodes of the given node. + # Compile a MatchPredicateNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_match_predicate_node(node); end + + # Visit the child nodes of the given node. + # Compile a MatchRequiredNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_match_required_node(node); end + + # Visit the child nodes of the given node. + # Compile a MatchWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_match_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a MissingNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_missing_node(node); end + + # Visit the child nodes of the given node. + # Compile a ModuleNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_module_node(node); end + + # Visit the child nodes of the given node. + # Compile a MultiTargetNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_multi_target_node(node); end + + # Visit the child nodes of the given node. + # Compile a MultiWriteNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_multi_write_node(node); end + + # Visit the child nodes of the given node. + # Compile a NextNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_next_node(node); end + + # Visit the child nodes of the given node. + # Compile a NilNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_nil_node(node); end + + # Visit the child nodes of the given node. + # Compile a NoKeywordsParameterNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_no_keywords_parameter_node(node); end + + # Visit the child nodes of the given node. + # Compile a NumberedParametersNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_numbered_parameters_node(node); end + + # Visit the child nodes of the given node. + # Compile a NumberedReferenceReadNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_numbered_reference_read_node(node); end + + # Visit the child nodes of the given node. + # Compile a OptionalKeywordParameterNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_optional_keyword_parameter_node(node); end + + # Visit the child nodes of the given node. + # Compile a OptionalParameterNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_optional_parameter_node(node); end + + # Visit the child nodes of the given node. + # Compile a OrNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_or_node(node); end + + # Visit the child nodes of the given node. + # Compile a ParametersNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_parameters_node(node); end + + # Visit the child nodes of the given node. + # Compile a ParenthesesNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_parentheses_node(node); end + + # Visit the child nodes of the given node. + # Compile a PinnedExpressionNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_pinned_expression_node(node); end + + # Visit the child nodes of the given node. + # Compile a PinnedVariableNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_pinned_variable_node(node); end + + # Visit the child nodes of the given node. + # Compile a PostExecutionNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_post_execution_node(node); end + + # Visit the child nodes of the given node. + # Compile a PreExecutionNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_pre_execution_node(node); end + + # Visit the child nodes of the given node. + # Compile a ProgramNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_program_node(node); end + + # Visit the child nodes of the given node. + # Compile a RangeNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_range_node(node); end + + # Visit the child nodes of the given node. + # Compile a RationalNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_rational_node(node); end + + # Visit the child nodes of the given node. + # Compile a RedoNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_redo_node(node); end + + # Visit the child nodes of the given node. + # Compile a RegularExpressionNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_regular_expression_node(node); end + + # Visit the child nodes of the given node. + # Compile a RequiredKeywordParameterNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_required_keyword_parameter_node(node); end + + # Visit the child nodes of the given node. + # Compile a RequiredParameterNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_required_parameter_node(node); end + + # Visit the child nodes of the given node. + # Compile a RescueModifierNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_rescue_modifier_node(node); end + + # Visit the child nodes of the given node. + # Compile a RescueNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_rescue_node(node); end + + # Visit the child nodes of the given node. + # Compile a RestParameterNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_rest_parameter_node(node); end + + # Visit the child nodes of the given node. + # Compile a RetryNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_retry_node(node); end + + # Visit the child nodes of the given node. + # Compile a ReturnNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_return_node(node); end + + # Visit the child nodes of the given node. + # Compile a SelfNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_self_node(node); end + + # Visit the child nodes of the given node. + # Compile a ShareableConstantNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_shareable_constant_node(node); end + + # Visit the child nodes of the given node. + # Compile a SingletonClassNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_singleton_class_node(node); end + + # Visit the child nodes of the given node. + # Compile a SourceEncodingNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_source_encoding_node(node); end + + # Visit the child nodes of the given node. + # Compile a SourceFileNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_source_file_node(node); end + + # Visit the child nodes of the given node. + # Compile a SourceLineNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_source_line_node(node); end + + # Visit the child nodes of the given node. + # Compile a SplatNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_splat_node(node); end + + # Visit the child nodes of the given node. + # Compile a StatementsNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_statements_node(node); end + + # Visit the child nodes of the given node. + # Compile a StringNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_string_node(node); end + + # Visit the child nodes of the given node. + # Compile a SuperNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_super_node(node); end + + # Visit the child nodes of the given node. + # Compile a SymbolNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_symbol_node(node); end + + # Visit the child nodes of the given node. + # Compile a TrueNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_true_node(node); end + + # Visit the child nodes of the given node. + # Compile a UndefNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_undef_node(node); end + + # Visit the child nodes of the given node. + # Compile a UnlessNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_unless_node(node); end + + # Visit the child nodes of the given node. + # Compile a UntilNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_until_node(node); end + + # Visit the child nodes of the given node. + # Compile a WhenNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_when_node(node); end + + # Visit the child nodes of the given node. + # Compile a WhileNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_while_node(node); end + + # Visit the child nodes of the given node. + # Compile a XStringNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_x_string_node(node); end + + # Visit the child nodes of the given node. + # Compile a YieldNode node + # + # source://prism//lib/prism/compiler.rb#39 + def visit_yield_node(node); end +end + +# Represents the use of the `&&=` operator for assignment to a constant. +# +# Target &&= value +# ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#4417 +class Prism::ConstantAndWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # + # @return [ConstantAndWriteNode] a new instance of ConstantAndWriteNode + # + # source://prism//lib/prism/node.rb#4419 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#4521 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#4429 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4434 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#4444 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#4439 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantAndWriteNode + # + # source://prism//lib/prism/node.rb#4449 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::ConstantAndWriteNode) + end + def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4434 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#4457 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # source://prism//lib/prism/desugar_compiler.rb#145 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#4487 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#4462 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#4465 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#4482 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#4472 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4505 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#4479 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4515 + def type; end + end +end + +# Represents assigning to a constant using an operator that isn't `=`. +# +# Target += value +# ^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#4534 +class Prism::ConstantOperatorWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void + # + # @return [ConstantOperatorWriteNode] a new instance of ConstantOperatorWriteNode + # + # source://prism//lib/prism/node.rb#4536 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#4637 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#4547 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader binary_operator: Symbol + # + # source://prism//lib/prism/node.rb#4600 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # source://prism//lib/prism/node.rb#4590 + sig { returns(Prism::Location) } + def binary_operator_loc; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4552 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#4562 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#4557 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ConstantOperatorWriteNode + # + # source://prism//lib/prism/node.rb#4567 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).returns(Prism::ConstantOperatorWriteNode) + end + def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4552 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#4575 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # source://prism//lib/prism/desugar_compiler.rb#157 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#4603 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#4580 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#4583 + 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. + # + # source://prism//lib/prism/node_ext.rb#355 + 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. + # + # source://prism//lib/prism/node_ext.rb#362 + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4621 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#4597 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4631 + def type; end + end +end + +# Represents the use of the `||=` operator for assignment to a constant. +# +# Target ||= value +# ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#4651 +class Prism::ConstantOrWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # + # @return [ConstantOrWriteNode] a new instance of ConstantOrWriteNode + # + # source://prism//lib/prism/node.rb#4653 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#4755 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#4663 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4668 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#4678 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#4673 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantOrWriteNode + # + # source://prism//lib/prism/node.rb#4683 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::ConstantOrWriteNode) + end + def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4668 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#4691 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # source://prism//lib/prism/desugar_compiler.rb#151 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#4721 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#4696 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#4699 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#4716 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#4706 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4739 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#4713 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4749 + def type; end + end +end + +# Represents the use of the `&&=` operator for assignment to a constant path. +# +# Parent::Child &&= value +# ^^^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#4768 +class Prism::ConstantPathAndWriteNode < ::Prism::Node + # def initialize: (ConstantPathNode target, Location operator_loc, Prism::node value, Location location) -> void + # + # @return [ConstantPathAndWriteNode] a new instance of ConstantPathAndWriteNode + # + # source://prism//lib/prism/node.rb#4770 + sig do + params( + source: Prism::Source, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, target, operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#4864 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#4779 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4784 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#4794 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#4789 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantPathAndWriteNode + # + # source://prism//lib/prism/node.rb#4799 + sig do + params( + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::ConstantPathAndWriteNode) + end + def copy(target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4784 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#4807 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#4830 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#4825 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#4815 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader target: ConstantPathNode + # + # source://prism//lib/prism/node.rb#4812 + sig { returns(Prism::ConstantPathNode) } + def target; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4848 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#4822 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4858 + def type; end + end +end + +# Represents accessing a constant through a path of `::` operators. +# +# Foo::Bar +# ^^^^^^^^ +# +# source://prism//lib/prism/node.rb#4876 +class Prism::ConstantPathNode < ::Prism::Node + # def initialize: (Prism::node? parent, Symbol? name, Location delimiter_loc, Location name_loc, Location location) -> void + # + # @return [ConstantPathNode] a new instance of ConstantPathNode + # + # source://prism//lib/prism/node.rb#4878 + sig do + params( + source: Prism::Source, + parent: T.nilable(Prism::Node), + name: T.nilable(Symbol), + delimiter_loc: Prism::Location, + name_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, parent, name, delimiter_loc, name_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#5003 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#4888 + 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. + # + # source://prism//lib/prism/node_ext.rb#196 + def child; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4893 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#4905 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#4898 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location, ?location: Location) -> ConstantPathNode + # + # source://prism//lib/prism/node.rb#4910 + sig do + params( + parent: T.nilable(Prism::Node), + name: T.nilable(Symbol), + delimiter_loc: Prism::Location, + name_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::ConstantPathNode) + end + def copy(parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#4893 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { parent: Prism::node?, name: Symbol?, delimiter_loc: Location, name_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#4918 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def delimiter: () -> String + # + # source://prism//lib/prism/node.rb#4964 + sig { returns(String) } + def delimiter; end + + # The location of the `::` delimiter. + # + # ::Foo + # ^^ + # + # One::Two + # ^^ + # + # source://prism//lib/prism/node.rb#4944 + sig { returns(Prism::Location) } + def delimiter_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # Returns the full name of this constant path. For example: "Foo::Bar" + # + # source://prism//lib/prism/node_ext.rb#189 + sig { returns(String) } + def full_name; end + + # Returns the list of parts for the full name of this constant path. + # For example: [:Foo, :Bar] + # + # source://prism//lib/prism/node_ext.rb#167 + sig { returns(T::Array[Symbol]) } + def full_name_parts; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#4969 + 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. + # + # source://prism//lib/prism/node.rb#4935 + sig { returns(T.nilable(Symbol)) } + def name; end + + # The location of the name of the constant. + # + # ::Foo + # ^^^ + # + # One::Two + # ^^^ + # + # source://prism//lib/prism/node.rb#4957 + 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 + # ^^^ + # + # source://prism//lib/prism/node.rb#4932 + sig { returns(T.nilable(Prism::Node)) } + def parent; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4987 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#4997 + 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 +# +# source://prism//lib/prism/node_ext.rb#158 +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 +# +# source://prism//lib/prism/node_ext.rb#163 +class Prism::ConstantPathNode::MissingNodesInConstantPathError < ::StandardError; end + +# Represents assigning to a constant path using an operator that isn't `=`. +# +# Parent::Child += value +# ^^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#5016 +class Prism::ConstantPathOperatorWriteNode < ::Prism::Node + # def initialize: (ConstantPathNode target, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void + # + # @return [ConstantPathOperatorWriteNode] a new instance of ConstantPathOperatorWriteNode + # + # source://prism//lib/prism/node.rb#5018 + sig do + params( + source: Prism::Source, + target: Prism::ConstantPathNode, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).void + end + def initialize(source, target, binary_operator_loc, value, binary_operator, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#5111 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#5028 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader binary_operator: Symbol + # + # source://prism//lib/prism/node.rb#5074 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # source://prism//lib/prism/node.rb#5064 + sig { returns(Prism::Location) } + def binary_operator_loc; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#5033 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#5043 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#5038 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?target: ConstantPathNode, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ConstantPathOperatorWriteNode + # + # source://prism//lib/prism/node.rb#5048 + sig do + params( + target: Prism::ConstantPathNode, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).returns(Prism::ConstantPathOperatorWriteNode) + end + def copy(target: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#5033 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#5056 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#5077 + 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. + # + # source://prism//lib/prism/node_ext.rb#371 + 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. + # + # source://prism//lib/prism/node_ext.rb#378 + def operator_loc; end + + # attr_reader target: ConstantPathNode + # + # source://prism//lib/prism/node.rb#5061 + sig { returns(Prism::ConstantPathNode) } + def target; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#5095 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#5071 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#5105 + def type; end + end +end + +# Represents the use of the `||=` operator for assignment to a constant path. +# +# Parent::Child ||= value +# ^^^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#5124 +class Prism::ConstantPathOrWriteNode < ::Prism::Node + # def initialize: (ConstantPathNode target, Location operator_loc, Prism::node value, Location location) -> void + # + # @return [ConstantPathOrWriteNode] a new instance of ConstantPathOrWriteNode + # + # source://prism//lib/prism/node.rb#5126 + sig do + params( + source: Prism::Source, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, target, operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#5220 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#5135 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#5140 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#5150 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#5145 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantPathOrWriteNode + # + # source://prism//lib/prism/node.rb#5155 + sig do + params( + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::ConstantPathOrWriteNode) + end + def copy(target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#5140 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#5163 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#5186 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#5181 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#5171 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader target: ConstantPathNode + # + # source://prism//lib/prism/node.rb#5168 + sig { returns(Prism::ConstantPathNode) } + def target; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#5204 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#5178 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#5214 + 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 +# ^^^^^^^^ ^^^^^^^^ +# +# source://prism//lib/prism/node.rb#5232 +class Prism::ConstantPathTargetNode < ::Prism::Node + # def initialize: (Prism::node? parent, Symbol? name, Location delimiter_loc, Location name_loc, Location location) -> void + # + # @return [ConstantPathTargetNode] a new instance of ConstantPathTargetNode + # + # source://prism//lib/prism/node.rb#5234 + sig do + params( + source: Prism::Source, + parent: T.nilable(Prism::Node), + name: T.nilable(Symbol), + delimiter_loc: Prism::Location, + name_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, parent, name, delimiter_loc, name_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#5338 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#5244 + 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. + # + # source://prism//lib/prism/node_ext.rb#232 + def child; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#5249 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#5261 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#5254 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location, ?location: Location) -> ConstantPathTargetNode + # + # source://prism//lib/prism/node.rb#5266 + sig do + params( + parent: T.nilable(Prism::Node), + name: T.nilable(Symbol), + delimiter_loc: Prism::Location, + name_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::ConstantPathTargetNode) + end + def copy(parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#5249 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { parent: Prism::node?, name: Symbol?, delimiter_loc: Location, name_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#5274 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def delimiter: () -> String + # + # source://prism//lib/prism/node.rb#5299 + sig { returns(String) } + def delimiter; end + + # attr_reader delimiter_loc: Location + # + # source://prism//lib/prism/node.rb#5285 + sig { returns(Prism::Location) } + def delimiter_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # Returns the full name of this constant path. For example: "Foo::Bar" + # + # source://prism//lib/prism/node_ext.rb#225 + sig { returns(String) } + def full_name; end + + # Returns the list of parts for the full name of this constant path. + # For example: [:Foo, :Bar] + # + # source://prism//lib/prism/node_ext.rb#205 + sig { returns(T::Array[Symbol]) } + def full_name_parts; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#5304 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol? + # + # source://prism//lib/prism/node.rb#5282 + sig { returns(T.nilable(Symbol)) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#5292 + sig { returns(Prism::Location) } + def name_loc; end + + # attr_reader parent: Prism::node? + # + # source://prism//lib/prism/node.rb#5279 + sig { returns(T.nilable(Prism::Node)) } + def parent; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#5322 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#5332 + def type; end + end +end + +# Represents writing to a constant path. +# +# ::Foo = 1 +# ^^^^^^^^^ +# +# Foo::Bar = 1 +# ^^^^^^^^^^^^ +# +# ::Foo::Bar = 1 +# ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#5357 +class Prism::ConstantPathWriteNode < ::Prism::Node + # def initialize: (ConstantPathNode target, Location operator_loc, Prism::node value, Location location) -> void + # + # @return [ConstantPathWriteNode] a new instance of ConstantPathWriteNode + # + # source://prism//lib/prism/node.rb#5359 + sig do + params( + source: Prism::Source, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, target, operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#5465 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#5368 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#5373 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#5383 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#5378 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantPathWriteNode + # + # source://prism//lib/prism/node.rb#5388 + sig do + params( + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::ConstantPathWriteNode) + end + def copy(target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#5373 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#5396 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#5431 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#5426 + sig { returns(String) } + def operator; end + + # The location of the `=` operator. + # + # ::ABC = 123 + # ^ + # + # source://prism//lib/prism/node.rb#5413 + sig { returns(Prism::Location) } + def operator_loc; end + + # A node representing the constant path being written to. + # + # Foo::Bar = 1 + # ^^^^^^^^ + # + # ::Foo = :abc + # ^^^^^ + # + # source://prism//lib/prism/node.rb#5407 + sig { returns(Prism::ConstantPathNode) } + def target; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#5449 + 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 + # ^^^^ + # + # source://prism//lib/prism/node.rb#5423 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#5459 + def type; end + end +end + +# Represents referencing a constant. +# +# Foo +# ^^^ +# +# source://prism//lib/prism/node.rb#5477 +class Prism::ConstantReadNode < ::Prism::Node + # def initialize: (Symbol name, Location location) -> void + # + # @return [ConstantReadNode] a new instance of ConstantReadNode + # + # source://prism//lib/prism/node.rb#5479 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } + def initialize(source, name, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#5560 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#5486 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#5491 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#5501 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#5496 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?location: Location) -> ConstantReadNode + # + # source://prism//lib/prism/node.rb#5506 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::ConstantReadNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#5491 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#5514 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # Returns the full name of this constant. For example: "Foo" + # + # source://prism//lib/prism/node_ext.rb#133 + sig { returns(String) } + def full_name; end + + # Returns the list of parts for the full name of this constant. + # For example: [:Foo] + # + # source://prism//lib/prism/node_ext.rb#128 + sig { returns(T::Array[Symbol]) } + def full_name_parts; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#5526 + 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` + # + # source://prism//lib/prism/node.rb#5523 + sig { returns(Symbol) } + def name; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#5544 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#5554 + def type; end + end +end + +# Represents writing to a constant in a context that doesn't have an explicit value. +# +# Foo, Bar = baz +# ^^^ ^^^ +# +# source://prism//lib/prism/node.rb#5570 +class Prism::ConstantTargetNode < ::Prism::Node + # def initialize: (Symbol name, Location location) -> void + # + # @return [ConstantTargetNode] a new instance of ConstantTargetNode + # + # source://prism//lib/prism/node.rb#5572 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } + def initialize(source, name, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#5649 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#5579 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#5584 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#5594 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#5589 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?location: Location) -> ConstantTargetNode + # + # source://prism//lib/prism/node.rb#5599 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::ConstantTargetNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#5584 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#5607 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # Returns the full name of this constant. For example: "Foo" + # + # source://prism//lib/prism/node_ext.rb#246 + sig { returns(String) } + def full_name; end + + # Returns the list of parts for the full name of this constant. + # For example: [:Foo] + # + # source://prism//lib/prism/node_ext.rb#241 + sig { returns(T::Array[Symbol]) } + def full_name_parts; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#5615 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#5612 + sig { returns(Symbol) } + def name; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#5633 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#5643 + def type; end + end +end + +# Represents writing to a constant. +# +# Foo = 1 +# ^^^^^^^ +# +# source://prism//lib/prism/node.rb#5659 +class Prism::ConstantWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void + # + # @return [ConstantWriteNode] a new instance of ConstantWriteNode + # + # source://prism//lib/prism/node.rb#5661 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, value, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#5779 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#5671 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#5676 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#5686 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#5681 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> ConstantWriteNode + # + # source://prism//lib/prism/node.rb#5691 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::ConstantWriteNode) + end + def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#5676 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#5699 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # Returns the full name of this constant. For example: "Foo" + # + # source://prism//lib/prism/node_ext.rb#146 + sig { returns(String) } + def full_name; end + + # Returns the list of parts for the full name of this constant. + # For example: [:Foo] + # + # source://prism//lib/prism/node_ext.rb#141 + sig { returns(T::Array[Symbol]) } + def full_name_parts; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#5745 + 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` + # + # source://prism//lib/prism/node.rb#5708 + sig { returns(Symbol) } + def name; end + + # The location of the constant name. + # + # FOO = 1 + # ^^^ + # + # source://prism//lib/prism/node.rb#5714 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#5740 + sig { returns(String) } + def operator; end + + # The location of the `=` operator. + # + # FOO = :bar + # ^ + # + # source://prism//lib/prism/node.rb#5733 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#5763 + 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 + # ^^^^^^^^^ + # + # source://prism//lib/prism/node.rb#5727 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#5773 + def type; end + 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( +# [ +# Prism::IntegerNode.new( +# Prism::IntegerBaseFlags::DECIMAL, +# 1, +# Prism::Location.new(source, 1, 1), +# source +# ) +# ], +# Prism::Location.new(source, 0, 1), +# Prism::Location.new(source, 2, 1), +# source +# ) +# +# you could instead write: +# +# source = Prism::Source.for("[1]") +# +# ArrayNode( +# IntegerNode(Prism::IntegerBaseFlags::DECIMAL, 1, Location(source, 1, 1)), source), +# Location(source, 0, 1), +# Location(source, 2, 1), +# source +# ) +# +# This is mostly helpful in the context of writing tests, but can also be used +# to generate trees programmatically. +# +# source://prism//lib/prism/dsl.rb#42 +module Prism::DSL + private + + # Create a new AliasGlobalVariableNode node + # + # source://prism//lib/prism/dsl.rb#51 + def AliasGlobalVariableNode(new_name, old_name, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new AliasMethodNode node + # + # source://prism//lib/prism/dsl.rb#56 + def AliasMethodNode(new_name, old_name, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new AlternationPatternNode node + # + # source://prism//lib/prism/dsl.rb#61 + def AlternationPatternNode(left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new AndNode node + # + # source://prism//lib/prism/dsl.rb#66 + def AndNode(left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ArgumentsNode node + # + # source://prism//lib/prism/dsl.rb#71 + def ArgumentsNode(flags, arguments, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ArrayNode node + # + # source://prism//lib/prism/dsl.rb#76 + def ArrayNode(flags, elements, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ArrayPatternNode node + # + # source://prism//lib/prism/dsl.rb#81 + def ArrayPatternNode(constant, requireds, rest, posts, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new AssocNode node + # + # source://prism//lib/prism/dsl.rb#86 + def AssocNode(key, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new AssocSplatNode node + # + # source://prism//lib/prism/dsl.rb#91 + def AssocSplatNode(value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new BackReferenceReadNode node + # + # source://prism//lib/prism/dsl.rb#96 + def BackReferenceReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new BeginNode node + # + # source://prism//lib/prism/dsl.rb#101 + def BeginNode(begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new BlockArgumentNode node + # + # source://prism//lib/prism/dsl.rb#106 + def BlockArgumentNode(expression, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new BlockLocalVariableNode node + # + # source://prism//lib/prism/dsl.rb#111 + def BlockLocalVariableNode(flags, name, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new BlockNode node + # + # source://prism//lib/prism/dsl.rb#116 + def BlockNode(locals, parameters, body, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new BlockParameterNode node + # + # source://prism//lib/prism/dsl.rb#121 + def BlockParameterNode(flags, name, name_loc, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new BlockParametersNode node + # + # source://prism//lib/prism/dsl.rb#126 + def BlockParametersNode(parameters, locals, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new BreakNode node + # + # source://prism//lib/prism/dsl.rb#131 + def BreakNode(arguments, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new CallAndWriteNode node + # + # source://prism//lib/prism/dsl.rb#136 + def CallAndWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new CallNode node + # + # source://prism//lib/prism/dsl.rb#141 + def CallNode(flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new CallOperatorWriteNode node + # + # source://prism//lib/prism/dsl.rb#146 + def CallOperatorWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, binary_operator, binary_operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new CallOrWriteNode node + # + # source://prism//lib/prism/dsl.rb#151 + def CallOrWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new CallTargetNode node + # + # source://prism//lib/prism/dsl.rb#156 + def CallTargetNode(flags, receiver, call_operator_loc, name, message_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new CapturePatternNode node + # + # source://prism//lib/prism/dsl.rb#161 + def CapturePatternNode(value, target, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new CaseMatchNode node + # + # source://prism//lib/prism/dsl.rb#166 + def CaseMatchNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new CaseNode node + # + # source://prism//lib/prism/dsl.rb#171 + def CaseNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ClassNode node + # + # source://prism//lib/prism/dsl.rb#176 + def ClassNode(locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ClassVariableAndWriteNode node + # + # source://prism//lib/prism/dsl.rb#181 + def ClassVariableAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ClassVariableOperatorWriteNode node + # + # source://prism//lib/prism/dsl.rb#186 + def ClassVariableOperatorWriteNode(name, name_loc, binary_operator_loc, value, binary_operator, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ClassVariableOrWriteNode node + # + # source://prism//lib/prism/dsl.rb#191 + def ClassVariableOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ClassVariableReadNode node + # + # source://prism//lib/prism/dsl.rb#196 + def ClassVariableReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ClassVariableTargetNode node + # + # source://prism//lib/prism/dsl.rb#201 + def ClassVariableTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ClassVariableWriteNode node + # + # source://prism//lib/prism/dsl.rb#206 + def ClassVariableWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ConstantAndWriteNode node + # + # source://prism//lib/prism/dsl.rb#211 + def ConstantAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ConstantOperatorWriteNode node + # + # source://prism//lib/prism/dsl.rb#216 + def ConstantOperatorWriteNode(name, name_loc, binary_operator_loc, value, binary_operator, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ConstantOrWriteNode node + # + # source://prism//lib/prism/dsl.rb#221 + def ConstantOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ConstantPathAndWriteNode node + # + # source://prism//lib/prism/dsl.rb#226 + def ConstantPathAndWriteNode(target, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ConstantPathNode node + # + # source://prism//lib/prism/dsl.rb#231 + def ConstantPathNode(parent, name, delimiter_loc, name_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ConstantPathOperatorWriteNode node + # + # source://prism//lib/prism/dsl.rb#236 + def ConstantPathOperatorWriteNode(target, binary_operator_loc, value, binary_operator, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ConstantPathOrWriteNode node + # + # source://prism//lib/prism/dsl.rb#241 + def ConstantPathOrWriteNode(target, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ConstantPathTargetNode node + # + # source://prism//lib/prism/dsl.rb#246 + def ConstantPathTargetNode(parent, name, delimiter_loc, name_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ConstantPathWriteNode node + # + # source://prism//lib/prism/dsl.rb#251 + def ConstantPathWriteNode(target, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ConstantReadNode node + # + # source://prism//lib/prism/dsl.rb#256 + def ConstantReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ConstantTargetNode node + # + # source://prism//lib/prism/dsl.rb#261 + def ConstantTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ConstantWriteNode node + # + # source://prism//lib/prism/dsl.rb#266 + def ConstantWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new DefNode node + # + # source://prism//lib/prism/dsl.rb#271 + def DefNode(name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new DefinedNode node + # + # source://prism//lib/prism/dsl.rb#276 + def DefinedNode(lparen_loc, value, rparen_loc, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ElseNode node + # + # source://prism//lib/prism/dsl.rb#281 + def ElseNode(else_keyword_loc, statements, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new EmbeddedStatementsNode node + # + # source://prism//lib/prism/dsl.rb#286 + def EmbeddedStatementsNode(opening_loc, statements, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new EmbeddedVariableNode node + # + # source://prism//lib/prism/dsl.rb#291 + def EmbeddedVariableNode(operator_loc, variable, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new EnsureNode node + # + # source://prism//lib/prism/dsl.rb#296 + def EnsureNode(ensure_keyword_loc, statements, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new FalseNode node + # + # source://prism//lib/prism/dsl.rb#301 + def FalseNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new FindPatternNode node + # + # source://prism//lib/prism/dsl.rb#306 + def FindPatternNode(constant, left, requireds, right, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new FlipFlopNode node + # + # source://prism//lib/prism/dsl.rb#311 + def FlipFlopNode(flags, left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new FloatNode node + # + # source://prism//lib/prism/dsl.rb#316 + def FloatNode(value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ForNode node + # + # source://prism//lib/prism/dsl.rb#321 + def ForNode(index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ForwardingArgumentsNode node + # + # source://prism//lib/prism/dsl.rb#326 + def ForwardingArgumentsNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ForwardingParameterNode node + # + # source://prism//lib/prism/dsl.rb#331 + def ForwardingParameterNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ForwardingSuperNode node + # + # source://prism//lib/prism/dsl.rb#336 + def ForwardingSuperNode(block, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new GlobalVariableAndWriteNode node + # + # source://prism//lib/prism/dsl.rb#341 + def GlobalVariableAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new GlobalVariableOperatorWriteNode node + # + # source://prism//lib/prism/dsl.rb#346 + def GlobalVariableOperatorWriteNode(name, name_loc, binary_operator_loc, value, binary_operator, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new GlobalVariableOrWriteNode node + # + # source://prism//lib/prism/dsl.rb#351 + def GlobalVariableOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new GlobalVariableReadNode node + # + # source://prism//lib/prism/dsl.rb#356 + def GlobalVariableReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new GlobalVariableTargetNode node + # + # source://prism//lib/prism/dsl.rb#361 + def GlobalVariableTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new GlobalVariableWriteNode node + # + # source://prism//lib/prism/dsl.rb#366 + def GlobalVariableWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new HashNode node + # + # source://prism//lib/prism/dsl.rb#371 + def HashNode(opening_loc, elements, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new HashPatternNode node + # + # source://prism//lib/prism/dsl.rb#376 + def HashPatternNode(constant, elements, rest, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new IfNode node + # + # source://prism//lib/prism/dsl.rb#381 + def IfNode(if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ImaginaryNode node + # + # source://prism//lib/prism/dsl.rb#386 + def ImaginaryNode(numeric, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ImplicitNode node + # + # source://prism//lib/prism/dsl.rb#391 + def ImplicitNode(value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ImplicitRestNode node + # + # source://prism//lib/prism/dsl.rb#396 + def ImplicitRestNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new InNode node + # + # source://prism//lib/prism/dsl.rb#401 + def InNode(pattern, statements, in_loc, then_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new IndexAndWriteNode node + # + # source://prism//lib/prism/dsl.rb#406 + def IndexAndWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new IndexOperatorWriteNode node + # + # source://prism//lib/prism/dsl.rb#411 + def IndexOperatorWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new IndexOrWriteNode node + # + # source://prism//lib/prism/dsl.rb#416 + def IndexOrWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new IndexTargetNode node + # + # source://prism//lib/prism/dsl.rb#421 + def IndexTargetNode(flags, receiver, opening_loc, arguments, closing_loc, block, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new InstanceVariableAndWriteNode node + # + # source://prism//lib/prism/dsl.rb#426 + def InstanceVariableAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new InstanceVariableOperatorWriteNode node + # + # source://prism//lib/prism/dsl.rb#431 + def InstanceVariableOperatorWriteNode(name, name_loc, binary_operator_loc, value, binary_operator, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new InstanceVariableOrWriteNode node + # + # source://prism//lib/prism/dsl.rb#436 + def InstanceVariableOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new InstanceVariableReadNode node + # + # source://prism//lib/prism/dsl.rb#441 + def InstanceVariableReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new InstanceVariableTargetNode node + # + # source://prism//lib/prism/dsl.rb#446 + def InstanceVariableTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new InstanceVariableWriteNode node + # + # source://prism//lib/prism/dsl.rb#451 + def InstanceVariableWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new IntegerNode node + # + # source://prism//lib/prism/dsl.rb#456 + def IntegerNode(flags, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new InterpolatedMatchLastLineNode node + # + # source://prism//lib/prism/dsl.rb#461 + def InterpolatedMatchLastLineNode(flags, opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new InterpolatedRegularExpressionNode node + # + # source://prism//lib/prism/dsl.rb#466 + def InterpolatedRegularExpressionNode(flags, opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new InterpolatedStringNode node + # + # source://prism//lib/prism/dsl.rb#471 + def InterpolatedStringNode(flags, opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new InterpolatedSymbolNode node + # + # source://prism//lib/prism/dsl.rb#476 + def InterpolatedSymbolNode(opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new InterpolatedXStringNode node + # + # source://prism//lib/prism/dsl.rb#481 + def InterpolatedXStringNode(opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ItLocalVariableReadNode node + # + # source://prism//lib/prism/dsl.rb#486 + def ItLocalVariableReadNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ItParametersNode node + # + # source://prism//lib/prism/dsl.rb#491 + def ItParametersNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new KeywordHashNode node + # + # source://prism//lib/prism/dsl.rb#496 + def KeywordHashNode(flags, elements, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new KeywordRestParameterNode node + # + # source://prism//lib/prism/dsl.rb#501 + def KeywordRestParameterNode(flags, name, name_loc, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new LambdaNode node + # + # source://prism//lib/prism/dsl.rb#506 + def LambdaNode(locals, operator_loc, opening_loc, closing_loc, parameters, body, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new LocalVariableAndWriteNode node + # + # source://prism//lib/prism/dsl.rb#511 + def LocalVariableAndWriteNode(name_loc, operator_loc, value, name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new LocalVariableOperatorWriteNode node + # + # source://prism//lib/prism/dsl.rb#516 + def LocalVariableOperatorWriteNode(name_loc, binary_operator_loc, value, name, binary_operator, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new LocalVariableOrWriteNode node + # + # source://prism//lib/prism/dsl.rb#521 + def LocalVariableOrWriteNode(name_loc, operator_loc, value, name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new LocalVariableReadNode node + # + # source://prism//lib/prism/dsl.rb#526 + def LocalVariableReadNode(name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new LocalVariableTargetNode node + # + # source://prism//lib/prism/dsl.rb#531 + def LocalVariableTargetNode(name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new LocalVariableWriteNode node + # + # source://prism//lib/prism/dsl.rb#536 + def LocalVariableWriteNode(name, depth, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new Location object + # + # source://prism//lib/prism/dsl.rb#46 + def Location(source = T.unsafe(nil), start_offset = T.unsafe(nil), length = T.unsafe(nil)); end + + # Create a new MatchLastLineNode node + # + # source://prism//lib/prism/dsl.rb#541 + def MatchLastLineNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new MatchPredicateNode node + # + # source://prism//lib/prism/dsl.rb#546 + def MatchPredicateNode(value, pattern, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new MatchRequiredNode node + # + # source://prism//lib/prism/dsl.rb#551 + def MatchRequiredNode(value, pattern, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new MatchWriteNode node + # + # source://prism//lib/prism/dsl.rb#556 + def MatchWriteNode(call, targets, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new MissingNode node + # + # source://prism//lib/prism/dsl.rb#561 + def MissingNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ModuleNode node + # + # source://prism//lib/prism/dsl.rb#566 + def ModuleNode(locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new MultiTargetNode node + # + # source://prism//lib/prism/dsl.rb#571 + def MultiTargetNode(lefts, rest, rights, lparen_loc, rparen_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new MultiWriteNode node + # + # source://prism//lib/prism/dsl.rb#576 + def MultiWriteNode(lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new NextNode node + # + # source://prism//lib/prism/dsl.rb#581 + def NextNode(arguments, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new NilNode node + # + # source://prism//lib/prism/dsl.rb#586 + def NilNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new NoKeywordsParameterNode node + # + # source://prism//lib/prism/dsl.rb#591 + def NoKeywordsParameterNode(operator_loc, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new NumberedParametersNode node + # + # source://prism//lib/prism/dsl.rb#596 + def NumberedParametersNode(maximum, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new NumberedReferenceReadNode node + # + # source://prism//lib/prism/dsl.rb#601 + def NumberedReferenceReadNode(number, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new OptionalKeywordParameterNode node + # + # source://prism//lib/prism/dsl.rb#606 + def OptionalKeywordParameterNode(flags, name, name_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new OptionalParameterNode node + # + # source://prism//lib/prism/dsl.rb#611 + def OptionalParameterNode(flags, name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new OrNode node + # + # source://prism//lib/prism/dsl.rb#616 + def OrNode(left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ParametersNode node + # + # source://prism//lib/prism/dsl.rb#621 + def ParametersNode(requireds, optionals, rest, posts, keywords, keyword_rest, block, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ParenthesesNode node + # + # source://prism//lib/prism/dsl.rb#626 + def ParenthesesNode(body, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new PinnedExpressionNode node + # + # source://prism//lib/prism/dsl.rb#631 + def PinnedExpressionNode(expression, operator_loc, lparen_loc, rparen_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new PinnedVariableNode node + # + # source://prism//lib/prism/dsl.rb#636 + def PinnedVariableNode(variable, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new PostExecutionNode node + # + # source://prism//lib/prism/dsl.rb#641 + def PostExecutionNode(statements, keyword_loc, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new PreExecutionNode node + # + # source://prism//lib/prism/dsl.rb#646 + def PreExecutionNode(statements, keyword_loc, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ProgramNode node + # + # source://prism//lib/prism/dsl.rb#651 + def ProgramNode(locals, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new RangeNode node + # + # source://prism//lib/prism/dsl.rb#656 + def RangeNode(flags, left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new RationalNode node + # + # source://prism//lib/prism/dsl.rb#661 + def RationalNode(flags, numerator, denominator, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new RedoNode node + # + # source://prism//lib/prism/dsl.rb#666 + def RedoNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new RegularExpressionNode node + # + # source://prism//lib/prism/dsl.rb#671 + def RegularExpressionNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new RequiredKeywordParameterNode node + # + # source://prism//lib/prism/dsl.rb#676 + def RequiredKeywordParameterNode(flags, name, name_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new RequiredParameterNode node + # + # source://prism//lib/prism/dsl.rb#681 + def RequiredParameterNode(flags, name, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new RescueModifierNode node + # + # source://prism//lib/prism/dsl.rb#686 + def RescueModifierNode(expression, keyword_loc, rescue_expression, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new RescueNode node + # + # source://prism//lib/prism/dsl.rb#691 + def RescueNode(keyword_loc, exceptions, operator_loc, reference, statements, consequent, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new RestParameterNode node + # + # source://prism//lib/prism/dsl.rb#696 + def RestParameterNode(flags, name, name_loc, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new RetryNode node + # + # source://prism//lib/prism/dsl.rb#701 + def RetryNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ReturnNode node + # + # source://prism//lib/prism/dsl.rb#706 + def ReturnNode(flags, keyword_loc, arguments, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new SelfNode node + # + # source://prism//lib/prism/dsl.rb#711 + def SelfNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ShareableConstantNode node + # + # source://prism//lib/prism/dsl.rb#716 + def ShareableConstantNode(flags, write, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new SingletonClassNode node + # + # source://prism//lib/prism/dsl.rb#721 + def SingletonClassNode(locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new SourceEncodingNode node + # + # source://prism//lib/prism/dsl.rb#726 + def SourceEncodingNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new SourceFileNode node + # + # source://prism//lib/prism/dsl.rb#731 + def SourceFileNode(flags, filepath, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new SourceLineNode node + # + # source://prism//lib/prism/dsl.rb#736 + def SourceLineNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new SplatNode node + # + # source://prism//lib/prism/dsl.rb#741 + def SplatNode(operator_loc, expression, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new StatementsNode node + # + # source://prism//lib/prism/dsl.rb#746 + def StatementsNode(body, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new StringNode node + # + # source://prism//lib/prism/dsl.rb#751 + def StringNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new SuperNode node + # + # source://prism//lib/prism/dsl.rb#756 + def SuperNode(keyword_loc, lparen_loc, arguments, rparen_loc, block, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new SymbolNode node + # + # source://prism//lib/prism/dsl.rb#761 + def SymbolNode(flags, opening_loc, value_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new TrueNode node + # + # source://prism//lib/prism/dsl.rb#766 + def TrueNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new UndefNode node + # + # source://prism//lib/prism/dsl.rb#771 + def UndefNode(names, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new UnlessNode node + # + # source://prism//lib/prism/dsl.rb#776 + def UnlessNode(keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new UntilNode node + # + # source://prism//lib/prism/dsl.rb#781 + def UntilNode(flags, keyword_loc, closing_loc, predicate, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new WhenNode node + # + # source://prism//lib/prism/dsl.rb#786 + def WhenNode(keyword_loc, conditions, then_keyword_loc, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new WhileNode node + # + # source://prism//lib/prism/dsl.rb#791 + def WhileNode(flags, keyword_loc, closing_loc, predicate, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new XStringNode node + # + # source://prism//lib/prism/dsl.rb#796 + def XStringNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new YieldNode node + # + # source://prism//lib/prism/dsl.rb#801 + def YieldNode(keyword_loc, lparen_loc, arguments, rparen_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end +end + +# Represents a method definition. +# +# def method +# end +# ^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#5793 +class Prism::DefNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Prism::node? receiver, ParametersNode? parameters, Prism::node? body, Array[Symbol] locals, Location def_keyword_loc, Location? operator_loc, Location? lparen_loc, Location? rparen_loc, Location? equal_loc, Location? end_keyword_loc, Location location) -> void + # + # @return [DefNode] a new instance of DefNode + # + # source://prism//lib/prism/node.rb#5795 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + receiver: T.nilable(Prism::Node), + parameters: T.nilable(Prism::ParametersNode), + body: T.nilable(Prism::Node), + 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), + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#6008 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#5813 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader body: Prism::node? + # + # source://prism//lib/prism/node.rb#5866 + sig { returns(T.nilable(Prism::Node)) } + def body; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#5818 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#5832 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#5823 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?name_loc: Location, ?receiver: Prism::node?, ?parameters: ParametersNode?, ?body: Prism::node?, ?locals: Array[Symbol], ?def_keyword_loc: Location, ?operator_loc: Location?, ?lparen_loc: Location?, ?rparen_loc: Location?, ?equal_loc: Location?, ?end_keyword_loc: Location?, ?location: Location) -> DefNode + # + # source://prism//lib/prism/node.rb#5837 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + receiver: T.nilable(Prism::Node), + parameters: T.nilable(Prism::ParametersNode), + body: T.nilable(Prism::Node), + 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), + location: Prism::Location + ).returns(Prism::DefNode) + end + def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), receiver: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), locals: T.unsafe(nil), def_keyword_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), equal_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#5818 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, receiver: Prism::node?, parameters: ParametersNode?, body: Prism::node?, locals: Array[Symbol], def_keyword_loc: Location, operator_loc: Location?, lparen_loc: Location?, rparen_loc: Location?, equal_loc: Location?, end_keyword_loc: Location?, location: Location } + # + # source://prism//lib/prism/node.rb#5845 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def def_keyword: () -> String + # + # source://prism//lib/prism/node.rb#5944 + sig { returns(String) } + def def_keyword; end + + # attr_reader def_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#5872 + sig { returns(Prism::Location) } + def def_keyword_loc; end + + # def end_keyword: () -> String? + # + # source://prism//lib/prism/node.rb#5969 + sig { returns(T.nilable(String)) } + def end_keyword; end + + # attr_reader end_keyword_loc: Location? + # + # source://prism//lib/prism/node.rb#5931 + sig { returns(T.nilable(Prism::Location)) } + def end_keyword_loc; end + + # def equal: () -> String? + # + # source://prism//lib/prism/node.rb#5964 + sig { returns(T.nilable(String)) } + def equal; end + + # attr_reader equal_loc: Location? + # + # source://prism//lib/prism/node.rb#5918 + sig { returns(T.nilable(Prism::Location)) } + def equal_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#5974 + sig { override.returns(String) } + def inspect; end + + # attr_reader locals: Array[Symbol] + # + # source://prism//lib/prism/node.rb#5869 + sig { returns(T::Array[Symbol]) } + def locals; end + + # def lparen: () -> String? + # + # source://prism//lib/prism/node.rb#5954 + sig { returns(T.nilable(String)) } + def lparen; end + + # attr_reader lparen_loc: Location? + # + # source://prism//lib/prism/node.rb#5892 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#5850 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#5853 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String? + # + # source://prism//lib/prism/node.rb#5949 + sig { returns(T.nilable(String)) } + def operator; end + + # attr_reader operator_loc: Location? + # + # source://prism//lib/prism/node.rb#5879 + sig { returns(T.nilable(Prism::Location)) } + def operator_loc; end + + # attr_reader parameters: ParametersNode? + # + # source://prism//lib/prism/node.rb#5863 + sig { returns(T.nilable(Prism::ParametersNode)) } + def parameters; end + + # attr_reader receiver: Prism::node? + # + # source://prism//lib/prism/node.rb#5860 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def rparen: () -> String? + # + # source://prism//lib/prism/node.rb#5959 + sig { returns(T.nilable(String)) } + def rparen; end + + # attr_reader rparen_loc: Location? + # + # source://prism//lib/prism/node.rb#5905 + sig { returns(T.nilable(Prism::Location)) } + def rparen_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#5992 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#6002 + def type; end + end +end + +# Represents the use of the `defined?` keyword. +# +# defined?(a) +# ^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#6030 +class Prism::DefinedNode < ::Prism::Node + # def initialize: (Location? lparen_loc, Prism::node value, Location? rparen_loc, Location keyword_loc, Location location) -> void + # + # @return [DefinedNode] a new instance of DefinedNode + # + # source://prism//lib/prism/node.rb#6032 + sig do + params( + source: Prism::Source, + lparen_loc: T.nilable(Prism::Location), + value: Prism::Node, + rparen_loc: T.nilable(Prism::Location), + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, lparen_loc, value, rparen_loc, keyword_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#6160 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#6042 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#6047 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#6057 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#6052 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?lparen_loc: Location?, ?value: Prism::node, ?rparen_loc: Location?, ?keyword_loc: Location, ?location: Location) -> DefinedNode + # + # source://prism//lib/prism/node.rb#6062 + sig do + params( + lparen_loc: T.nilable(Prism::Location), + value: Prism::Node, + rparen_loc: T.nilable(Prism::Location), + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::DefinedNode) + end + def copy(lparen_loc: T.unsafe(nil), value: T.unsafe(nil), rparen_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#6047 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { lparen_loc: Location?, value: Prism::node, rparen_loc: Location?, keyword_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#6070 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#6126 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#6121 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#6104 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def lparen: () -> String? + # + # source://prism//lib/prism/node.rb#6111 + sig { returns(T.nilable(String)) } + def lparen; end + + # attr_reader lparen_loc: Location? + # + # source://prism//lib/prism/node.rb#6075 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end + + # def rparen: () -> String? + # + # source://prism//lib/prism/node.rb#6116 + sig { returns(T.nilable(String)) } + def rparen; end + + # attr_reader rparen_loc: Location? + # + # source://prism//lib/prism/node.rb#6091 + sig { returns(T.nilable(Prism::Location)) } + def rparen_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#6144 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#6088 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#6154 + def type; end + end +end + +# source://prism//lib/prism/desugar_compiler.rb#4 +class Prism::DesugarAndWriteNode + # @return [DesugarAndWriteNode] a new instance of DesugarAndWriteNode + # + # source://prism//lib/prism/desugar_compiler.rb#7 + def initialize(node, source, read_class, write_class, *arguments); end + + # Returns the value of attribute arguments. + # + # source://prism//lib/prism/desugar_compiler.rb#5 + def arguments; end + + # Desugar `x &&= y` to `x && x = y` + # + # source://prism//lib/prism/desugar_compiler.rb#16 + def compile; end + + # Returns the value of attribute node. + # + # source://prism//lib/prism/desugar_compiler.rb#5 + def node; end + + # Returns the value of attribute read_class. + # + # source://prism//lib/prism/desugar_compiler.rb#5 + def read_class; end + + # Returns the value of attribute source. + # + # source://prism//lib/prism/desugar_compiler.rb#5 + def source; end + + # Returns the value of attribute write_class. + # + # source://prism//lib/prism/desugar_compiler.rb#5 + 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. +# +# source://prism//lib/prism/desugar_compiler.rb#218 +class Prism::DesugarCompiler < ::Prism::MutationCompiler + # @@foo &&= bar + # + # becomes + # + # @@foo && @@foo = bar + # + # source://prism//lib/prism/desugar_compiler.rb#224 + def visit_class_variable_and_write_node(node); end + + # @@foo += bar + # + # becomes + # + # @@foo = @@foo + bar + # + # source://prism//lib/prism/desugar_compiler.rb#242 + def visit_class_variable_operator_write_node(node); end + + # @@foo ||= bar + # + # becomes + # + # defined?(@@foo) ? @@foo : @@foo = bar + # + # source://prism//lib/prism/desugar_compiler.rb#233 + def visit_class_variable_or_write_node(node); end + + # Foo &&= bar + # + # becomes + # + # Foo && Foo = bar + # + # source://prism//lib/prism/desugar_compiler.rb#251 + def visit_constant_and_write_node(node); end + + # Foo += bar + # + # becomes + # + # Foo = Foo + bar + # + # source://prism//lib/prism/desugar_compiler.rb#269 + def visit_constant_operator_write_node(node); end + + # Foo ||= bar + # + # becomes + # + # defined?(Foo) ? Foo : Foo = bar + # + # source://prism//lib/prism/desugar_compiler.rb#260 + def visit_constant_or_write_node(node); end + + # $foo &&= bar + # + # becomes + # + # $foo && $foo = bar + # + # source://prism//lib/prism/desugar_compiler.rb#278 + def visit_global_variable_and_write_node(node); end + + # $foo += bar + # + # becomes + # + # $foo = $foo + bar + # + # source://prism//lib/prism/desugar_compiler.rb#296 + def visit_global_variable_operator_write_node(node); end + + # $foo ||= bar + # + # becomes + # + # defined?($foo) ? $foo : $foo = bar + # + # source://prism//lib/prism/desugar_compiler.rb#287 + def visit_global_variable_or_write_node(node); end + + # becomes + # + # source://prism//lib/prism/desugar_compiler.rb#305 + def visit_instance_variable_and_write_node(node); end + + # becomes + # + # source://prism//lib/prism/desugar_compiler.rb#323 + def visit_instance_variable_operator_write_node(node); end + + # becomes + # + # source://prism//lib/prism/desugar_compiler.rb#314 + def visit_instance_variable_or_write_node(node); end + + # foo &&= bar + # + # becomes + # + # foo && foo = bar + # + # source://prism//lib/prism/desugar_compiler.rb#332 + def visit_local_variable_and_write_node(node); end + + # foo += bar + # + # becomes + # + # foo = foo + bar + # + # source://prism//lib/prism/desugar_compiler.rb#350 + def visit_local_variable_operator_write_node(node); end + + # foo ||= bar + # + # becomes + # + # foo || foo = bar + # + # source://prism//lib/prism/desugar_compiler.rb#341 + def visit_local_variable_or_write_node(node); end +end + +# source://prism//lib/prism/desugar_compiler.rb#63 +class Prism::DesugarOperatorWriteNode + # @return [DesugarOperatorWriteNode] a new instance of DesugarOperatorWriteNode + # + # source://prism//lib/prism/desugar_compiler.rb#66 + def initialize(node, source, read_class, write_class, *arguments); end + + # Returns the value of attribute arguments. + # + # source://prism//lib/prism/desugar_compiler.rb#64 + def arguments; end + + # Desugar `x += y` to `x = x + y` + # + # source://prism//lib/prism/desugar_compiler.rb#75 + def compile; end + + # Returns the value of attribute node. + # + # source://prism//lib/prism/desugar_compiler.rb#64 + def node; end + + # Returns the value of attribute read_class. + # + # source://prism//lib/prism/desugar_compiler.rb#64 + def read_class; end + + # Returns the value of attribute source. + # + # source://prism//lib/prism/desugar_compiler.rb#64 + def source; end + + # Returns the value of attribute write_class. + # + # source://prism//lib/prism/desugar_compiler.rb#64 + def write_class; end +end + +# source://prism//lib/prism/desugar_compiler.rb#27 +class Prism::DesugarOrWriteDefinedNode + # @return [DesugarOrWriteDefinedNode] a new instance of DesugarOrWriteDefinedNode + # + # source://prism//lib/prism/desugar_compiler.rb#30 + def initialize(node, source, read_class, write_class, *arguments); end + + # Returns the value of attribute arguments. + # + # source://prism//lib/prism/desugar_compiler.rb#28 + def arguments; end + + # Desugar `x ||= y` to `defined?(x) ? x : x = y` + # + # source://prism//lib/prism/desugar_compiler.rb#39 + def compile; end + + # Returns the value of attribute node. + # + # source://prism//lib/prism/desugar_compiler.rb#28 + def node; end + + # Returns the value of attribute read_class. + # + # source://prism//lib/prism/desugar_compiler.rb#28 + def read_class; end + + # Returns the value of attribute source. + # + # source://prism//lib/prism/desugar_compiler.rb#28 + def source; end + + # Returns the value of attribute write_class. + # + # source://prism//lib/prism/desugar_compiler.rb#28 + def write_class; end +end + +# source://prism//lib/prism/desugar_compiler.rb#101 +class Prism::DesugarOrWriteNode + # @return [DesugarOrWriteNode] a new instance of DesugarOrWriteNode + # + # source://prism//lib/prism/desugar_compiler.rb#104 + def initialize(node, source, read_class, write_class, *arguments); end + + # Returns the value of attribute arguments. + # + # source://prism//lib/prism/desugar_compiler.rb#102 + def arguments; end + + # Desugar `x ||= y` to `x || x = y` + # + # source://prism//lib/prism/desugar_compiler.rb#113 + def compile; end + + # Returns the value of attribute node. + # + # source://prism//lib/prism/desugar_compiler.rb#102 + def node; end + + # Returns the value of attribute read_class. + # + # source://prism//lib/prism/desugar_compiler.rb#102 + def read_class; end + + # Returns the value of attribute source. + # + # source://prism//lib/prism/desugar_compiler.rb#102 + def source; end + + # Returns the value of attribute write_class. + # + # source://prism//lib/prism/desugar_compiler.rb#102 + 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 +# +# dispatcher = 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) +# +# source://prism//lib/prism/dispatcher.rb#41 +class Prism::Dispatcher < ::Prism::Visitor + # Initialize a new dispatcher. + # + # @return [Dispatcher] a new instance of Dispatcher + # + # source://prism//lib/prism/dispatcher.rb#46 + def initialize; end + + # Walks `root` dispatching events to all registered listeners. + # + # def dispatch: (Node) -> void + # + # source://prism//lib/prism/visitor.rb#17 + def dispatch(node); end + + # Dispatches a single event for `node` to all registered listeners. + # + # def dispatch_once: (Node) -> void + # + # source://prism//lib/prism/dispatcher.rb#65 + def dispatch_once(node); end + + # attr_reader listeners: Hash[Symbol, Array[Listener]] + # + # source://prism//lib/prism/dispatcher.rb#43 + def listeners; end + + # Register a listener for one or more events. + # + # def register: (Listener, *Symbol) -> void + # + # source://prism//lib/prism/dispatcher.rb#53 + def register(listener, *events); end + + # Dispatch enter and leave events for AliasGlobalVariableNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#71 + def visit_alias_global_variable_node(node); end + + # Dispatch enter and leave events for AliasMethodNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#79 + def visit_alias_method_node(node); end + + # Dispatch enter and leave events for AlternationPatternNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#87 + def visit_alternation_pattern_node(node); end + + # Dispatch enter and leave events for AndNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#95 + def visit_and_node(node); end + + # Dispatch enter and leave events for ArgumentsNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#103 + def visit_arguments_node(node); end + + # Dispatch enter and leave events for ArrayNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#111 + def visit_array_node(node); end + + # Dispatch enter and leave events for ArrayPatternNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#119 + def visit_array_pattern_node(node); end + + # Dispatch enter and leave events for AssocNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#127 + def visit_assoc_node(node); end + + # Dispatch enter and leave events for AssocSplatNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#135 + def visit_assoc_splat_node(node); end + + # Dispatch enter and leave events for BackReferenceReadNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#143 + def visit_back_reference_read_node(node); end + + # Dispatch enter and leave events for BeginNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#151 + def visit_begin_node(node); end + + # Dispatch enter and leave events for BlockArgumentNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#159 + def visit_block_argument_node(node); end + + # Dispatch enter and leave events for BlockLocalVariableNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#167 + def visit_block_local_variable_node(node); end + + # Dispatch enter and leave events for BlockNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#175 + def visit_block_node(node); end + + # Dispatch enter and leave events for BlockParameterNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#183 + def visit_block_parameter_node(node); end + + # Dispatch enter and leave events for BlockParametersNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#191 + def visit_block_parameters_node(node); end + + # Dispatch enter and leave events for BreakNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#199 + def visit_break_node(node); end + + # Dispatch enter and leave events for CallAndWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#207 + def visit_call_and_write_node(node); end + + # Dispatch enter and leave events for CallNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#215 + def visit_call_node(node); end + + # Dispatch enter and leave events for CallOperatorWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#223 + def visit_call_operator_write_node(node); end + + # Dispatch enter and leave events for CallOrWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#231 + def visit_call_or_write_node(node); end + + # Dispatch enter and leave events for CallTargetNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#239 + def visit_call_target_node(node); end + + # Dispatch enter and leave events for CapturePatternNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#247 + def visit_capture_pattern_node(node); end + + # Dispatch enter and leave events for CaseMatchNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#255 + def visit_case_match_node(node); end + + # Dispatch enter and leave events for CaseNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#263 + def visit_case_node(node); end + + # Dispatch enter and leave events for ClassNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#271 + def visit_class_node(node); end + + # Dispatch enter and leave events for ClassVariableAndWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#279 + def visit_class_variable_and_write_node(node); end + + # Dispatch enter and leave events for ClassVariableOperatorWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#287 + def visit_class_variable_operator_write_node(node); end + + # Dispatch enter and leave events for ClassVariableOrWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#295 + def visit_class_variable_or_write_node(node); end + + # Dispatch enter and leave events for ClassVariableReadNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#303 + def visit_class_variable_read_node(node); end + + # Dispatch enter and leave events for ClassVariableTargetNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#311 + def visit_class_variable_target_node(node); end + + # Dispatch enter and leave events for ClassVariableWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#319 + def visit_class_variable_write_node(node); end + + # Dispatch enter and leave events for ConstantAndWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#327 + def visit_constant_and_write_node(node); end + + # Dispatch enter and leave events for ConstantOperatorWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#335 + def visit_constant_operator_write_node(node); end + + # Dispatch enter and leave events for ConstantOrWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#343 + def visit_constant_or_write_node(node); end + + # Dispatch enter and leave events for ConstantPathAndWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#351 + def visit_constant_path_and_write_node(node); end + + # Dispatch enter and leave events for ConstantPathNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#359 + def visit_constant_path_node(node); end + + # Dispatch enter and leave events for ConstantPathOperatorWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#367 + def visit_constant_path_operator_write_node(node); end + + # Dispatch enter and leave events for ConstantPathOrWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#375 + def visit_constant_path_or_write_node(node); end + + # Dispatch enter and leave events for ConstantPathTargetNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#383 + def visit_constant_path_target_node(node); end + + # Dispatch enter and leave events for ConstantPathWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#391 + def visit_constant_path_write_node(node); end + + # Dispatch enter and leave events for ConstantReadNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#399 + def visit_constant_read_node(node); end + + # Dispatch enter and leave events for ConstantTargetNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#407 + def visit_constant_target_node(node); end + + # Dispatch enter and leave events for ConstantWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#415 + def visit_constant_write_node(node); end + + # Dispatch enter and leave events for DefNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#423 + def visit_def_node(node); end + + # Dispatch enter and leave events for DefinedNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#431 + def visit_defined_node(node); end + + # Dispatch enter and leave events for ElseNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#439 + def visit_else_node(node); end + + # Dispatch enter and leave events for EmbeddedStatementsNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#447 + def visit_embedded_statements_node(node); end + + # Dispatch enter and leave events for EmbeddedVariableNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#455 + def visit_embedded_variable_node(node); end + + # Dispatch enter and leave events for EnsureNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#463 + def visit_ensure_node(node); end + + # Dispatch enter and leave events for FalseNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#471 + def visit_false_node(node); end + + # Dispatch enter and leave events for FindPatternNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#479 + def visit_find_pattern_node(node); end + + # Dispatch enter and leave events for FlipFlopNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#487 + def visit_flip_flop_node(node); end + + # Dispatch enter and leave events for FloatNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#495 + def visit_float_node(node); end + + # Dispatch enter and leave events for ForNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#503 + def visit_for_node(node); end + + # Dispatch enter and leave events for ForwardingArgumentsNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#511 + def visit_forwarding_arguments_node(node); end + + # Dispatch enter and leave events for ForwardingParameterNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#519 + def visit_forwarding_parameter_node(node); end + + # Dispatch enter and leave events for ForwardingSuperNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#527 + def visit_forwarding_super_node(node); end + + # Dispatch enter and leave events for GlobalVariableAndWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#535 + def visit_global_variable_and_write_node(node); end + + # Dispatch enter and leave events for GlobalVariableOperatorWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#543 + def visit_global_variable_operator_write_node(node); end + + # Dispatch enter and leave events for GlobalVariableOrWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#551 + def visit_global_variable_or_write_node(node); end + + # Dispatch enter and leave events for GlobalVariableReadNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#559 + def visit_global_variable_read_node(node); end + + # Dispatch enter and leave events for GlobalVariableTargetNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#567 + def visit_global_variable_target_node(node); end + + # Dispatch enter and leave events for GlobalVariableWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#575 + def visit_global_variable_write_node(node); end + + # Dispatch enter and leave events for HashNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#583 + def visit_hash_node(node); end + + # Dispatch enter and leave events for HashPatternNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#591 + def visit_hash_pattern_node(node); end + + # Dispatch enter and leave events for IfNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#599 + def visit_if_node(node); end + + # Dispatch enter and leave events for ImaginaryNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#607 + def visit_imaginary_node(node); end + + # Dispatch enter and leave events for ImplicitNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#615 + def visit_implicit_node(node); end + + # Dispatch enter and leave events for ImplicitRestNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#623 + def visit_implicit_rest_node(node); end + + # Dispatch enter and leave events for InNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#631 + def visit_in_node(node); end + + # Dispatch enter and leave events for IndexAndWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#639 + def visit_index_and_write_node(node); end + + # Dispatch enter and leave events for IndexOperatorWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#647 + def visit_index_operator_write_node(node); end + + # Dispatch enter and leave events for IndexOrWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#655 + def visit_index_or_write_node(node); end + + # Dispatch enter and leave events for IndexTargetNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#663 + def visit_index_target_node(node); end + + # Dispatch enter and leave events for InstanceVariableAndWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#671 + def visit_instance_variable_and_write_node(node); end + + # Dispatch enter and leave events for InstanceVariableOperatorWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#679 + def visit_instance_variable_operator_write_node(node); end + + # Dispatch enter and leave events for InstanceVariableOrWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#687 + def visit_instance_variable_or_write_node(node); end + + # Dispatch enter and leave events for InstanceVariableReadNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#695 + def visit_instance_variable_read_node(node); end + + # Dispatch enter and leave events for InstanceVariableTargetNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#703 + def visit_instance_variable_target_node(node); end + + # Dispatch enter and leave events for InstanceVariableWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#711 + def visit_instance_variable_write_node(node); end + + # Dispatch enter and leave events for IntegerNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#719 + def visit_integer_node(node); end + + # Dispatch enter and leave events for InterpolatedMatchLastLineNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#727 + def visit_interpolated_match_last_line_node(node); end + + # Dispatch enter and leave events for InterpolatedRegularExpressionNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#735 + def visit_interpolated_regular_expression_node(node); end + + # Dispatch enter and leave events for InterpolatedStringNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#743 + def visit_interpolated_string_node(node); end + + # Dispatch enter and leave events for InterpolatedSymbolNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#751 + def visit_interpolated_symbol_node(node); end + + # Dispatch enter and leave events for InterpolatedXStringNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#759 + def visit_interpolated_x_string_node(node); end + + # Dispatch enter and leave events for ItLocalVariableReadNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#767 + def visit_it_local_variable_read_node(node); end + + # Dispatch enter and leave events for ItParametersNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#775 + def visit_it_parameters_node(node); end + + # Dispatch enter and leave events for KeywordHashNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#783 + def visit_keyword_hash_node(node); end + + # Dispatch enter and leave events for KeywordRestParameterNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#791 + def visit_keyword_rest_parameter_node(node); end + + # Dispatch enter and leave events for LambdaNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#799 + def visit_lambda_node(node); end + + # Dispatch enter and leave events for LocalVariableAndWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#807 + def visit_local_variable_and_write_node(node); end + + # Dispatch enter and leave events for LocalVariableOperatorWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#815 + def visit_local_variable_operator_write_node(node); end + + # Dispatch enter and leave events for LocalVariableOrWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#823 + def visit_local_variable_or_write_node(node); end + + # Dispatch enter and leave events for LocalVariableReadNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#831 + def visit_local_variable_read_node(node); end + + # Dispatch enter and leave events for LocalVariableTargetNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#839 + def visit_local_variable_target_node(node); end + + # Dispatch enter and leave events for LocalVariableWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#847 + def visit_local_variable_write_node(node); end + + # Dispatch enter and leave events for MatchLastLineNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#855 + def visit_match_last_line_node(node); end + + # Dispatch enter and leave events for MatchPredicateNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#863 + def visit_match_predicate_node(node); end + + # Dispatch enter and leave events for MatchRequiredNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#871 + def visit_match_required_node(node); end + + # Dispatch enter and leave events for MatchWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#879 + def visit_match_write_node(node); end + + # Dispatch enter and leave events for MissingNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#887 + def visit_missing_node(node); end + + # Dispatch enter and leave events for ModuleNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#895 + def visit_module_node(node); end + + # Dispatch enter and leave events for MultiTargetNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#903 + def visit_multi_target_node(node); end + + # Dispatch enter and leave events for MultiWriteNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#911 + def visit_multi_write_node(node); end + + # Dispatch enter and leave events for NextNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#919 + def visit_next_node(node); end + + # Dispatch enter and leave events for NilNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#927 + def visit_nil_node(node); end + + # Dispatch enter and leave events for NoKeywordsParameterNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#935 + def visit_no_keywords_parameter_node(node); end + + # Dispatch enter and leave events for NumberedParametersNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#943 + def visit_numbered_parameters_node(node); end + + # Dispatch enter and leave events for NumberedReferenceReadNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#951 + def visit_numbered_reference_read_node(node); end + + # Dispatch enter and leave events for OptionalKeywordParameterNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#959 + def visit_optional_keyword_parameter_node(node); end + + # Dispatch enter and leave events for OptionalParameterNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#967 + def visit_optional_parameter_node(node); end + + # Dispatch enter and leave events for OrNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#975 + def visit_or_node(node); end + + # Dispatch enter and leave events for ParametersNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#983 + def visit_parameters_node(node); end + + # Dispatch enter and leave events for ParenthesesNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#991 + def visit_parentheses_node(node); end + + # Dispatch enter and leave events for PinnedExpressionNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#999 + def visit_pinned_expression_node(node); end + + # Dispatch enter and leave events for PinnedVariableNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1007 + def visit_pinned_variable_node(node); end + + # Dispatch enter and leave events for PostExecutionNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1015 + def visit_post_execution_node(node); end + + # Dispatch enter and leave events for PreExecutionNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1023 + def visit_pre_execution_node(node); end + + # Dispatch enter and leave events for ProgramNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1031 + def visit_program_node(node); end + + # Dispatch enter and leave events for RangeNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1039 + def visit_range_node(node); end + + # Dispatch enter and leave events for RationalNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1047 + def visit_rational_node(node); end + + # Dispatch enter and leave events for RedoNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1055 + def visit_redo_node(node); end + + # Dispatch enter and leave events for RegularExpressionNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1063 + def visit_regular_expression_node(node); end + + # Dispatch enter and leave events for RequiredKeywordParameterNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1071 + def visit_required_keyword_parameter_node(node); end + + # Dispatch enter and leave events for RequiredParameterNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1079 + def visit_required_parameter_node(node); end + + # Dispatch enter and leave events for RescueModifierNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1087 + def visit_rescue_modifier_node(node); end + + # Dispatch enter and leave events for RescueNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1095 + def visit_rescue_node(node); end + + # Dispatch enter and leave events for RestParameterNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1103 + def visit_rest_parameter_node(node); end + + # Dispatch enter and leave events for RetryNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1111 + def visit_retry_node(node); end + + # Dispatch enter and leave events for ReturnNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1119 + def visit_return_node(node); end + + # Dispatch enter and leave events for SelfNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1127 + def visit_self_node(node); end + + # Dispatch enter and leave events for ShareableConstantNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1135 + def visit_shareable_constant_node(node); end + + # Dispatch enter and leave events for SingletonClassNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1143 + def visit_singleton_class_node(node); end + + # Dispatch enter and leave events for SourceEncodingNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1151 + def visit_source_encoding_node(node); end + + # Dispatch enter and leave events for SourceFileNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1159 + def visit_source_file_node(node); end + + # Dispatch enter and leave events for SourceLineNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1167 + def visit_source_line_node(node); end + + # Dispatch enter and leave events for SplatNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1175 + def visit_splat_node(node); end + + # Dispatch enter and leave events for StatementsNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1183 + def visit_statements_node(node); end + + # Dispatch enter and leave events for StringNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1191 + def visit_string_node(node); end + + # Dispatch enter and leave events for SuperNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1199 + def visit_super_node(node); end + + # Dispatch enter and leave events for SymbolNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1207 + def visit_symbol_node(node); end + + # Dispatch enter and leave events for TrueNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1215 + def visit_true_node(node); end + + # Dispatch enter and leave events for UndefNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1223 + def visit_undef_node(node); end + + # Dispatch enter and leave events for UnlessNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1231 + def visit_unless_node(node); end + + # Dispatch enter and leave events for UntilNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1239 + def visit_until_node(node); end + + # Dispatch enter and leave events for WhenNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1247 + def visit_when_node(node); end + + # Dispatch enter and leave events for WhileNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1255 + def visit_while_node(node); end + + # Dispatch enter and leave events for XStringNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1263 + def visit_x_string_node(node); end + + # Dispatch enter and leave events for YieldNode nodes and continue + # walking the tree. + # + # source://prism//lib/prism/dispatcher.rb#1271 + def visit_yield_node(node); end +end + +# source://prism//lib/prism/dispatcher.rb#1277 +class Prism::Dispatcher::DispatchOnce < ::Prism::Visitor + # @return [DispatchOnce] a new instance of DispatchOnce + # + # source://prism//lib/prism/dispatcher.rb#1280 + def initialize(listeners); end + + # Returns the value of attribute listeners. + # + # source://prism//lib/prism/dispatcher.rb#1278 + def listeners; end + + # Dispatch enter and leave events for AliasGlobalVariableNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1285 + def visit_alias_global_variable_node(node); end + + # Dispatch enter and leave events for AliasMethodNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1291 + def visit_alias_method_node(node); end + + # Dispatch enter and leave events for AlternationPatternNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1297 + def visit_alternation_pattern_node(node); end + + # Dispatch enter and leave events for AndNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1303 + def visit_and_node(node); end + + # Dispatch enter and leave events for ArgumentsNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1309 + def visit_arguments_node(node); end + + # Dispatch enter and leave events for ArrayNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1315 + def visit_array_node(node); end + + # Dispatch enter and leave events for ArrayPatternNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1321 + def visit_array_pattern_node(node); end + + # Dispatch enter and leave events for AssocNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1327 + def visit_assoc_node(node); end + + # Dispatch enter and leave events for AssocSplatNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1333 + def visit_assoc_splat_node(node); end + + # Dispatch enter and leave events for BackReferenceReadNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1339 + def visit_back_reference_read_node(node); end + + # Dispatch enter and leave events for BeginNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1345 + def visit_begin_node(node); end + + # Dispatch enter and leave events for BlockArgumentNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1351 + def visit_block_argument_node(node); end + + # Dispatch enter and leave events for BlockLocalVariableNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1357 + def visit_block_local_variable_node(node); end + + # Dispatch enter and leave events for BlockNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1363 + def visit_block_node(node); end + + # Dispatch enter and leave events for BlockParameterNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1369 + def visit_block_parameter_node(node); end + + # Dispatch enter and leave events for BlockParametersNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1375 + def visit_block_parameters_node(node); end + + # Dispatch enter and leave events for BreakNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1381 + def visit_break_node(node); end + + # Dispatch enter and leave events for CallAndWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1387 + def visit_call_and_write_node(node); end + + # Dispatch enter and leave events for CallNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1393 + def visit_call_node(node); end + + # Dispatch enter and leave events for CallOperatorWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1399 + def visit_call_operator_write_node(node); end + + # Dispatch enter and leave events for CallOrWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1405 + def visit_call_or_write_node(node); end + + # Dispatch enter and leave events for CallTargetNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1411 + def visit_call_target_node(node); end + + # Dispatch enter and leave events for CapturePatternNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1417 + def visit_capture_pattern_node(node); end + + # Dispatch enter and leave events for CaseMatchNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1423 + def visit_case_match_node(node); end + + # Dispatch enter and leave events for CaseNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1429 + def visit_case_node(node); end + + # Dispatch enter and leave events for ClassNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1435 + def visit_class_node(node); end + + # Dispatch enter and leave events for ClassVariableAndWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1441 + def visit_class_variable_and_write_node(node); end + + # Dispatch enter and leave events for ClassVariableOperatorWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1447 + def visit_class_variable_operator_write_node(node); end + + # Dispatch enter and leave events for ClassVariableOrWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1453 + def visit_class_variable_or_write_node(node); end + + # Dispatch enter and leave events for ClassVariableReadNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1459 + def visit_class_variable_read_node(node); end + + # Dispatch enter and leave events for ClassVariableTargetNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1465 + def visit_class_variable_target_node(node); end + + # Dispatch enter and leave events for ClassVariableWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1471 + def visit_class_variable_write_node(node); end + + # Dispatch enter and leave events for ConstantAndWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1477 + def visit_constant_and_write_node(node); end + + # Dispatch enter and leave events for ConstantOperatorWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1483 + def visit_constant_operator_write_node(node); end + + # Dispatch enter and leave events for ConstantOrWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1489 + def visit_constant_or_write_node(node); end + + # Dispatch enter and leave events for ConstantPathAndWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1495 + def visit_constant_path_and_write_node(node); end + + # Dispatch enter and leave events for ConstantPathNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1501 + def visit_constant_path_node(node); end + + # Dispatch enter and leave events for ConstantPathOperatorWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1507 + def visit_constant_path_operator_write_node(node); end + + # Dispatch enter and leave events for ConstantPathOrWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1513 + def visit_constant_path_or_write_node(node); end + + # Dispatch enter and leave events for ConstantPathTargetNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1519 + def visit_constant_path_target_node(node); end + + # Dispatch enter and leave events for ConstantPathWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1525 + def visit_constant_path_write_node(node); end + + # Dispatch enter and leave events for ConstantReadNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1531 + def visit_constant_read_node(node); end + + # Dispatch enter and leave events for ConstantTargetNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1537 + def visit_constant_target_node(node); end + + # Dispatch enter and leave events for ConstantWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1543 + def visit_constant_write_node(node); end + + # Dispatch enter and leave events for DefNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1549 + def visit_def_node(node); end + + # Dispatch enter and leave events for DefinedNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1555 + def visit_defined_node(node); end + + # Dispatch enter and leave events for ElseNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1561 + def visit_else_node(node); end + + # Dispatch enter and leave events for EmbeddedStatementsNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1567 + def visit_embedded_statements_node(node); end + + # Dispatch enter and leave events for EmbeddedVariableNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1573 + def visit_embedded_variable_node(node); end + + # Dispatch enter and leave events for EnsureNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1579 + def visit_ensure_node(node); end + + # Dispatch enter and leave events for FalseNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1585 + def visit_false_node(node); end + + # Dispatch enter and leave events for FindPatternNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1591 + def visit_find_pattern_node(node); end + + # Dispatch enter and leave events for FlipFlopNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1597 + def visit_flip_flop_node(node); end + + # Dispatch enter and leave events for FloatNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1603 + def visit_float_node(node); end + + # Dispatch enter and leave events for ForNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1609 + def visit_for_node(node); end + + # Dispatch enter and leave events for ForwardingArgumentsNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1615 + def visit_forwarding_arguments_node(node); end + + # Dispatch enter and leave events for ForwardingParameterNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1621 + def visit_forwarding_parameter_node(node); end + + # Dispatch enter and leave events for ForwardingSuperNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1627 + def visit_forwarding_super_node(node); end + + # Dispatch enter and leave events for GlobalVariableAndWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1633 + def visit_global_variable_and_write_node(node); end + + # Dispatch enter and leave events for GlobalVariableOperatorWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1639 + def visit_global_variable_operator_write_node(node); end + + # Dispatch enter and leave events for GlobalVariableOrWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1645 + def visit_global_variable_or_write_node(node); end + + # Dispatch enter and leave events for GlobalVariableReadNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1651 + def visit_global_variable_read_node(node); end + + # Dispatch enter and leave events for GlobalVariableTargetNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1657 + def visit_global_variable_target_node(node); end + + # Dispatch enter and leave events for GlobalVariableWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1663 + def visit_global_variable_write_node(node); end + + # Dispatch enter and leave events for HashNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1669 + def visit_hash_node(node); end + + # Dispatch enter and leave events for HashPatternNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1675 + def visit_hash_pattern_node(node); end + + # Dispatch enter and leave events for IfNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1681 + def visit_if_node(node); end + + # Dispatch enter and leave events for ImaginaryNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1687 + def visit_imaginary_node(node); end + + # Dispatch enter and leave events for ImplicitNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1693 + def visit_implicit_node(node); end + + # Dispatch enter and leave events for ImplicitRestNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1699 + def visit_implicit_rest_node(node); end + + # Dispatch enter and leave events for InNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1705 + def visit_in_node(node); end + + # Dispatch enter and leave events for IndexAndWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1711 + def visit_index_and_write_node(node); end + + # Dispatch enter and leave events for IndexOperatorWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1717 + def visit_index_operator_write_node(node); end + + # Dispatch enter and leave events for IndexOrWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1723 + def visit_index_or_write_node(node); end + + # Dispatch enter and leave events for IndexTargetNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1729 + def visit_index_target_node(node); end + + # Dispatch enter and leave events for InstanceVariableAndWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1735 + def visit_instance_variable_and_write_node(node); end + + # Dispatch enter and leave events for InstanceVariableOperatorWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1741 + def visit_instance_variable_operator_write_node(node); end + + # Dispatch enter and leave events for InstanceVariableOrWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1747 + def visit_instance_variable_or_write_node(node); end + + # Dispatch enter and leave events for InstanceVariableReadNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1753 + def visit_instance_variable_read_node(node); end + + # Dispatch enter and leave events for InstanceVariableTargetNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1759 + def visit_instance_variable_target_node(node); end + + # Dispatch enter and leave events for InstanceVariableWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1765 + def visit_instance_variable_write_node(node); end + + # Dispatch enter and leave events for IntegerNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1771 + def visit_integer_node(node); end + + # Dispatch enter and leave events for InterpolatedMatchLastLineNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1777 + def visit_interpolated_match_last_line_node(node); end + + # Dispatch enter and leave events for InterpolatedRegularExpressionNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1783 + def visit_interpolated_regular_expression_node(node); end + + # Dispatch enter and leave events for InterpolatedStringNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1789 + def visit_interpolated_string_node(node); end + + # Dispatch enter and leave events for InterpolatedSymbolNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1795 + def visit_interpolated_symbol_node(node); end + + # Dispatch enter and leave events for InterpolatedXStringNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1801 + def visit_interpolated_x_string_node(node); end + + # Dispatch enter and leave events for ItLocalVariableReadNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1807 + def visit_it_local_variable_read_node(node); end + + # Dispatch enter and leave events for ItParametersNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1813 + def visit_it_parameters_node(node); end + + # Dispatch enter and leave events for KeywordHashNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1819 + def visit_keyword_hash_node(node); end + + # Dispatch enter and leave events for KeywordRestParameterNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1825 + def visit_keyword_rest_parameter_node(node); end + + # Dispatch enter and leave events for LambdaNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1831 + def visit_lambda_node(node); end + + # Dispatch enter and leave events for LocalVariableAndWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1837 + def visit_local_variable_and_write_node(node); end + + # Dispatch enter and leave events for LocalVariableOperatorWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1843 + def visit_local_variable_operator_write_node(node); end + + # Dispatch enter and leave events for LocalVariableOrWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1849 + def visit_local_variable_or_write_node(node); end + + # Dispatch enter and leave events for LocalVariableReadNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1855 + def visit_local_variable_read_node(node); end + + # Dispatch enter and leave events for LocalVariableTargetNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1861 + def visit_local_variable_target_node(node); end + + # Dispatch enter and leave events for LocalVariableWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1867 + def visit_local_variable_write_node(node); end + + # Dispatch enter and leave events for MatchLastLineNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1873 + def visit_match_last_line_node(node); end + + # Dispatch enter and leave events for MatchPredicateNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1879 + def visit_match_predicate_node(node); end + + # Dispatch enter and leave events for MatchRequiredNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1885 + def visit_match_required_node(node); end + + # Dispatch enter and leave events for MatchWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1891 + def visit_match_write_node(node); end + + # Dispatch enter and leave events for MissingNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1897 + def visit_missing_node(node); end + + # Dispatch enter and leave events for ModuleNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1903 + def visit_module_node(node); end + + # Dispatch enter and leave events for MultiTargetNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1909 + def visit_multi_target_node(node); end + + # Dispatch enter and leave events for MultiWriteNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1915 + def visit_multi_write_node(node); end + + # Dispatch enter and leave events for NextNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1921 + def visit_next_node(node); end + + # Dispatch enter and leave events for NilNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1927 + def visit_nil_node(node); end + + # Dispatch enter and leave events for NoKeywordsParameterNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1933 + def visit_no_keywords_parameter_node(node); end + + # Dispatch enter and leave events for NumberedParametersNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1939 + def visit_numbered_parameters_node(node); end + + # Dispatch enter and leave events for NumberedReferenceReadNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1945 + def visit_numbered_reference_read_node(node); end + + # Dispatch enter and leave events for OptionalKeywordParameterNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1951 + def visit_optional_keyword_parameter_node(node); end + + # Dispatch enter and leave events for OptionalParameterNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1957 + def visit_optional_parameter_node(node); end + + # Dispatch enter and leave events for OrNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1963 + def visit_or_node(node); end + + # Dispatch enter and leave events for ParametersNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1969 + def visit_parameters_node(node); end + + # Dispatch enter and leave events for ParenthesesNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1975 + def visit_parentheses_node(node); end + + # Dispatch enter and leave events for PinnedExpressionNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1981 + def visit_pinned_expression_node(node); end + + # Dispatch enter and leave events for PinnedVariableNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1987 + def visit_pinned_variable_node(node); end + + # Dispatch enter and leave events for PostExecutionNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1993 + def visit_post_execution_node(node); end + + # Dispatch enter and leave events for PreExecutionNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#1999 + def visit_pre_execution_node(node); end + + # Dispatch enter and leave events for ProgramNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2005 + def visit_program_node(node); end + + # Dispatch enter and leave events for RangeNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2011 + def visit_range_node(node); end + + # Dispatch enter and leave events for RationalNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2017 + def visit_rational_node(node); end + + # Dispatch enter and leave events for RedoNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2023 + def visit_redo_node(node); end + + # Dispatch enter and leave events for RegularExpressionNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2029 + def visit_regular_expression_node(node); end + + # Dispatch enter and leave events for RequiredKeywordParameterNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2035 + def visit_required_keyword_parameter_node(node); end + + # Dispatch enter and leave events for RequiredParameterNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2041 + def visit_required_parameter_node(node); end + + # Dispatch enter and leave events for RescueModifierNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2047 + def visit_rescue_modifier_node(node); end + + # Dispatch enter and leave events for RescueNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2053 + def visit_rescue_node(node); end + + # Dispatch enter and leave events for RestParameterNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2059 + def visit_rest_parameter_node(node); end + + # Dispatch enter and leave events for RetryNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2065 + def visit_retry_node(node); end + + # Dispatch enter and leave events for ReturnNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2071 + def visit_return_node(node); end + + # Dispatch enter and leave events for SelfNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2077 + def visit_self_node(node); end + + # Dispatch enter and leave events for ShareableConstantNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2083 + def visit_shareable_constant_node(node); end + + # Dispatch enter and leave events for SingletonClassNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2089 + def visit_singleton_class_node(node); end + + # Dispatch enter and leave events for SourceEncodingNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2095 + def visit_source_encoding_node(node); end + + # Dispatch enter and leave events for SourceFileNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2101 + def visit_source_file_node(node); end + + # Dispatch enter and leave events for SourceLineNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2107 + def visit_source_line_node(node); end + + # Dispatch enter and leave events for SplatNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2113 + def visit_splat_node(node); end + + # Dispatch enter and leave events for StatementsNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2119 + def visit_statements_node(node); end + + # Dispatch enter and leave events for StringNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2125 + def visit_string_node(node); end + + # Dispatch enter and leave events for SuperNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2131 + def visit_super_node(node); end + + # Dispatch enter and leave events for SymbolNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2137 + def visit_symbol_node(node); end + + # Dispatch enter and leave events for TrueNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2143 + def visit_true_node(node); end + + # Dispatch enter and leave events for UndefNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2149 + def visit_undef_node(node); end + + # Dispatch enter and leave events for UnlessNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2155 + def visit_unless_node(node); end + + # Dispatch enter and leave events for UntilNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2161 + def visit_until_node(node); end + + # Dispatch enter and leave events for WhenNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2167 + def visit_when_node(node); end + + # Dispatch enter and leave events for WhileNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2173 + def visit_while_node(node); end + + # Dispatch enter and leave events for XStringNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2179 + def visit_x_string_node(node); end + + # Dispatch enter and leave events for YieldNode nodes. + # + # source://prism//lib/prism/dispatcher.rb#2185 + 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. +# +# source://prism//lib/prism/dot_visitor.rb#14 +class Prism::DotVisitor < ::Prism::Visitor + # Initialize a new dot visitor. + # + # @return [DotVisitor] a new instance of DotVisitor + # + # source://prism//lib/prism/dot_visitor.rb#106 + def initialize; end + + # The digraph that is being built. + # + # source://prism//lib/prism/dot_visitor.rb#103 + def digraph; end + + # Convert this visitor into a graphviz dot graph string. + # + # source://prism//lib/prism/dot_visitor.rb#111 + def to_dot; end + + # Visit a AliasGlobalVariableNode node. + # + # source://prism//lib/prism/dot_visitor.rb#116 + def visit_alias_global_variable_node(node); end + + # Visit a AliasMethodNode node. + # + # source://prism//lib/prism/dot_visitor.rb#141 + def visit_alias_method_node(node); end + + # Visit a AlternationPatternNode node. + # + # source://prism//lib/prism/dot_visitor.rb#166 + def visit_alternation_pattern_node(node); end + + # Visit a AndNode node. + # + # source://prism//lib/prism/dot_visitor.rb#191 + def visit_and_node(node); end + + # Visit a ArgumentsNode node. + # + # source://prism//lib/prism/dot_visitor.rb#216 + def visit_arguments_node(node); end + + # Visit a ArrayNode node. + # + # source://prism//lib/prism/dot_visitor.rb#246 + def visit_array_node(node); end + + # Visit a ArrayPatternNode node. + # + # source://prism//lib/prism/dot_visitor.rb#286 + def visit_array_pattern_node(node); end + + # Visit a AssocNode node. + # + # source://prism//lib/prism/dot_visitor.rb#348 + def visit_assoc_node(node); end + + # Visit a AssocSplatNode node. + # + # source://prism//lib/prism/dot_visitor.rb#375 + def visit_assoc_splat_node(node); end + + # Visit a BackReferenceReadNode node. + # + # source://prism//lib/prism/dot_visitor.rb#398 + def visit_back_reference_read_node(node); end + + # Visit a BeginNode node. + # + # source://prism//lib/prism/dot_visitor.rb#415 + def visit_begin_node(node); end + + # Visit a BlockArgumentNode node. + # + # source://prism//lib/prism/dot_visitor.rb#463 + def visit_block_argument_node(node); end + + # Visit a BlockLocalVariableNode node. + # + # source://prism//lib/prism/dot_visitor.rb#486 + def visit_block_local_variable_node(node); end + + # Visit a BlockNode node. + # + # source://prism//lib/prism/dot_visitor.rb#506 + def visit_block_node(node); end + + # Visit a BlockParameterNode node. + # + # source://prism//lib/prism/dot_visitor.rb#541 + def visit_block_parameter_node(node); end + + # Visit a BlockParametersNode node. + # + # source://prism//lib/prism/dot_visitor.rb#569 + def visit_block_parameters_node(node); end + + # Visit a BreakNode node. + # + # source://prism//lib/prism/dot_visitor.rb#612 + def visit_break_node(node); end + + # Visit a CallAndWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#635 + def visit_call_and_write_node(node); end + + # Visit a CallNode node. + # + # source://prism//lib/prism/dot_visitor.rb#681 + def visit_call_node(node); end + + # Visit a CallOperatorWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#739 + def visit_call_operator_write_node(node); end + + # Visit a CallOrWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#788 + def visit_call_or_write_node(node); end + + # Visit a CallTargetNode node. + # + # source://prism//lib/prism/dot_visitor.rb#834 + def visit_call_target_node(node); end + + # Visit a CapturePatternNode node. + # + # source://prism//lib/prism/dot_visitor.rb#864 + def visit_capture_pattern_node(node); end + + # Visit a CaseMatchNode node. + # + # source://prism//lib/prism/dot_visitor.rb#889 + def visit_case_match_node(node); end + + # Visit a CaseNode node. + # + # source://prism//lib/prism/dot_visitor.rb#934 + def visit_case_node(node); end + + # Visit a ClassNode node. + # + # source://prism//lib/prism/dot_visitor.rb#979 + def visit_class_node(node); end + + # Visit a ClassVariableAndWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1026 + def visit_class_variable_and_write_node(node); end + + # Visit a ClassVariableOperatorWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1053 + def visit_class_variable_operator_write_node(node); end + + # Visit a ClassVariableOrWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1083 + def visit_class_variable_or_write_node(node); end + + # Visit a ClassVariableReadNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1110 + def visit_class_variable_read_node(node); end + + # Visit a ClassVariableTargetNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1127 + def visit_class_variable_target_node(node); end + + # Visit a ClassVariableWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1144 + def visit_class_variable_write_node(node); end + + # Visit a ConstantAndWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1171 + def visit_constant_and_write_node(node); end + + # Visit a ConstantOperatorWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1198 + def visit_constant_operator_write_node(node); end + + # Visit a ConstantOrWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1228 + def visit_constant_or_write_node(node); end + + # Visit a ConstantPathAndWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1255 + def visit_constant_path_and_write_node(node); end + + # Visit a ConstantPathNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1280 + def visit_constant_path_node(node); end + + # Visit a ConstantPathOperatorWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1309 + def visit_constant_path_operator_write_node(node); end + + # Visit a ConstantPathOrWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1337 + def visit_constant_path_or_write_node(node); end + + # Visit a ConstantPathTargetNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1362 + def visit_constant_path_target_node(node); end + + # Visit a ConstantPathWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1391 + def visit_constant_path_write_node(node); end + + # Visit a ConstantReadNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1416 + def visit_constant_read_node(node); end + + # Visit a ConstantTargetNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1433 + def visit_constant_target_node(node); end + + # Visit a ConstantWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1450 + def visit_constant_write_node(node); end + + # Visit a DefNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1477 + def visit_def_node(node); end + + # Visit a DefinedNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1546 + def visit_defined_node(node); end + + # Visit a ElseNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1577 + def visit_else_node(node); end + + # Visit a EmbeddedStatementsNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1605 + def visit_embedded_statements_node(node); end + + # Visit a EmbeddedVariableNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1631 + def visit_embedded_variable_node(node); end + + # Visit a EnsureNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1652 + def visit_ensure_node(node); end + + # Visit a FalseNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1678 + def visit_false_node(node); end + + # Visit a FindPatternNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1692 + def visit_find_pattern_node(node); end + + # Visit a FlipFlopNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1743 + def visit_flip_flop_node(node); end + + # Visit a FloatNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1775 + def visit_float_node(node); end + + # Visit a ForNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1792 + def visit_for_node(node); end + + # Visit a ForwardingArgumentsNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1834 + def visit_forwarding_arguments_node(node); end + + # Visit a ForwardingParameterNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1848 + def visit_forwarding_parameter_node(node); end + + # Visit a ForwardingSuperNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1862 + def visit_forwarding_super_node(node); end + + # Visit a GlobalVariableAndWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1882 + def visit_global_variable_and_write_node(node); end + + # Visit a GlobalVariableOperatorWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1909 + def visit_global_variable_operator_write_node(node); end + + # Visit a GlobalVariableOrWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1939 + def visit_global_variable_or_write_node(node); end + + # Visit a GlobalVariableReadNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1966 + def visit_global_variable_read_node(node); end + + # Visit a GlobalVariableTargetNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1983 + def visit_global_variable_target_node(node); end + + # Visit a GlobalVariableWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2000 + def visit_global_variable_write_node(node); end + + # Visit a HashNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2027 + def visit_hash_node(node); end + + # Visit a HashPatternNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2060 + def visit_hash_pattern_node(node); end + + # Visit a IfNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2109 + def visit_if_node(node); end + + # Visit a ImaginaryNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2154 + def visit_imaginary_node(node); end + + # Visit a ImplicitNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2172 + def visit_implicit_node(node); end + + # Visit a ImplicitRestNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2190 + def visit_implicit_rest_node(node); end + + # Visit a InNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2204 + def visit_in_node(node); end + + # Visit a IndexAndWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2236 + def visit_index_and_write_node(node); end + + # Visit a IndexOperatorWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2289 + def visit_index_operator_write_node(node); end + + # Visit a IndexOrWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2345 + def visit_index_or_write_node(node); end + + # Visit a IndexTargetNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2398 + def visit_index_target_node(node); end + + # Visit a InstanceVariableAndWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2437 + def visit_instance_variable_and_write_node(node); end + + # Visit a InstanceVariableOperatorWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2464 + def visit_instance_variable_operator_write_node(node); end + + # Visit a InstanceVariableOrWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2494 + def visit_instance_variable_or_write_node(node); end + + # Visit a InstanceVariableReadNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2521 + def visit_instance_variable_read_node(node); end + + # Visit a InstanceVariableTargetNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2538 + def visit_instance_variable_target_node(node); end + + # Visit a InstanceVariableWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2555 + def visit_instance_variable_write_node(node); end + + # Visit a IntegerNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2582 + def visit_integer_node(node); end + + # Visit a InterpolatedMatchLastLineNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2602 + def visit_interpolated_match_last_line_node(node); end + + # Visit a InterpolatedRegularExpressionNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2638 + def visit_interpolated_regular_expression_node(node); end + + # Visit a InterpolatedStringNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2674 + def visit_interpolated_string_node(node); end + + # Visit a InterpolatedSymbolNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2714 + def visit_interpolated_symbol_node(node); end + + # Visit a InterpolatedXStringNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2751 + def visit_interpolated_x_string_node(node); end + + # Visit a ItLocalVariableReadNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2784 + def visit_it_local_variable_read_node(node); end + + # Visit a ItParametersNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2798 + def visit_it_parameters_node(node); end + + # Visit a KeywordHashNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2812 + def visit_keyword_hash_node(node); end + + # Visit a KeywordRestParameterNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2842 + def visit_keyword_rest_parameter_node(node); end + + # Visit a LambdaNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2870 + def visit_lambda_node(node); end + + # Visit a LocalVariableAndWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2908 + def visit_local_variable_and_write_node(node); end + + # Visit a LocalVariableOperatorWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2938 + def visit_local_variable_operator_write_node(node); end + + # Visit a LocalVariableOrWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2971 + def visit_local_variable_or_write_node(node); end + + # Visit a LocalVariableReadNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3001 + def visit_local_variable_read_node(node); end + + # Visit a LocalVariableTargetNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3021 + def visit_local_variable_target_node(node); end + + # Visit a LocalVariableWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3041 + def visit_local_variable_write_node(node); end + + # Visit a MatchLastLineNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3071 + def visit_match_last_line_node(node); end + + # Visit a MatchPredicateNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3100 + def visit_match_predicate_node(node); end + + # Visit a MatchRequiredNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3125 + def visit_match_required_node(node); end + + # Visit a MatchWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3150 + def visit_match_write_node(node); end + + # Visit a MissingNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3181 + def visit_missing_node(node); end + + # Visit a ModuleNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3195 + def visit_module_node(node); end + + # Visit a MultiTargetNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3231 + def visit_multi_target_node(node); end + + # Visit a MultiWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3287 + def visit_multi_write_node(node); end + + # Visit a NextNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3350 + def visit_next_node(node); end + + # Visit a NilNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3373 + def visit_nil_node(node); end + + # Visit a NoKeywordsParameterNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3387 + def visit_no_keywords_parameter_node(node); end + + # Visit a NumberedParametersNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3407 + def visit_numbered_parameters_node(node); end + + # Visit a NumberedReferenceReadNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3424 + def visit_numbered_reference_read_node(node); end + + # Visit a OptionalKeywordParameterNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3441 + def visit_optional_keyword_parameter_node(node); end + + # Visit a OptionalParameterNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3468 + def visit_optional_parameter_node(node); end + + # Visit a OrNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3498 + def visit_or_node(node); end + + # Visit a ParametersNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3523 + def visit_parameters_node(node); end + + # Visit a ParenthesesNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3607 + def visit_parentheses_node(node); end + + # Visit a PinnedExpressionNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3633 + def visit_pinned_expression_node(node); end + + # Visit a PinnedVariableNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3660 + def visit_pinned_variable_node(node); end + + # Visit a PostExecutionNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3681 + def visit_post_execution_node(node); end + + # Visit a PreExecutionNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3710 + def visit_pre_execution_node(node); end + + # Visit a ProgramNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3739 + def visit_program_node(node); end + + # Visit a RangeNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3760 + def visit_range_node(node); end + + # Visit a RationalNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3792 + def visit_rational_node(node); end + + # Visit a RedoNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3815 + def visit_redo_node(node); end + + # Visit a RegularExpressionNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3829 + def visit_regular_expression_node(node); end + + # Visit a RequiredKeywordParameterNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3858 + def visit_required_keyword_parameter_node(node); end + + # Visit a RequiredParameterNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3881 + def visit_required_parameter_node(node); end + + # Visit a RescueModifierNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3901 + def visit_rescue_modifier_node(node); end + + # Visit a RescueNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3926 + def visit_rescue_node(node); end + + # Visit a RestParameterNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3979 + def visit_rest_parameter_node(node); end + + # Visit a RetryNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4007 + def visit_retry_node(node); end + + # Visit a ReturnNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4021 + def visit_return_node(node); end + + # Visit a SelfNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4047 + def visit_self_node(node); end + + # Visit a ShareableConstantNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4061 + def visit_shareable_constant_node(node); end + + # Visit a SingletonClassNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4082 + def visit_singleton_class_node(node); end + + # Visit a SourceEncodingNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4118 + def visit_source_encoding_node(node); end + + # Visit a SourceFileNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4132 + def visit_source_file_node(node); end + + # Visit a SourceLineNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4152 + def visit_source_line_node(node); end + + # Visit a SplatNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4166 + def visit_splat_node(node); end + + # Visit a StatementsNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4189 + def visit_statements_node(node); end + + # Visit a StringNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4216 + def visit_string_node(node); end + + # Visit a SuperNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4249 + def visit_super_node(node); end + + # Visit a SymbolNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4288 + def visit_symbol_node(node); end + + # Visit a TrueNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4323 + def visit_true_node(node); end + + # Visit a UndefNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4337 + def visit_undef_node(node); end + + # Visit a UnlessNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4367 + def visit_unless_node(node); end + + # Visit a UntilNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4410 + def visit_until_node(node); end + + # Visit a WhenNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4445 + def visit_when_node(node); end + + # Visit a WhileNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4486 + def visit_while_node(node); end + + # Visit a XStringNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4521 + def visit_x_string_node(node); end + + # Visit a YieldNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4550 + 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. + # + # source://prism//lib/prism/dot_visitor.rb#4596 + 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. + # + # source://prism//lib/prism/dot_visitor.rb#4605 + 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. + # + # source://prism//lib/prism/dot_visitor.rb#4613 + def call_node_flags_inspect(node); end + + # Inspect a node that has encoding_flags flags to display the flags as a + # comma-separated list. + # + # source://prism//lib/prism/dot_visitor.rb#4624 + def encoding_flags_inspect(node); end + + # Inspect a node that has integer_base_flags flags to display the flags as a + # comma-separated list. + # + # source://prism//lib/prism/dot_visitor.rb#4633 + 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. + # + # source://prism//lib/prism/dot_visitor.rb#4644 + 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. + # + # source://prism//lib/prism/dot_visitor.rb#4653 + def keyword_hash_node_flags_inspect(node); end + + # Inspect a location to display the start and end line and column numbers. + # + # source://prism//lib/prism/dot_visitor.rb#4590 + def location_inspect(location); end + + # Inspect a node that has loop_flags flags to display the flags as a + # comma-separated list. + # + # source://prism//lib/prism/dot_visitor.rb#4661 + def loop_flags_inspect(node); end + + # Generate a unique node ID for a node throughout the digraph. + # + # source://prism//lib/prism/dot_visitor.rb#4585 + def node_id(node); end + + # Inspect a node that has parameter_flags flags to display the flags as a + # comma-separated list. + # + # source://prism//lib/prism/dot_visitor.rb#4669 + def parameter_flags_inspect(node); end + + # Inspect a node that has range_flags flags to display the flags as a + # comma-separated list. + # + # source://prism//lib/prism/dot_visitor.rb#4677 + def range_flags_inspect(node); end + + # Inspect a node that has regular_expression_flags flags to display the flags as a + # comma-separated list. + # + # source://prism//lib/prism/dot_visitor.rb#4685 + def regular_expression_flags_inspect(node); end + + # Inspect a node that has return_node_flags flags to display the flags as a + # comma-separated list. + # + # source://prism//lib/prism/dot_visitor.rb#4703 + def return_node_flags_inspect(node); end + + # Inspect a node that has shareable_constant_node_flags flags to display the flags as a + # comma-separated list. + # + # source://prism//lib/prism/dot_visitor.rb#4711 + 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. + # + # source://prism//lib/prism/dot_visitor.rb#4721 + def string_flags_inspect(node); end + + # Inspect a node that has symbol_flags flags to display the flags as a + # comma-separated list. + # + # source://prism//lib/prism/dot_visitor.rb#4732 + def symbol_flags_inspect(node); end +end + +# source://prism//lib/prism/dot_visitor.rb#59 +class Prism::DotVisitor::Digraph + # @return [Digraph] a new instance of Digraph + # + # source://prism//lib/prism/dot_visitor.rb#62 + def initialize; end + + # source://prism//lib/prism/dot_visitor.rb#76 + def edge(value); end + + # Returns the value of attribute edges. + # + # source://prism//lib/prism/dot_visitor.rb#60 + def edges; end + + # source://prism//lib/prism/dot_visitor.rb#68 + def node(value); end + + # Returns the value of attribute nodes. + # + # source://prism//lib/prism/dot_visitor.rb#60 + def nodes; end + + # source://prism//lib/prism/dot_visitor.rb#80 + def to_dot; end + + # source://prism//lib/prism/dot_visitor.rb#72 + def waypoint(value); end + + # Returns the value of attribute waypoints. + # + # source://prism//lib/prism/dot_visitor.rb#60 + def waypoints; end +end + +# source://prism//lib/prism/dot_visitor.rb#15 +class Prism::DotVisitor::Field + # @return [Field] a new instance of Field + # + # source://prism//lib/prism/dot_visitor.rb#18 + def initialize(name, value, port); end + + # Returns the value of attribute name. + # + # source://prism//lib/prism/dot_visitor.rb#16 + def name; end + + # Returns the value of attribute port. + # + # source://prism//lib/prism/dot_visitor.rb#16 + def port; end + + # source://prism//lib/prism/dot_visitor.rb#24 + def to_dot; end + + # Returns the value of attribute value. + # + # source://prism//lib/prism/dot_visitor.rb#16 + def value; end +end + +# source://prism//lib/prism/dot_visitor.rb#33 +class Prism::DotVisitor::Table + # @return [Table] a new instance of Table + # + # source://prism//lib/prism/dot_visitor.rb#36 + def initialize(name); end + + # source://prism//lib/prism/dot_visitor.rb#41 + def field(name, value = T.unsafe(nil), port: T.unsafe(nil)); end + + # Returns the value of attribute fields. + # + # source://prism//lib/prism/dot_visitor.rb#34 + def fields; end + + # Returns the value of attribute name. + # + # source://prism//lib/prism/dot_visitor.rb#34 + def name; end + + # source://prism//lib/prism/dot_visitor.rb#45 + def to_dot; end +end + +# Represents an `else` clause in a `case`, `if`, or `unless` statement. +# +# if a then b else c end +# ^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#6173 +class Prism::ElseNode < ::Prism::Node + # def initialize: (Location else_keyword_loc, StatementsNode? statements, Location? end_keyword_loc, Location location) -> void + # + # @return [ElseNode] a new instance of ElseNode + # + # source://prism//lib/prism/node.rb#6175 + sig do + params( + source: Prism::Source, + else_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end + def initialize(source, else_keyword_loc, statements, end_keyword_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#6286 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#6184 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#6189 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#6201 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#6194 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?else_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location?, ?location: Location) -> ElseNode + # + # source://prism//lib/prism/node.rb#6206 + sig do + params( + else_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::ElseNode) + end + def copy(else_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#6189 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { else_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location?, location: Location } + # + # source://prism//lib/prism/node.rb#6214 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def else_keyword: () -> String + # + # source://prism//lib/prism/node.rb#6242 + sig { returns(String) } + def else_keyword; end + + # attr_reader else_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#6219 + sig { returns(Prism::Location) } + def else_keyword_loc; end + + # def end_keyword: () -> String? + # + # source://prism//lib/prism/node.rb#6247 + sig { returns(T.nilable(String)) } + def end_keyword; end + + # attr_reader end_keyword_loc: Location? + # + # source://prism//lib/prism/node.rb#6229 + 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 + # + # source://prism//lib/prism/node.rb#6252 + sig { override.returns(String) } + def inspect; end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#6226 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#6270 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#6280 + def type; end + end +end + +# EmbDocComment objects correspond to comments that are surrounded by =begin +# and =end. +# +# source://prism//lib/prism/parse_result.rb#403 +class Prism::EmbDocComment < ::Prism::Comment + # Returns a string representation of this comment. + # + # source://prism//lib/prism/parse_result.rb#410 + sig { returns(String) } + def inspect; end + + # This can only be true for inline comments. + # + # @return [Boolean] + # + # source://prism//lib/prism/parse_result.rb#405 + sig { override.returns(T::Boolean) } + def trailing?; end +end + +# Represents an interpolated set of statements. +# +# "foo #{bar}" +# ^^^^^^ +# +# source://prism//lib/prism/node.rb#6298 +class Prism::EmbeddedStatementsNode < ::Prism::Node + # def initialize: (Location opening_loc, StatementsNode? statements, Location closing_loc, Location location) -> void + # + # @return [EmbeddedStatementsNode] a new instance of EmbeddedStatementsNode + # + # source://prism//lib/prism/node.rb#6300 + sig do + params( + source: Prism::Source, + opening_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + closing_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, opening_loc, statements, closing_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#6405 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#6309 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#6314 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#6366 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#6354 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#6326 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#6319 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?opening_loc: Location, ?statements: StatementsNode?, ?closing_loc: Location, ?location: Location) -> EmbeddedStatementsNode + # + # source://prism//lib/prism/node.rb#6331 + sig do + params( + opening_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::EmbeddedStatementsNode) + end + def copy(opening_loc: T.unsafe(nil), statements: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#6314 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, statements: StatementsNode?, closing_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#6339 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#6371 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#6361 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#6344 + sig { returns(Prism::Location) } + def opening_loc; end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#6351 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#6389 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#6399 + def type; end + end +end + +# Represents an interpolated variable. +# +# "foo #@bar" +# ^^^^^ +# +# source://prism//lib/prism/node.rb#6417 +class Prism::EmbeddedVariableNode < ::Prism::Node + # def initialize: (Location operator_loc, Prism::node variable, Location location) -> void + # + # @return [EmbeddedVariableNode] a new instance of EmbeddedVariableNode + # + # source://prism//lib/prism/node.rb#6419 + sig do + params( + source: Prism::Source, + operator_loc: Prism::Location, + variable: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, operator_loc, variable, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#6509 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#6427 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#6432 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#6442 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#6437 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?operator_loc: Location, ?variable: Prism::node, ?location: Location) -> EmbeddedVariableNode + # + # source://prism//lib/prism/node.rb#6447 + sig do + params( + operator_loc: Prism::Location, + variable: Prism::Node, + location: Prism::Location + ).returns(Prism::EmbeddedVariableNode) + end + def copy(operator_loc: T.unsafe(nil), variable: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#6432 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, variable: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#6455 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#6475 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#6470 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#6460 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#6493 + sig { override.returns(Symbol) } + def type; end + + # attr_reader variable: Prism::node + # + # source://prism//lib/prism/node.rb#6467 + sig { returns(Prism::Node) } + def variable; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#6503 + def type; end + end +end + +# Flags for nodes that have unescaped content. +# +# source://prism//lib/prism/node.rb#19157 +module Prism::EncodingFlags; end + +# internal bytes forced the encoding to binary +# +# source://prism//lib/prism/node.rb#19162 +Prism::EncodingFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to UTF-8 +# +# source://prism//lib/prism/node.rb#19159 +Prism::EncodingFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) + +# Represents an `ensure` clause in a `begin` statement. +# +# begin +# foo +# ensure +# ^^^^^^ +# bar +# end +# +# source://prism//lib/prism/node.rb#6524 +class Prism::EnsureNode < ::Prism::Node + # def initialize: (Location ensure_keyword_loc, StatementsNode? statements, Location end_keyword_loc, Location location) -> void + # + # @return [EnsureNode] a new instance of EnsureNode + # + # source://prism//lib/prism/node.rb#6526 + sig do + params( + source: Prism::Source, + ensure_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, ensure_keyword_loc, statements, end_keyword_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#6631 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#6535 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#6540 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#6552 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#6545 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?ensure_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location, ?location: Location) -> EnsureNode + # + # source://prism//lib/prism/node.rb#6557 + sig do + params( + ensure_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::EnsureNode) + end + def copy(ensure_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#6540 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { ensure_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#6565 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def end_keyword: () -> String + # + # source://prism//lib/prism/node.rb#6592 + sig { returns(String) } + def end_keyword; end + + # attr_reader end_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#6580 + sig { returns(Prism::Location) } + def end_keyword_loc; end + + # def ensure_keyword: () -> String + # + # source://prism//lib/prism/node.rb#6587 + sig { returns(String) } + def ensure_keyword; end + + # attr_reader ensure_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#6570 + sig { returns(Prism::Location) } + def ensure_keyword_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#6597 + sig { override.returns(String) } + def inspect; end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#6577 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#6615 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#6625 + def type; end + end +end + +# Represents the use of the literal `false` keyword. +# +# false +# ^^^^^ +# +# source://prism//lib/prism/node.rb#6643 +class Prism::FalseNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [FalseNode] a new instance of FalseNode + # + # source://prism//lib/prism/node.rb#6645 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#6718 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#6651 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#6656 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#6666 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#6661 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?location: Location) -> FalseNode + # + # source://prism//lib/prism/node.rb#6671 + sig { params(location: Prism::Location).returns(Prism::FalseNode) } + def copy(location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#6656 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#6679 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#6684 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#6702 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#6712 + 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) +# ^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#6733 +class Prism::FindPatternNode < ::Prism::Node + # def initialize: (Prism::node? constant, Prism::node left, Array[Prism::node] requireds, Prism::node right, Location? opening_loc, Location? closing_loc, Location location) -> void + # + # @return [FindPatternNode] a new instance of FindPatternNode + # + # source://prism//lib/prism/node.rb#6735 + sig do + params( + source: Prism::Source, + constant: T.nilable(Prism::Node), + left: Prism::Node, + requireds: T::Array[Prism::Node], + right: Prism::Node, + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end + def initialize(source, constant, left, requireds, right, opening_loc, closing_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#6867 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#6747 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#6752 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # source://prism//lib/prism/node.rb#6828 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism//lib/prism/node.rb#6810 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#6767 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#6757 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # attr_reader constant: Prism::node? + # + # source://prism//lib/prism/node.rb#6785 + sig { returns(T.nilable(Prism::Node)) } + def constant; end + + # def copy: (?constant: Prism::node?, ?left: Prism::node, ?requireds: Array[Prism::node], ?right: Prism::node, ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> FindPatternNode + # + # source://prism//lib/prism/node.rb#6772 + sig do + params( + constant: T.nilable(Prism::Node), + left: Prism::Node, + requireds: T::Array[Prism::Node], + right: Prism::Node, + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::FindPatternNode) + end + def copy(constant: T.unsafe(nil), left: T.unsafe(nil), requireds: T.unsafe(nil), right: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#6752 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { constant: Prism::node?, left: Prism::node, requireds: Array[Prism::node], right: Prism::node, opening_loc: Location?, closing_loc: Location?, location: Location } + # + # source://prism//lib/prism/node.rb#6780 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#6833 + sig { override.returns(String) } + def inspect; end + + # attr_reader left: Prism::node + # + # source://prism//lib/prism/node.rb#6788 + sig { returns(Prism::Node) } + def left; end + + # def opening: () -> String? + # + # source://prism//lib/prism/node.rb#6823 + sig { returns(T.nilable(String)) } + def opening; end + + # attr_reader opening_loc: Location? + # + # source://prism//lib/prism/node.rb#6797 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # attr_reader requireds: Array[Prism::node] + # + # source://prism//lib/prism/node.rb#6791 + sig { returns(T::Array[Prism::Node]) } + def requireds; end + + # attr_reader right: Prism::node + # + # source://prism//lib/prism/node.rb#6794 + sig { returns(Prism::Node) } + def right; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#6851 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#6861 + def type; end + end +end + +# Represents the use of the `..` or `...` operators to create flip flops. +# +# baz if foo .. bar +# ^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#6883 +class Prism::FlipFlopNode < ::Prism::Node + # def initialize: (Integer flags, Prism::node? left, Prism::node? right, Location operator_loc, Location location) -> void + # + # @return [FlipFlopNode] a new instance of FlipFlopNode + # + # source://prism//lib/prism/node.rb#6885 + sig do + params( + source: Prism::Source, + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, flags, left, right, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#6992 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#6895 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#6900 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#6913 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#6905 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location, ?location: Location) -> FlipFlopNode + # + # source://prism//lib/prism/node.rb#6918 + sig do + params( + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::FlipFlopNode) + end + def copy(flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#6900 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, left: Prism::node?, right: Prism::node?, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#6926 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def exclude_end?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#6948 + sig { returns(T::Boolean) } + def exclude_end?; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#6958 + sig { override.returns(String) } + def inspect; end + + # attr_reader left: Prism::node? + # + # source://prism//lib/prism/node.rb#6935 + sig { returns(T.nilable(Prism::Node)) } + def left; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#6953 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#6941 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader right: Prism::node? + # + # source://prism//lib/prism/node.rb#6938 + sig { returns(T.nilable(Prism::Node)) } + def right; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#6976 + sig { override.returns(Symbol) } + def type; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#6931 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#6986 + def type; end + end +end + +# Represents a floating point number literal. +# +# 1.0 +# ^^^ +# +# source://prism//lib/prism/node.rb#7005 +class Prism::FloatNode < ::Prism::Node + # def initialize: (Float value, Location location) -> void + # + # @return [FloatNode] a new instance of FloatNode + # + # source://prism//lib/prism/node.rb#7007 + sig { params(source: Prism::Source, value: Float, location: Prism::Location).void } + def initialize(source, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#7084 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#7014 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7019 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#7029 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#7024 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?value: Float, ?location: Location) -> FloatNode + # + # source://prism//lib/prism/node.rb#7034 + sig { params(value: Float, location: Prism::Location).returns(Prism::FloatNode) } + def copy(value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7019 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { value: Float, location: Location } + # + # source://prism//lib/prism/node.rb#7042 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#7050 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7068 + sig { override.returns(Symbol) } + def type; end + + # The value of the floating point number as a Float. + # + # source://prism//lib/prism/node.rb#7047 + sig { returns(Float) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7078 + def type; end + end +end + +# Represents the use of the `for` keyword. +# +# for i in a end +# ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#7094 +class Prism::ForNode < ::Prism::Node + # def initialize: (Prism::node index, Prism::node collection, StatementsNode? statements, Location for_keyword_loc, Location in_keyword_loc, Location? do_keyword_loc, Location end_keyword_loc, Location location) -> void + # + # @return [ForNode] a new instance of ForNode + # + # source://prism//lib/prism/node.rb#7096 + sig do + params( + source: Prism::Source, + index: Prism::Node, + 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, + location: Prism::Location + ).void + end + def initialize(source, index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#7266 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#7109 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7114 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # The collection to iterate over. + # + # for i in a end + # ^ + # + # source://prism//lib/prism/node.rb#7155 + sig { returns(Prism::Node) } + def collection; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#7128 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#7119 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?index: Prism::node, ?collection: Prism::node, ?statements: StatementsNode?, ?for_keyword_loc: Location, ?in_keyword_loc: Location, ?do_keyword_loc: Location?, ?end_keyword_loc: Location, ?location: Location) -> ForNode + # + # source://prism//lib/prism/node.rb#7133 + sig do + params( + index: Prism::Node, + 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, + location: Prism::Location + ).returns(Prism::ForNode) + end + def copy(index: T.unsafe(nil), collection: T.unsafe(nil), statements: T.unsafe(nil), for_keyword_loc: T.unsafe(nil), in_keyword_loc: T.unsafe(nil), do_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7114 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { index: Prism::node, collection: Prism::node, statements: StatementsNode?, for_keyword_loc: Location, in_keyword_loc: Location, do_keyword_loc: Location?, end_keyword_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#7141 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def do_keyword: () -> String? + # + # source://prism//lib/prism/node.rb#7222 + sig { returns(T.nilable(String)) } + def do_keyword; end + + # The location of the `do` keyword, if present. + # + # for i in a do end + # ^^ + # + # source://prism//lib/prism/node.rb#7189 + sig { returns(T.nilable(Prism::Location)) } + def do_keyword_loc; end + + # def end_keyword: () -> String + # + # source://prism//lib/prism/node.rb#7227 + sig { returns(String) } + def end_keyword; end + + # The location of the `end` keyword. + # + # for i in a end + # ^^^ + # + # source://prism//lib/prism/node.rb#7205 + sig { returns(Prism::Location) } + def end_keyword_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def for_keyword: () -> String + # + # source://prism//lib/prism/node.rb#7212 + sig { returns(String) } + def for_keyword; end + + # The location of the `for` keyword. + # + # for i in a end + # ^^^ + # + # source://prism//lib/prism/node.rb#7169 + sig { returns(Prism::Location) } + def for_keyword_loc; end + + # def in_keyword: () -> String + # + # source://prism//lib/prism/node.rb#7217 + sig { returns(String) } + def in_keyword; end + + # The location of the `in` keyword. + # + # for i in a end + # ^^ + # + # source://prism//lib/prism/node.rb#7179 + sig { returns(Prism::Location) } + def in_keyword_loc; end + + # The index expression for `for` loops. + # + # for i in a end + # ^ + # + # source://prism//lib/prism/node.rb#7149 + sig { returns(Prism::Node) } + def index; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#7232 + sig { override.returns(String) } + def inspect; end + + # Represents the body of statements to execute for each iteration of the loop. + # + # for i in a + # foo(i) + # ^^^^^^ + # end + # + # source://prism//lib/prism/node.rb#7163 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7250 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7260 + def type; end + end +end + +# Represents forwarding all arguments to this method to another method. +# +# def foo(...) +# bar(...) +# ^^^ +# end +# +# source://prism//lib/prism/node.rb#7284 +class Prism::ForwardingArgumentsNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [ForwardingArgumentsNode] a new instance of ForwardingArgumentsNode + # + # source://prism//lib/prism/node.rb#7286 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#7359 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#7292 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7297 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#7307 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#7302 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?location: Location) -> ForwardingArgumentsNode + # + # source://prism//lib/prism/node.rb#7312 + sig { params(location: Prism::Location).returns(Prism::ForwardingArgumentsNode) } + def copy(location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7297 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#7320 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#7325 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7343 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7353 + def type; end + end +end + +# Represents the use of the forwarding parameter in a method, block, or lambda declaration. +# +# def foo(...) +# ^^^ +# end +# +# source://prism//lib/prism/node.rb#7369 +class Prism::ForwardingParameterNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [ForwardingParameterNode] a new instance of ForwardingParameterNode + # + # source://prism//lib/prism/node.rb#7371 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#7444 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#7377 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7382 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#7392 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#7387 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?location: Location) -> ForwardingParameterNode + # + # source://prism//lib/prism/node.rb#7397 + sig { params(location: Prism::Location).returns(Prism::ForwardingParameterNode) } + def copy(location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7382 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#7405 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#7410 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7428 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7438 + def type; end + end +end + +# Represents the use of the `super` keyword without parentheses or arguments. +# +# super +# ^^^^^ +# +# source://prism//lib/prism/node.rb#7453 +class Prism::ForwardingSuperNode < ::Prism::Node + # def initialize: (BlockNode? block, Location location) -> void + # + # @return [ForwardingSuperNode] a new instance of ForwardingSuperNode + # + # source://prism//lib/prism/node.rb#7455 + sig { params(source: Prism::Source, block: T.nilable(Prism::BlockNode), location: Prism::Location).void } + def initialize(source, block, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#7534 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#7462 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader block: BlockNode? + # + # source://prism//lib/prism/node.rb#7497 + sig { returns(T.nilable(Prism::BlockNode)) } + def block; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7467 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#7479 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#7472 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?block: BlockNode?, ?location: Location) -> ForwardingSuperNode + # + # source://prism//lib/prism/node.rb#7484 + sig { params(block: T.nilable(Prism::BlockNode), location: Prism::Location).returns(Prism::ForwardingSuperNode) } + def copy(block: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7467 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { block: BlockNode?, location: Location } + # + # source://prism//lib/prism/node.rb#7492 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#7500 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7518 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7528 + def type; end + end +end + +# Represents the use of the `&&=` operator for assignment to a global variable. +# +# $target &&= value +# ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#7544 +class Prism::GlobalVariableAndWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # + # @return [GlobalVariableAndWriteNode] a new instance of GlobalVariableAndWriteNode + # + # source://prism//lib/prism/node.rb#7546 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#7648 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#7556 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7561 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#7571 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#7566 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> GlobalVariableAndWriteNode + # + # source://prism//lib/prism/node.rb#7576 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::GlobalVariableAndWriteNode) + end + def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7561 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#7584 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # source://prism//lib/prism/desugar_compiler.rb#163 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#7614 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#7589 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#7592 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#7609 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#7599 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7632 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#7606 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7642 + def type; end + end +end + +# Represents assigning to a global variable using an operator that isn't `=`. +# +# $target += value +# ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#7661 +class Prism::GlobalVariableOperatorWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void + # + # @return [GlobalVariableOperatorWriteNode] a new instance of GlobalVariableOperatorWriteNode + # + # source://prism//lib/prism/node.rb#7663 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#7764 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#7674 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader binary_operator: Symbol + # + # source://prism//lib/prism/node.rb#7727 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # source://prism//lib/prism/node.rb#7717 + sig { returns(Prism::Location) } + def binary_operator_loc; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7679 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#7689 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#7684 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> GlobalVariableOperatorWriteNode + # + # source://prism//lib/prism/node.rb#7694 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).returns(Prism::GlobalVariableOperatorWriteNode) + end + def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7679 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#7702 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # source://prism//lib/prism/desugar_compiler.rb#175 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#7730 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#7707 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#7710 + 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. + # + # source://prism//lib/prism/node_ext.rb#387 + 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. + # + # source://prism//lib/prism/node_ext.rb#394 + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7748 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#7724 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7758 + def type; end + end +end + +# Represents the use of the `||=` operator for assignment to a global variable. +# +# $target ||= value +# ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#7778 +class Prism::GlobalVariableOrWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # + # @return [GlobalVariableOrWriteNode] a new instance of GlobalVariableOrWriteNode + # + # source://prism//lib/prism/node.rb#7780 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#7882 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#7790 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7795 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#7805 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#7800 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> GlobalVariableOrWriteNode + # + # source://prism//lib/prism/node.rb#7810 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::GlobalVariableOrWriteNode) + end + def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7795 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#7818 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # source://prism//lib/prism/desugar_compiler.rb#169 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#7848 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#7823 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#7826 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#7843 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#7833 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7866 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#7840 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7876 + def type; end + end +end + +# Represents referencing a global variable. +# +# $foo +# ^^^^ +# +# source://prism//lib/prism/node.rb#7895 +class Prism::GlobalVariableReadNode < ::Prism::Node + # def initialize: (Symbol name, Location location) -> void + # + # @return [GlobalVariableReadNode] a new instance of GlobalVariableReadNode + # + # source://prism//lib/prism/node.rb#7897 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } + def initialize(source, name, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#7978 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#7904 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7909 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#7919 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#7914 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?location: Location) -> GlobalVariableReadNode + # + # source://prism//lib/prism/node.rb#7924 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::GlobalVariableReadNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7909 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#7932 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#7944 + 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` + # + # source://prism//lib/prism/node.rb#7941 + sig { returns(Symbol) } + def name; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7962 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7972 + def type; end + end +end + +# Represents writing to a global variable in a context that doesn't have an explicit value. +# +# $foo, $bar = baz +# ^^^^ ^^^^ +# +# source://prism//lib/prism/node.rb#7988 +class Prism::GlobalVariableTargetNode < ::Prism::Node + # def initialize: (Symbol name, Location location) -> void + # + # @return [GlobalVariableTargetNode] a new instance of GlobalVariableTargetNode + # + # source://prism//lib/prism/node.rb#7990 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } + def initialize(source, name, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#8067 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#7997 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8002 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#8012 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#8007 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?location: Location) -> GlobalVariableTargetNode + # + # source://prism//lib/prism/node.rb#8017 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::GlobalVariableTargetNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8002 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#8025 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#8033 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#8030 + sig { returns(Symbol) } + def name; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#8051 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#8061 + def type; end + end +end + +# Represents writing to a global variable. +# +# $foo = 1 +# ^^^^^^^^ +# +# source://prism//lib/prism/node.rb#8077 +class Prism::GlobalVariableWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void + # + # @return [GlobalVariableWriteNode] a new instance of GlobalVariableWriteNode + # + # source://prism//lib/prism/node.rb#8079 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, value, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#8197 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#8089 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8094 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#8104 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#8099 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> GlobalVariableWriteNode + # + # source://prism//lib/prism/node.rb#8109 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::GlobalVariableWriteNode) + end + def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8094 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#8117 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#8163 + 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` + # + # source://prism//lib/prism/node.rb#8126 + sig { returns(Symbol) } + def name; end + + # The location of the global variable's name. + # + # $foo = :bar + # ^^^^ + # + # source://prism//lib/prism/node.rb#8132 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#8158 + sig { returns(String) } + def operator; end + + # The location of the `=` operator. + # + # $foo = :bar + # ^ + # + # source://prism//lib/prism/node.rb#8151 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#8181 + 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 + # ^^^ + # + # source://prism//lib/prism/node.rb#8145 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#8191 + def type; end + end +end + +# Represents a hash literal. +# +# { a => b } +# ^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#8210 +class Prism::HashNode < ::Prism::Node + # def initialize: (Location opening_loc, Array[AssocNode | AssocSplatNode] elements, Location closing_loc, Location location) -> void + # + # @return [HashNode] a new instance of HashNode + # + # source://prism//lib/prism/node.rb#8212 + sig do + params( + source: Prism::Source, + opening_loc: Prism::Location, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, opening_loc, elements, closing_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#8327 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#8221 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8226 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#8288 + sig { returns(String) } + def closing; end + + # The location of the closing brace. + # + # { a => b } + # ^ + # + # source://prism//lib/prism/node.rb#8276 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#8236 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#8231 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?opening_loc: Location, ?elements: Array[AssocNode | AssocSplatNode], ?closing_loc: Location, ?location: Location) -> HashNode + # + # source://prism//lib/prism/node.rb#8241 + sig do + params( + opening_loc: Prism::Location, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::HashNode) + end + def copy(opening_loc: T.unsafe(nil), elements: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8226 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, elements: Array[AssocNode | AssocSplatNode], closing_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#8249 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # The elements of the hash. These can be either `AssocNode`s or `AssocSplatNode`s. + # + # { a: b } + # ^^^^ + # + # { **foo } + # ^^^^^ + # + # source://prism//lib/prism/node.rb#8270 + 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 + # + # source://prism//lib/prism/node.rb#8293 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#8283 + sig { returns(String) } + def opening; end + + # The location of the opening brace. + # + # { a => b } + # ^ + # + # source://prism//lib/prism/node.rb#8257 + sig { returns(Prism::Location) } + def opening_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#8311 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#8321 + def type; end + end +end + +# Represents a hash pattern in pattern matching. +# +# foo => { a: 1, b: 2 } +# ^^^^^^^^^^^^^^ +# +# foo => { a: 1, b: 2, **c } +# ^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#8343 +class Prism::HashPatternNode < ::Prism::Node + # def initialize: (Prism::node? constant, Array[AssocNode] elements, AssocSplatNode | NoKeywordsParameterNode | nil rest, Location? opening_loc, Location? closing_loc, Location location) -> void + # + # @return [HashPatternNode] a new instance of HashPatternNode + # + # source://prism//lib/prism/node.rb#8345 + sig do + params( + source: Prism::Source, + constant: T.nilable(Prism::Node), + 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), + location: Prism::Location + ).void + end + def initialize(source, constant, elements, rest, opening_loc, closing_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#8472 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#8356 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8361 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # source://prism//lib/prism/node.rb#8433 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism//lib/prism/node.rb#8415 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#8375 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#8366 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # attr_reader constant: Prism::node? + # + # source://prism//lib/prism/node.rb#8393 + sig { returns(T.nilable(Prism::Node)) } + def constant; end + + # def copy: (?constant: Prism::node?, ?elements: Array[AssocNode], ?rest: AssocSplatNode | NoKeywordsParameterNode | nil, ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> HashPatternNode + # + # source://prism//lib/prism/node.rb#8380 + sig do + params( + constant: T.nilable(Prism::Node), + 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), + location: Prism::Location + ).returns(Prism::HashPatternNode) + end + def copy(constant: T.unsafe(nil), elements: T.unsafe(nil), rest: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8361 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { constant: Prism::node?, elements: Array[AssocNode], rest: AssocSplatNode | NoKeywordsParameterNode | nil, opening_loc: Location?, closing_loc: Location?, location: Location } + # + # source://prism//lib/prism/node.rb#8388 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # attr_reader elements: Array[AssocNode] + # + # source://prism//lib/prism/node.rb#8396 + sig { returns(T::Array[Prism::AssocNode]) } + def elements; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#8438 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String? + # + # source://prism//lib/prism/node.rb#8428 + sig { returns(T.nilable(String)) } + def opening; end + + # attr_reader opening_loc: Location? + # + # source://prism//lib/prism/node.rb#8402 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # attr_reader rest: AssocSplatNode | NoKeywordsParameterNode | nil + # + # source://prism//lib/prism/node.rb#8399 + sig { returns(T.nilable(T.any(Prism::AssocSplatNode, Prism::NoKeywordsParameterNode))) } + def rest; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#8456 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#8466 + def type; end + end +end + +# source://prism//lib/prism/node_ext.rb#49 +module Prism::HeredocQuery + # Returns true if this node was represented as a heredoc in the source code. + # + # @return [Boolean] + # + # source://prism//lib/prism/node_ext.rb#51 + 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 +# ^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#8493 +class Prism::IfNode < ::Prism::Node + # def initialize: (Location? if_keyword_loc, Prism::node predicate, Location? then_keyword_loc, StatementsNode? statements, Prism::node? consequent, Location? end_keyword_loc, Location location) -> void + # + # @return [IfNode] a new instance of IfNode + # + # source://prism//lib/prism/node.rb#8495 + sig do + params( + source: Prism::Source, + if_keyword_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + consequent: T.nilable(Prism::Node), + end_keyword_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end + def initialize(source, if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#8687 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#8507 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8512 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#8526 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#8517 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; 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 + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/node.rb#8617 + sig { returns(T.nilable(Prism::Node)) } + def consequent; end + + # def copy: (?if_keyword_loc: Location?, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?consequent: Prism::node?, ?end_keyword_loc: Location?, ?location: Location) -> IfNode + # + # source://prism//lib/prism/node.rb#8531 + sig do + params( + if_keyword_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + consequent: T.nilable(Prism::Node), + end_keyword_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::IfNode) + end + def copy(if_keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), consequent: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8512 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { if_keyword_loc: Location?, predicate: Prism::node, then_keyword_loc: Location?, statements: StatementsNode?, consequent: Prism::node?, end_keyword_loc: Location?, location: Location } + # + # source://prism//lib/prism/node.rb#8539 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def end_keyword: () -> String? + # + # source://prism//lib/prism/node.rb#8648 + sig { returns(T.nilable(String)) } + def end_keyword; end + + # The location of the `end` keyword if present, `nil` otherwise. + # + # if foo + # bar + # end + # ^^^ + # + # source://prism//lib/prism/node.rb#8625 + 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? + # + # source://prism//lib/prism/node.rb#8638 + 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. + # + # source://prism//lib/prism/node.rb#8549 + sig { returns(T.nilable(Prism::Location)) } + def if_keyword_loc; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#8653 + sig { override.returns(String) } + def inspect; end + + # source://prism//lib/prism/parse_result/newlines.rb#91 + def newline!(lines); end + + # The node for the condition the `IfNode` is testing. + # + # if foo + # ^^^ + # bar + # end + # + # bar if foo + # ^^^ + # + # foo ? bar : baz + # ^^^ + # + # source://prism//lib/prism/node.rb#8573 + sig { returns(Prism::Node) } + def predicate; 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 + # + # source://prism//lib/prism/node.rb#8602 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # def then_keyword: () -> String? + # + # source://prism//lib/prism/node.rb#8643 + 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 + # ^ + # + # source://prism//lib/prism/node.rb#8582 + sig { returns(T.nilable(Prism::Location)) } + def then_keyword_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#8671 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#8681 + def type; end + end +end + +# Represents an imaginary number literal. +# +# 1.0i +# ^^^^ +# +# source://prism//lib/prism/node.rb#8702 +class Prism::ImaginaryNode < ::Prism::Node + # def initialize: (FloatNode | IntegerNode | RationalNode numeric, Location location) -> void + # + # @return [ImaginaryNode] a new instance of ImaginaryNode + # + # source://prism//lib/prism/node.rb#8704 + sig do + params( + source: Prism::Source, + numeric: T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode), + location: Prism::Location + ).void + end + def initialize(source, numeric, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#8781 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#8711 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8716 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#8726 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#8721 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?numeric: FloatNode | IntegerNode | RationalNode, ?location: Location) -> ImaginaryNode + # + # source://prism//lib/prism/node.rb#8731 + sig do + params( + numeric: T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode), + location: Prism::Location + ).returns(Prism::ImaginaryNode) + end + def copy(numeric: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8716 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { numeric: FloatNode | IntegerNode | RationalNode, location: Location } + # + # source://prism//lib/prism/node.rb#8739 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#8747 + sig { override.returns(String) } + def inspect; end + + # attr_reader numeric: FloatNode | IntegerNode | RationalNode + # + # source://prism//lib/prism/node.rb#8744 + sig { returns(T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode)) } + def numeric; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#8765 + sig { override.returns(Symbol) } + def type; end + + # Returns the value of the node as a Ruby Complex. + # + # source://prism//lib/prism/node_ext.rb#101 + sig { returns(Complex) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#8775 + 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: } +# ^^^^ +# +# source://prism//lib/prism/node.rb#8797 +class Prism::ImplicitNode < ::Prism::Node + # def initialize: (Prism::node value, Location location) -> void + # + # @return [ImplicitNode] a new instance of ImplicitNode + # + # source://prism//lib/prism/node.rb#8799 + sig { params(source: Prism::Source, value: Prism::Node, location: Prism::Location).void } + def initialize(source, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#8876 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#8806 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8811 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#8821 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#8816 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?value: Prism::node, ?location: Location) -> ImplicitNode + # + # source://prism//lib/prism/node.rb#8826 + sig { params(value: Prism::Node, location: Prism::Location).returns(Prism::ImplicitNode) } + def copy(value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8811 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#8834 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#8842 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#8860 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#8839 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#8870 + 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 +# ^ +# +# source://prism//lib/prism/node.rb#8895 +class Prism::ImplicitRestNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [ImplicitRestNode] a new instance of ImplicitRestNode + # + # source://prism//lib/prism/node.rb#8897 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#8970 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#8903 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8908 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#8918 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#8913 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?location: Location) -> ImplicitRestNode + # + # source://prism//lib/prism/node.rb#8923 + sig { params(location: Prism::Location).returns(Prism::ImplicitRestNode) } + def copy(location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8908 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#8931 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#8936 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#8954 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#8964 + def type; end + end +end + +# Represents the use of the `in` keyword in a case statement. +# +# case a; in b then c end +# ^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#8979 +class Prism::InNode < ::Prism::Node + # def initialize: (Prism::node pattern, StatementsNode? statements, Location in_loc, Location? then_loc, Location location) -> void + # + # @return [InNode] a new instance of InNode + # + # source://prism//lib/prism/node.rb#8981 + sig do + params( + source: Prism::Source, + pattern: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + in_loc: Prism::Location, + then_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end + def initialize(source, pattern, statements, in_loc, then_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#9097 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#8991 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8996 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#9009 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#9001 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?pattern: Prism::node, ?statements: StatementsNode?, ?in_loc: Location, ?then_loc: Location?, ?location: Location) -> InNode + # + # source://prism//lib/prism/node.rb#9014 + sig do + params( + pattern: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + in_loc: Prism::Location, + then_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::InNode) + end + def copy(pattern: T.unsafe(nil), statements: T.unsafe(nil), in_loc: T.unsafe(nil), then_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#8996 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { pattern: Prism::node, statements: StatementsNode?, in_loc: Location, then_loc: Location?, location: Location } + # + # source://prism//lib/prism/node.rb#9022 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def in: () -> String + # + # source://prism//lib/prism/node.rb#9053 + sig { returns(String) } + def in; end + + # attr_reader in_loc: Location + # + # source://prism//lib/prism/node.rb#9033 + sig { returns(Prism::Location) } + def in_loc; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#9063 + sig { override.returns(String) } + def inspect; end + + # attr_reader pattern: Prism::node + # + # source://prism//lib/prism/node.rb#9027 + sig { returns(Prism::Node) } + def pattern; end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#9030 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # def then: () -> String? + # + # source://prism//lib/prism/node.rb#9058 + sig { returns(T.nilable(String)) } + def then; end + + # attr_reader then_loc: Location? + # + # source://prism//lib/prism/node.rb#9040 + sig { returns(T.nilable(Prism::Location)) } + def then_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#9081 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#9091 + def type; end + end +end + +# Represents the use of the `&&=` operator on a call to the `[]` method. +# +# foo.bar[baz] &&= value +# ^^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#9110 +class Prism::IndexAndWriteNode < ::Prism::Node + # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Location operator_loc, Prism::node value, Location location) -> void + # + # @return [IndexAndWriteNode] a new instance of IndexAndWriteNode + # + # source://prism//lib/prism/node.rb#9112 + sig do + params( + source: Prism::Source, + 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::Node), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#9289 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#9127 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # source://prism//lib/prism/node.rb#9192 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def attribute_write?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9225 + sig { returns(T::Boolean) } + def attribute_write?; end + + # attr_reader block: Prism::node? + # + # source://prism//lib/prism/node.rb#9202 + sig { returns(T.nilable(Prism::Node)) } + def block; end + + # def call_operator: () -> String? + # + # source://prism//lib/prism/node.rb#9235 + sig { returns(T.nilable(String)) } + def call_operator; end + + # attr_reader call_operator_loc: Location? + # + # source://prism//lib/prism/node.rb#9172 + sig { returns(T.nilable(Prism::Location)) } + def call_operator_loc; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#9132 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#9245 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#9195 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#9147 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#9137 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> IndexAndWriteNode + # + # source://prism//lib/prism/node.rb#9152 + sig do + params( + 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::Node), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::IndexAndWriteNode) + end + def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#9132 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, operator_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#9160 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def ignore_visibility?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9230 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#9255 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#9240 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#9185 + sig { returns(Prism::Location) } + def opening_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#9250 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#9205 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader receiver: Prism::node? + # + # source://prism//lib/prism/node.rb#9169 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9215 + sig { returns(T::Boolean) } + def safe_navigation?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#9273 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#9212 + sig { returns(Prism::Node) } + def value; end + + # def variable_call?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9220 + sig { returns(T::Boolean) } + def variable_call?; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#9165 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#9283 + def type; end + end +end + +# Represents the use of an assignment operator on a call to `[]`. +# +# foo.bar[baz] += value +# ^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#9307 +class Prism::IndexOperatorWriteNode < ::Prism::Node + # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Symbol binary_operator, Location binary_operator_loc, Prism::node value, Location location) -> void + # + # @return [IndexOperatorWriteNode] a new instance of IndexOperatorWriteNode + # + # source://prism//lib/prism/node.rb#9309 + sig do + params( + source: Prism::Source, + 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::Node), + binary_operator: Symbol, + binary_operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#9485 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#9325 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # source://prism//lib/prism/node.rb#9390 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def attribute_write?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9426 + sig { returns(T::Boolean) } + def attribute_write?; end + + # attr_reader binary_operator: Symbol + # + # source://prism//lib/prism/node.rb#9403 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # source://prism//lib/prism/node.rb#9406 + sig { returns(Prism::Location) } + def binary_operator_loc; end + + # attr_reader block: Prism::node? + # + # source://prism//lib/prism/node.rb#9400 + sig { returns(T.nilable(Prism::Node)) } + def block; end + + # def call_operator: () -> String? + # + # source://prism//lib/prism/node.rb#9436 + sig { returns(T.nilable(String)) } + def call_operator; end + + # attr_reader call_operator_loc: Location? + # + # source://prism//lib/prism/node.rb#9370 + sig { returns(T.nilable(Prism::Location)) } + def call_operator_loc; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#9330 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#9446 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#9393 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#9345 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#9335 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node, ?location: Location) -> IndexOperatorWriteNode + # + # source://prism//lib/prism/node.rb#9350 + sig do + params( + 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::Node), + binary_operator: Symbol, + binary_operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::IndexOperatorWriteNode) + end + def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#9330 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, binary_operator: Symbol, binary_operator_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#9358 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def ignore_visibility?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9431 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#9451 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#9441 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#9383 + 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. + # + # source://prism//lib/prism/node_ext.rb#403 + 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. + # + # source://prism//lib/prism/node_ext.rb#410 + def operator_loc; end + + # attr_reader receiver: Prism::node? + # + # source://prism//lib/prism/node.rb#9367 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9416 + sig { returns(T::Boolean) } + def safe_navigation?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#9469 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#9413 + sig { returns(Prism::Node) } + def value; end + + # def variable_call?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9421 + sig { returns(T::Boolean) } + def variable_call?; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#9363 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#9479 + def type; end + end +end + +# Represents the use of the `||=` operator on a call to `[]`. +# +# foo.bar[baz] ||= value +# ^^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#9504 +class Prism::IndexOrWriteNode < ::Prism::Node + # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Location operator_loc, Prism::node value, Location location) -> void + # + # @return [IndexOrWriteNode] a new instance of IndexOrWriteNode + # + # source://prism//lib/prism/node.rb#9506 + sig do + params( + source: Prism::Source, + 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::Node), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#9683 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#9521 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # source://prism//lib/prism/node.rb#9586 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def attribute_write?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9619 + sig { returns(T::Boolean) } + def attribute_write?; end + + # attr_reader block: Prism::node? + # + # source://prism//lib/prism/node.rb#9596 + sig { returns(T.nilable(Prism::Node)) } + def block; end + + # def call_operator: () -> String? + # + # source://prism//lib/prism/node.rb#9629 + sig { returns(T.nilable(String)) } + def call_operator; end + + # attr_reader call_operator_loc: Location? + # + # source://prism//lib/prism/node.rb#9566 + sig { returns(T.nilable(Prism::Location)) } + def call_operator_loc; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#9526 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#9639 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#9589 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#9541 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#9531 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> IndexOrWriteNode + # + # source://prism//lib/prism/node.rb#9546 + sig do + params( + 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::Node), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::IndexOrWriteNode) + end + def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#9526 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, operator_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#9554 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def ignore_visibility?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9624 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#9649 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#9634 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#9579 + sig { returns(Prism::Location) } + def opening_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#9644 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#9599 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader receiver: Prism::node? + # + # source://prism//lib/prism/node.rb#9563 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9609 + sig { returns(T::Boolean) } + def safe_navigation?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#9667 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#9606 + sig { returns(Prism::Node) } + def value; end + + # def variable_call?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9614 + sig { returns(T::Boolean) } + def variable_call?; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#9559 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#9677 + 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 +# ^^^^^^^^ +# +# source://prism//lib/prism/node.rb#9709 +class Prism::IndexTargetNode < ::Prism::Node + # def initialize: (Integer flags, Prism::node receiver, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Location location) -> void + # + # @return [IndexTargetNode] a new instance of IndexTargetNode + # + # source://prism//lib/prism/node.rb#9711 + sig do + params( + source: Prism::Source, + flags: Integer, + receiver: Prism::Node, + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::Node), + location: Prism::Location + ).void + end + def initialize(source, flags, receiver, opening_loc, arguments, closing_loc, block, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#9851 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#9723 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # source://prism//lib/prism/node.rb#9774 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def attribute_write?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9797 + sig { returns(T::Boolean) } + def attribute_write?; end + + # attr_reader block: Prism::node? + # + # source://prism//lib/prism/node.rb#9784 + sig { returns(T.nilable(Prism::Node)) } + def block; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#9728 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#9812 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#9777 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#9742 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#9733 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?receiver: Prism::node, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?location: Location) -> IndexTargetNode + # + # source://prism//lib/prism/node.rb#9747 + sig do + params( + flags: Integer, + receiver: Prism::Node, + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::Node), + location: Prism::Location + ).returns(Prism::IndexTargetNode) + end + def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#9728 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, location: Location } + # + # source://prism//lib/prism/node.rb#9755 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def ignore_visibility?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9802 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#9817 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#9807 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#9767 + sig { returns(Prism::Location) } + def opening_loc; end + + # attr_reader receiver: Prism::node + # + # source://prism//lib/prism/node.rb#9764 + sig { returns(Prism::Node) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9787 + sig { returns(T::Boolean) } + def safe_navigation?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#9835 + sig { override.returns(Symbol) } + def type; end + + # def variable_call?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9792 + sig { returns(T::Boolean) } + def variable_call?; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#9760 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#9845 + 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 #. +# +# source://prism//lib/prism/parse_result.rb#388 +class Prism::InlineComment < ::Prism::Comment + # Returns a string representation of this comment. + # + # source://prism//lib/prism/parse_result.rb#396 + 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. + # + # @return [Boolean] + # + # source://prism//lib/prism/parse_result.rb#391 + 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. +# +# source://prism//lib/prism/inspect_visitor.rb#12 +class Prism::InspectVisitor < ::Prism::Visitor + # Initializes a new instance of the InspectVisitor. + # + # @return [InspectVisitor] a new instance of InspectVisitor + # + # source://prism//lib/prism/inspect_visitor.rb#35 + sig { params(indent: String).void } + def initialize(indent = T.unsafe(nil)); end + + # The list of commands that we need to execute in order to compose the + # final string. + # + # source://prism//lib/prism/inspect_visitor.rb#32 + def commands; end + + # Compose the final string. + # + # source://prism//lib/prism/inspect_visitor.rb#48 + sig { returns(String) } + def compose; end + + # The current prefix string. + # + # source://prism//lib/prism/inspect_visitor.rb#28 + def indent; end + + # Inspect a AliasGlobalVariableNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#77 + def visit_alias_global_variable_node(node); end + + # Inspect a AliasMethodNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#87 + def visit_alias_method_node(node); end + + # Inspect a AlternationPatternNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#97 + def visit_alternation_pattern_node(node); end + + # Inspect a AndNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#107 + def visit_and_node(node); end + + # Inspect a ArgumentsNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#117 + def visit_arguments_node(node); end + + # Inspect a ArrayNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#133 + def visit_array_node(node); end + + # Inspect a ArrayPatternNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#151 + def visit_array_pattern_node(node); end + + # Inspect a AssocNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#188 + def visit_assoc_node(node); end + + # Inspect a AssocSplatNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#198 + def visit_assoc_splat_node(node); end + + # Inspect a BackReferenceReadNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#210 + def visit_back_reference_read_node(node); end + + # Inspect a BeginNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#216 + def visit_begin_node(node); end + + # Inspect a BlockArgumentNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#247 + def visit_block_argument_node(node); end + + # Inspect a BlockLocalVariableNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#259 + def visit_block_local_variable_node(node); end + + # Inspect a BlockNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#267 + def visit_block_node(node); end + + # Inspect a BlockParameterNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#287 + def visit_block_parameter_node(node); end + + # Inspect a BlockParametersNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#301 + def visit_block_parameters_node(node); end + + # Inspect a BreakNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#323 + def visit_break_node(node); end + + # Inspect a CallAndWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#335 + def visit_call_and_write_node(node); end + + # Inspect a CallNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#355 + def visit_call_node(node); end + + # Inspect a CallOperatorWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#385 + def visit_call_operator_write_node(node); end + + # Inspect a CallOrWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#406 + def visit_call_or_write_node(node); end + + # Inspect a CallTargetNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#426 + def visit_call_target_node(node); end + + # Inspect a CapturePatternNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#438 + def visit_capture_pattern_node(node); end + + # Inspect a CaseMatchNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#448 + def visit_case_match_node(node); end + + # Inspect a CaseNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#476 + def visit_case_node(node); end + + # Inspect a ClassNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#504 + def visit_class_node(node); end + + # Inspect a ClassVariableAndWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#528 + def visit_class_variable_and_write_node(node); end + + # Inspect a ClassVariableOperatorWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#538 + def visit_class_variable_operator_write_node(node); end + + # Inspect a ClassVariableOrWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#549 + def visit_class_variable_or_write_node(node); end + + # Inspect a ClassVariableReadNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#559 + def visit_class_variable_read_node(node); end + + # Inspect a ClassVariableTargetNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#565 + def visit_class_variable_target_node(node); end + + # Inspect a ClassVariableWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#571 + def visit_class_variable_write_node(node); end + + # Inspect a ConstantAndWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#581 + def visit_constant_and_write_node(node); end + + # Inspect a ConstantOperatorWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#591 + def visit_constant_operator_write_node(node); end + + # Inspect a ConstantOrWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#602 + def visit_constant_or_write_node(node); end + + # Inspect a ConstantPathAndWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#612 + def visit_constant_path_and_write_node(node); end + + # Inspect a ConstantPathNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#622 + def visit_constant_path_node(node); end + + # Inspect a ConstantPathOperatorWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#640 + def visit_constant_path_operator_write_node(node); end + + # Inspect a ConstantPathOrWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#651 + def visit_constant_path_or_write_node(node); end + + # Inspect a ConstantPathTargetNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#661 + def visit_constant_path_target_node(node); end + + # Inspect a ConstantPathWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#679 + def visit_constant_path_write_node(node); end + + # Inspect a ConstantReadNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#689 + def visit_constant_read_node(node); end + + # Inspect a ConstantTargetNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#695 + def visit_constant_target_node(node); end + + # Inspect a ConstantWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#701 + def visit_constant_write_node(node); end + + # Inspect a DefNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#711 + def visit_def_node(node); end + + # Inspect a DefinedNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#743 + def visit_defined_node(node); end + + # Inspect a ElseNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#753 + def visit_else_node(node); end + + # Inspect a EmbeddedStatementsNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#766 + def visit_embedded_statements_node(node); end + + # Inspect a EmbeddedVariableNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#779 + def visit_embedded_variable_node(node); end + + # Inspect a EnsureNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#787 + def visit_ensure_node(node); end + + # Inspect a FalseNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#800 + def visit_false_node(node); end + + # Inspect a FindPatternNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#805 + def visit_find_pattern_node(node); end + + # Inspect a FlipFlopNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#831 + def visit_flip_flop_node(node); end + + # Inspect a FloatNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#851 + def visit_float_node(node); end + + # Inspect a ForNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#857 + def visit_for_node(node); end + + # Inspect a ForwardingArgumentsNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#876 + def visit_forwarding_arguments_node(node); end + + # Inspect a ForwardingParameterNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#881 + def visit_forwarding_parameter_node(node); end + + # Inspect a ForwardingSuperNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#886 + def visit_forwarding_super_node(node); end + + # Inspect a GlobalVariableAndWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#897 + def visit_global_variable_and_write_node(node); end + + # Inspect a GlobalVariableOperatorWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#907 + def visit_global_variable_operator_write_node(node); end + + # Inspect a GlobalVariableOrWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#918 + def visit_global_variable_or_write_node(node); end + + # Inspect a GlobalVariableReadNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#928 + def visit_global_variable_read_node(node); end + + # Inspect a GlobalVariableTargetNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#934 + def visit_global_variable_target_node(node); end + + # Inspect a GlobalVariableWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#940 + def visit_global_variable_write_node(node); end + + # Inspect a HashNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#950 + def visit_hash_node(node); end + + # Inspect a HashPatternNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#966 + def visit_hash_pattern_node(node); end + + # Inspect a IfNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#994 + def visit_if_node(node); end + + # Inspect a ImaginaryNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1016 + def visit_imaginary_node(node); end + + # Inspect a ImplicitNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1023 + def visit_implicit_node(node); end + + # Inspect a ImplicitRestNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1030 + def visit_implicit_rest_node(node); end + + # Inspect a InNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1035 + def visit_in_node(node); end + + # Inspect a IndexAndWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1050 + def visit_index_and_write_node(node); end + + # Inspect a IndexOperatorWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1081 + def visit_index_operator_write_node(node); end + + # Inspect a IndexOrWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1113 + def visit_index_or_write_node(node); end + + # Inspect a IndexTargetNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1144 + def visit_index_target_node(node); end + + # Inspect a InstanceVariableAndWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1167 + def visit_instance_variable_and_write_node(node); end + + # Inspect a InstanceVariableOperatorWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1177 + def visit_instance_variable_operator_write_node(node); end + + # Inspect a InstanceVariableOrWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1188 + def visit_instance_variable_or_write_node(node); end + + # Inspect a InstanceVariableReadNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1198 + def visit_instance_variable_read_node(node); end + + # Inspect a InstanceVariableTargetNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1204 + def visit_instance_variable_target_node(node); end + + # Inspect a InstanceVariableWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1210 + def visit_instance_variable_write_node(node); end + + # Inspect a IntegerNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1220 + def visit_integer_node(node); end + + # Inspect a InterpolatedMatchLastLineNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1228 + def visit_interpolated_match_last_line_node(node); end + + # Inspect a InterpolatedRegularExpressionNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1246 + def visit_interpolated_regular_expression_node(node); end + + # Inspect a InterpolatedStringNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1264 + def visit_interpolated_string_node(node); end + + # Inspect a InterpolatedSymbolNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1282 + def visit_interpolated_symbol_node(node); end + + # Inspect a InterpolatedXStringNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1298 + def visit_interpolated_x_string_node(node); end + + # Inspect a ItLocalVariableReadNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1314 + def visit_it_local_variable_read_node(node); end + + # Inspect a ItParametersNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1319 + def visit_it_parameters_node(node); end + + # Inspect a KeywordHashNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1324 + def visit_keyword_hash_node(node); end + + # Inspect a KeywordRestParameterNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1340 + def visit_keyword_rest_parameter_node(node); end + + # Inspect a LambdaNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1354 + def visit_lambda_node(node); end + + # Inspect a LocalVariableAndWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1375 + def visit_local_variable_and_write_node(node); end + + # Inspect a LocalVariableOperatorWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1386 + def visit_local_variable_operator_write_node(node); end + + # Inspect a LocalVariableOrWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1398 + def visit_local_variable_or_write_node(node); end + + # Inspect a LocalVariableReadNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1409 + def visit_local_variable_read_node(node); end + + # Inspect a LocalVariableTargetNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1416 + def visit_local_variable_target_node(node); end + + # Inspect a LocalVariableWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1423 + def visit_local_variable_write_node(node); end + + # Inspect a MatchLastLineNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1434 + def visit_match_last_line_node(node); end + + # Inspect a MatchPredicateNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1445 + def visit_match_predicate_node(node); end + + # Inspect a MatchRequiredNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1455 + def visit_match_required_node(node); end + + # Inspect a MatchWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1465 + def visit_match_write_node(node); end + + # Inspect a MissingNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1481 + def visit_missing_node(node); end + + # Inspect a ModuleNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1486 + def visit_module_node(node); end + + # Inspect a MultiTargetNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1503 + def visit_multi_target_node(node); end + + # Inspect a MultiWriteNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1534 + def visit_multi_write_node(node); end + + # Inspect a NextNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1568 + def visit_next_node(node); end + + # Inspect a NilNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1580 + def visit_nil_node(node); end + + # Inspect a NoKeywordsParameterNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1585 + def visit_no_keywords_parameter_node(node); end + + # Inspect a NumberedParametersNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1592 + def visit_numbered_parameters_node(node); end + + # Inspect a NumberedReferenceReadNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1598 + def visit_numbered_reference_read_node(node); end + + # Inspect a OptionalKeywordParameterNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1604 + def visit_optional_keyword_parameter_node(node); end + + # Inspect a OptionalParameterNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1615 + def visit_optional_parameter_node(node); end + + # Inspect a OrNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1627 + def visit_or_node(node); end + + # Inspect a ParametersNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1637 + def visit_parameters_node(node); end + + # Inspect a ParenthesesNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1696 + def visit_parentheses_node(node); end + + # Inspect a PinnedExpressionNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1709 + def visit_pinned_expression_node(node); end + + # Inspect a PinnedVariableNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1719 + def visit_pinned_variable_node(node); end + + # Inspect a PostExecutionNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1727 + def visit_post_execution_node(node); end + + # Inspect a PreExecutionNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1741 + def visit_pre_execution_node(node); end + + # Inspect a ProgramNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1755 + def visit_program_node(node); end + + # Inspect a RangeNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1763 + def visit_range_node(node); end + + # Inspect a RationalNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1783 + def visit_rational_node(node); end + + # Inspect a RedoNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1792 + def visit_redo_node(node); end + + # Inspect a RegularExpressionNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1797 + def visit_regular_expression_node(node); end + + # Inspect a RequiredKeywordParameterNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1808 + def visit_required_keyword_parameter_node(node); end + + # Inspect a RequiredParameterNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1817 + def visit_required_parameter_node(node); end + + # Inspect a RescueModifierNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1825 + def visit_rescue_modifier_node(node); end + + # Inspect a RescueNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1835 + def visit_rescue_node(node); end + + # Inspect a RestParameterNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1869 + def visit_rest_parameter_node(node); end + + # Inspect a RetryNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1883 + def visit_retry_node(node); end + + # Inspect a ReturnNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1888 + def visit_return_node(node); end + + # Inspect a SelfNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1902 + def visit_self_node(node); end + + # Inspect a ShareableConstantNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1907 + def visit_shareable_constant_node(node); end + + # Inspect a SingletonClassNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1916 + def visit_singleton_class_node(node); end + + # Inspect a SourceEncodingNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1933 + def visit_source_encoding_node(node); end + + # Inspect a SourceFileNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1938 + def visit_source_file_node(node); end + + # Inspect a SourceLineNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1946 + def visit_source_line_node(node); end + + # Inspect a SplatNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1951 + def visit_splat_node(node); end + + # Inspect a StatementsNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1963 + def visit_statements_node(node); end + + # Inspect a StringNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1977 + def visit_string_node(node); end + + # Inspect a SuperNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#1988 + def visit_super_node(node); end + + # Inspect a SymbolNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#2008 + def visit_symbol_node(node); end + + # Inspect a TrueNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#2019 + def visit_true_node(node); end + + # Inspect a UndefNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#2024 + def visit_undef_node(node); end + + # Inspect a UnlessNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#2039 + def visit_unless_node(node); end + + # Inspect a UntilNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#2061 + def visit_until_node(node); end + + # Inspect a WhenNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#2078 + def visit_when_node(node); end + + # Inspect a WhileNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#2100 + def visit_while_node(node); end + + # Inspect a XStringNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#2117 + def visit_x_string_node(node); end + + # Inspect a YieldNode node. + # + # source://prism//lib/prism/inspect_visitor.rb#2128 + def visit_yield_node(node); end + + private + + # Compose a string representing the given inner location field. + # + # source://prism//lib/prism/inspect_visitor.rb#2150 + def inspect_location(location); end + + # Compose a header for the given node. + # + # source://prism//lib/prism/inspect_visitor.rb#2144 + def inspect_node(name, node); end + + class << self + # Compose an inspect string for the given node. + # + # source://prism//lib/prism/inspect_visitor.rb#41 + 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. +# +# source://prism//lib/prism/inspect_visitor.rb#17 +class Prism::InspectVisitor::Replace + # @return [Replace] a new instance of Replace + # + # source://prism//lib/prism/inspect_visitor.rb#20 + def initialize(value); end + + # source://prism//lib/prism/inspect_visitor.rb#18 + def value; end +end + +# Represents the use of the `&&=` operator for assignment to an instance variable. +# +# @target &&= value +# ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#9866 +class Prism::InstanceVariableAndWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # + # @return [InstanceVariableAndWriteNode] a new instance of InstanceVariableAndWriteNode + # + # source://prism//lib/prism/node.rb#9868 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#9970 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#9878 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#9883 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#9893 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#9888 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> InstanceVariableAndWriteNode + # + # source://prism//lib/prism/node.rb#9898 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::InstanceVariableAndWriteNode) + end + def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#9883 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#9906 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # source://prism//lib/prism/desugar_compiler.rb#181 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#9936 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#9911 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#9914 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#9931 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#9921 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#9954 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#9928 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#9964 + def type; end + end +end + +# Represents assigning to an instance variable using an operator that isn't `=`. +# +# @target += value +# ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#9983 +class Prism::InstanceVariableOperatorWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void + # + # @return [InstanceVariableOperatorWriteNode] a new instance of InstanceVariableOperatorWriteNode + # + # source://prism//lib/prism/node.rb#9985 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#10086 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#9996 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader binary_operator: Symbol + # + # source://prism//lib/prism/node.rb#10049 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # source://prism//lib/prism/node.rb#10039 + sig { returns(Prism::Location) } + def binary_operator_loc; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#10001 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#10011 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#10006 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> InstanceVariableOperatorWriteNode + # + # source://prism//lib/prism/node.rb#10016 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).returns(Prism::InstanceVariableOperatorWriteNode) + end + def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#10001 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#10024 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # source://prism//lib/prism/desugar_compiler.rb#193 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#10052 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#10029 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#10032 + 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. + # + # source://prism//lib/prism/node_ext.rb#419 + 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. + # + # source://prism//lib/prism/node_ext.rb#426 + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#10070 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#10046 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#10080 + def type; end + end +end + +# Represents the use of the `||=` operator for assignment to an instance variable. +# +# @target ||= value +# ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#10100 +class Prism::InstanceVariableOrWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # + # @return [InstanceVariableOrWriteNode] a new instance of InstanceVariableOrWriteNode + # + # source://prism//lib/prism/node.rb#10102 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#10204 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#10112 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#10117 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#10127 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#10122 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> InstanceVariableOrWriteNode + # + # source://prism//lib/prism/node.rb#10132 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::InstanceVariableOrWriteNode) + end + def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#10117 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#10140 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # source://prism//lib/prism/desugar_compiler.rb#187 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#10170 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#10145 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#10148 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#10165 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#10155 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#10188 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#10162 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#10198 + def type; end + end +end + +# Represents referencing an instance variable. +# +# @foo +# ^^^^ +# +# source://prism//lib/prism/node.rb#10217 +class Prism::InstanceVariableReadNode < ::Prism::Node + # def initialize: (Symbol name, Location location) -> void + # + # @return [InstanceVariableReadNode] a new instance of InstanceVariableReadNode + # + # source://prism//lib/prism/node.rb#10219 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } + def initialize(source, name, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#10300 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#10226 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#10231 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#10241 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#10236 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?location: Location) -> InstanceVariableReadNode + # + # source://prism//lib/prism/node.rb#10246 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::InstanceVariableReadNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#10231 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#10254 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#10266 + 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` + # + # source://prism//lib/prism/node.rb#10263 + sig { returns(Symbol) } + def name; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#10284 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#10294 + def type; end + end +end + +# Represents writing to an instance variable in a context that doesn't have an explicit value. +# +# @foo, @bar = baz +# ^^^^ ^^^^ +# +# source://prism//lib/prism/node.rb#10310 +class Prism::InstanceVariableTargetNode < ::Prism::Node + # def initialize: (Symbol name, Location location) -> void + # + # @return [InstanceVariableTargetNode] a new instance of InstanceVariableTargetNode + # + # source://prism//lib/prism/node.rb#10312 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } + def initialize(source, name, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#10389 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#10319 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#10324 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#10334 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#10329 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?location: Location) -> InstanceVariableTargetNode + # + # source://prism//lib/prism/node.rb#10339 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::InstanceVariableTargetNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#10324 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#10347 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#10355 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#10352 + sig { returns(Symbol) } + def name; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#10373 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#10383 + def type; end + end +end + +# Represents writing to an instance variable. +# +# @foo = 1 +# ^^^^^^^^ +# +# source://prism//lib/prism/node.rb#10399 +class Prism::InstanceVariableWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void + # + # @return [InstanceVariableWriteNode] a new instance of InstanceVariableWriteNode + # + # source://prism//lib/prism/node.rb#10401 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, value, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#10519 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#10411 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#10416 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#10426 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#10421 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> InstanceVariableWriteNode + # + # source://prism//lib/prism/node.rb#10431 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::InstanceVariableWriteNode) + end + def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#10416 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#10439 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#10485 + 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` + # + # source://prism//lib/prism/node.rb#10448 + sig { returns(Symbol) } + def name; end + + # The location of the variable name. + # + # @_x = 1 + # ^^^ + # + # source://prism//lib/prism/node.rb#10454 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#10480 + sig { returns(String) } + def operator; end + + # The location of the `=` operator. + # + # @x = y + # ^ + # + # source://prism//lib/prism/node.rb#10473 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#10503 + 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 + # ^^^^ + # + # source://prism//lib/prism/node.rb#10467 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#10513 + def type; end + end +end + +# Flags for integer nodes that correspond to the base of the integer. +# +# source://prism//lib/prism/node.rb#19166 +module Prism::IntegerBaseFlags; end + +# 0b prefix +# +# source://prism//lib/prism/node.rb#19168 +Prism::IntegerBaseFlags::BINARY = T.let(T.unsafe(nil), Integer) + +# 0d or no prefix +# +# source://prism//lib/prism/node.rb#19171 +Prism::IntegerBaseFlags::DECIMAL = T.let(T.unsafe(nil), Integer) + +# 0x prefix +# +# source://prism//lib/prism/node.rb#19177 +Prism::IntegerBaseFlags::HEXADECIMAL = T.let(T.unsafe(nil), Integer) + +# 0o or 0 prefix +# +# source://prism//lib/prism/node.rb#19174 +Prism::IntegerBaseFlags::OCTAL = T.let(T.unsafe(nil), Integer) + +# Represents an integer number literal. +# +# 1 +# ^ +# +# source://prism//lib/prism/node.rb#10532 +class Prism::IntegerNode < ::Prism::Node + # def initialize: (Integer flags, Integer value, Location location) -> void + # + # @return [IntegerNode] a new instance of IntegerNode + # + # source://prism//lib/prism/node.rb#10534 + sig { params(source: Prism::Source, flags: Integer, value: Integer, location: Prism::Location).void } + def initialize(source, flags, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#10636 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#10542 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def binary?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10582 + sig { returns(T::Boolean) } + def binary?; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#10547 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#10557 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#10552 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?value: Integer, ?location: Location) -> IntegerNode + # + # source://prism//lib/prism/node.rb#10562 + sig { params(flags: Integer, value: Integer, location: Prism::Location).returns(Prism::IntegerNode) } + def copy(flags: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def decimal?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10587 + sig { returns(T::Boolean) } + def decimal?; end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#10547 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, value: Integer, location: Location } + # + # source://prism//lib/prism/node.rb#10570 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def hexadecimal?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10597 + sig { returns(T::Boolean) } + def hexadecimal?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#10602 + sig { override.returns(String) } + def inspect; end + + # def octal?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10592 + sig { returns(T::Boolean) } + def octal?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#10620 + sig { override.returns(Symbol) } + def type; end + + # The value of the integer literal as a number. + # + # source://prism//lib/prism/node.rb#10579 + sig { returns(Integer) } + def value; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#10575 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#10630 + 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 +# ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#10647 +class Prism::InterpolatedMatchLastLineNode < ::Prism::Node + include ::Prism::RegularExpressionOptions + + # def initialize: (Integer flags, Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc, Location location) -> void + # + # @return [InterpolatedMatchLastLineNode] a new instance of InterpolatedMatchLastLineNode + # + # source://prism//lib/prism/node.rb#10649 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, flags, opening_loc, parts, closing_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#10812 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#10659 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def ascii_8bit?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10738 + sig { returns(T::Boolean) } + def ascii_8bit?; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#10664 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#10773 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#10706 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#10674 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#10669 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location, ?location: Location) -> InterpolatedMatchLastLineNode + # + # source://prism//lib/prism/node.rb#10679 + sig do + params( + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::InterpolatedMatchLastLineNode) + end + def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#10664 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#10687 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def euc_jp?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10733 + sig { returns(T::Boolean) } + def euc_jp?; end + + # def extended?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10718 + sig { returns(T::Boolean) } + def extended?; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def forced_binary_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10758 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_us_ascii_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10763 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10753 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def ignore_case?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10713 + sig { returns(T::Boolean) } + def ignore_case?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#10778 + sig { override.returns(String) } + def inspect; end + + # def multi_line?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10723 + sig { returns(T::Boolean) } + def multi_line?; end + + # source://prism//lib/prism/parse_result/newlines.rb#121 + def newline!(lines); end + + # def once?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10728 + sig { returns(T::Boolean) } + def once?; end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#10768 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#10696 + sig { returns(Prism::Location) } + def opening_loc; end + + sig { returns(Integer) } + def options; end + + # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] + # + # source://prism//lib/prism/node.rb#10703 + sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } + def parts; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#10796 + sig { override.returns(Symbol) } + def type; end + + # def utf_8?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10748 + sig { returns(T::Boolean) } + def utf_8?; end + + # def windows_31j?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10743 + sig { returns(T::Boolean) } + def windows_31j?; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#10692 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#10806 + def type; end + end +end + +# Represents a regular expression literal that contains interpolation. +# +# /foo #{bar} baz/ +# ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#10826 +class Prism::InterpolatedRegularExpressionNode < ::Prism::Node + include ::Prism::RegularExpressionOptions + + # def initialize: (Integer flags, Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc, Location location) -> void + # + # @return [InterpolatedRegularExpressionNode] a new instance of InterpolatedRegularExpressionNode + # + # source://prism//lib/prism/node.rb#10828 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, flags, opening_loc, parts, closing_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#10991 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#10838 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def ascii_8bit?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10917 + sig { returns(T::Boolean) } + def ascii_8bit?; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#10843 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#10952 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#10885 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#10853 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#10848 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location, ?location: Location) -> InterpolatedRegularExpressionNode + # + # source://prism//lib/prism/node.rb#10858 + sig do + params( + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::InterpolatedRegularExpressionNode) + end + def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#10843 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#10866 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def euc_jp?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10912 + sig { returns(T::Boolean) } + def euc_jp?; end + + # def extended?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10897 + sig { returns(T::Boolean) } + def extended?; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def forced_binary_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10937 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_us_ascii_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10942 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10932 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def ignore_case?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10892 + sig { returns(T::Boolean) } + def ignore_case?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#10957 + sig { override.returns(String) } + def inspect; end + + # def multi_line?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10902 + sig { returns(T::Boolean) } + def multi_line?; end + + # source://prism//lib/prism/parse_result/newlines.rb#128 + def newline!(lines); end + + # def once?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10907 + sig { returns(T::Boolean) } + def once?; end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#10947 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#10875 + sig { returns(Prism::Location) } + def opening_loc; end + + sig { returns(Integer) } + def options; end + + # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] + # + # source://prism//lib/prism/node.rb#10882 + sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } + def parts; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#10975 + sig { override.returns(Symbol) } + def type; end + + # def utf_8?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10927 + sig { returns(T::Boolean) } + def utf_8?; end + + # def windows_31j?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10922 + sig { returns(T::Boolean) } + def windows_31j?; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#10871 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#10985 + def type; end + end +end + +# Represents a string literal that contains interpolation. +# +# "foo #{bar} baz" +# ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#11005 +class Prism::InterpolatedStringNode < ::Prism::Node + include ::Prism::HeredocQuery + + # def initialize: (Integer flags, Location? opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode] parts, Location? closing_loc, Location location) -> void + # + # @return [InterpolatedStringNode] a new instance of InterpolatedStringNode + # + # source://prism//lib/prism/node.rb#11007 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode, Prism::InterpolatedStringNode)], + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end + def initialize(source, flags, opening_loc, parts, closing_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#11137 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#11017 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11022 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # source://prism//lib/prism/node.rb#11098 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism//lib/prism/node.rb#11070 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#11032 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#11027 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode], ?closing_loc: Location?, ?location: Location) -> InterpolatedStringNode + # + # source://prism//lib/prism/node.rb#11037 + sig do + params( + flags: Integer, + opening_loc: T.nilable(Prism::Location), + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode, Prism::InterpolatedStringNode)], + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::InterpolatedStringNode) + end + def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11022 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location?, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode], closing_loc: Location?, location: Location } + # + # source://prism//lib/prism/node.rb#11045 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def frozen?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#11083 + sig { returns(T::Boolean) } + def frozen?; end + + sig { returns(T::Boolean) } + def heredoc?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#11103 + sig { override.returns(String) } + def inspect; end + + # def mutable?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#11088 + sig { returns(T::Boolean) } + def mutable?; end + + # source://prism//lib/prism/parse_result/newlines.rb#135 + def newline!(lines); end + + # def opening: () -> String? + # + # source://prism//lib/prism/node.rb#11093 + sig { returns(T.nilable(String)) } + def opening; end + + # attr_reader opening_loc: Location? + # + # source://prism//lib/prism/node.rb#11054 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode] + # + # source://prism//lib/prism/node.rb#11067 + sig do + returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode, Prism::InterpolatedStringNode)]) + end + def parts; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#11121 + sig { override.returns(Symbol) } + def type; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#11050 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#11131 + def type; end + end +end + +# Flags for interpolated string nodes that indicated mutability if they are also marked as literals. +# +# source://prism//lib/prism/node.rb#19181 +module Prism::InterpolatedStringNodeFlags; end + +# source://prism//lib/prism/node.rb#19183 +Prism::InterpolatedStringNodeFlags::FROZEN = T.let(T.unsafe(nil), Integer) + +# source://prism//lib/prism/node.rb#19186 +Prism::InterpolatedStringNodeFlags::MUTABLE = T.let(T.unsafe(nil), Integer) + +# Represents a symbol literal that contains interpolation. +# +# :"foo #{bar} baz" +# ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#11151 +class Prism::InterpolatedSymbolNode < ::Prism::Node + # def initialize: (Location? opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location? closing_loc, Location location) -> void + # + # @return [InterpolatedSymbolNode] a new instance of InterpolatedSymbolNode + # + # source://prism//lib/prism/node.rb#11153 + sig do + params( + source: Prism::Source, + opening_loc: T.nilable(Prism::Location), + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end + def initialize(source, opening_loc, parts, closing_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#11268 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#11162 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11167 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # source://prism//lib/prism/node.rb#11229 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism//lib/prism/node.rb#11211 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#11177 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#11172 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location?, ?location: Location) -> InterpolatedSymbolNode + # + # source://prism//lib/prism/node.rb#11182 + sig do + params( + opening_loc: T.nilable(Prism::Location), + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::InterpolatedSymbolNode) + end + def copy(opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11167 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location?, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location?, location: Location } + # + # source://prism//lib/prism/node.rb#11190 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#11234 + sig { override.returns(String) } + def inspect; end + + # source://prism//lib/prism/parse_result/newlines.rb#142 + def newline!(lines); end + + # def opening: () -> String? + # + # source://prism//lib/prism/node.rb#11224 + sig { returns(T.nilable(String)) } + def opening; end + + # attr_reader opening_loc: Location? + # + # source://prism//lib/prism/node.rb#11195 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] + # + # source://prism//lib/prism/node.rb#11208 + sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } + def parts; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#11252 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#11262 + def type; end + end +end + +# Represents an xstring literal that contains interpolation. +# +# `foo #{bar} baz` +# ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#11281 +class Prism::InterpolatedXStringNode < ::Prism::Node + include ::Prism::HeredocQuery + + # def initialize: (Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc, Location location) -> void + # + # @return [InterpolatedXStringNode] a new instance of InterpolatedXStringNode + # + # source://prism//lib/prism/node.rb#11283 + sig do + params( + source: Prism::Source, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, opening_loc, parts, closing_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#11386 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#11292 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11297 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#11347 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#11335 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#11307 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#11302 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location, ?location: Location) -> InterpolatedXStringNode + # + # source://prism//lib/prism/node.rb#11312 + sig do + params( + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::InterpolatedXStringNode) + end + def copy(opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11297 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#11320 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + sig { returns(T::Boolean) } + def heredoc?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#11352 + sig { override.returns(String) } + def inspect; end + + # source://prism//lib/prism/parse_result/newlines.rb#149 + def newline!(lines); end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#11342 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#11325 + sig { returns(Prism::Location) } + def opening_loc; end + + # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] + # + # source://prism//lib/prism/node.rb#11332 + sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } + def parts; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#11370 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#11380 + def type; end + end +end + +# Represents reading from the implicit `it` local variable. +# +# -> { it } +# ^^ +# +# source://prism//lib/prism/node.rb#11399 +class Prism::ItLocalVariableReadNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [ItLocalVariableReadNode] a new instance of ItLocalVariableReadNode + # + # source://prism//lib/prism/node.rb#11401 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#11474 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#11407 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11412 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#11422 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#11417 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?location: Location) -> ItLocalVariableReadNode + # + # source://prism//lib/prism/node.rb#11427 + sig { params(location: Prism::Location).returns(Prism::ItLocalVariableReadNode) } + def copy(location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11412 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#11435 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#11440 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#11458 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#11468 + 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 } +# ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#11483 +class Prism::ItParametersNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [ItParametersNode] a new instance of ItParametersNode + # + # source://prism//lib/prism/node.rb#11485 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#11558 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#11491 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11496 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#11506 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#11501 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?location: Location) -> ItParametersNode + # + # source://prism//lib/prism/node.rb#11511 + sig { params(location: Prism::Location).returns(Prism::ItParametersNode) } + def copy(location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11496 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#11519 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#11524 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#11542 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#11552 + def type; end + end +end + +# Represents a hash literal without opening and closing braces. +# +# foo(a: b) +# ^^^^ +# +# source://prism//lib/prism/node.rb#11567 +class Prism::KeywordHashNode < ::Prism::Node + # def initialize: (Integer flags, Array[AssocNode | AssocSplatNode] elements, Location location) -> void + # + # @return [KeywordHashNode] a new instance of KeywordHashNode + # + # source://prism//lib/prism/node.rb#11569 + sig do + params( + source: Prism::Source, + flags: Integer, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], + location: Prism::Location + ).void + end + def initialize(source, flags, elements, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#11656 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#11577 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11582 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#11592 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#11587 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?elements: Array[AssocNode | AssocSplatNode], ?location: Location) -> KeywordHashNode + # + # source://prism//lib/prism/node.rb#11597 + sig do + params( + flags: Integer, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], + location: Prism::Location + ).returns(Prism::KeywordHashNode) + end + def copy(flags: T.unsafe(nil), elements: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11582 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, elements: Array[AssocNode | AssocSplatNode], location: Location } + # + # source://prism//lib/prism/node.rb#11605 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # attr_reader elements: Array[AssocNode | AssocSplatNode] + # + # source://prism//lib/prism/node.rb#11614 + 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 + # + # source://prism//lib/prism/node.rb#11622 + sig { override.returns(String) } + def inspect; end + + # def symbol_keys?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#11617 + sig { returns(T::Boolean) } + def symbol_keys?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#11640 + sig { override.returns(Symbol) } + def type; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#11610 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#11650 + def type; end + end +end + +# Flags for keyword hash nodes. +# +# source://prism//lib/prism/node.rb#19190 +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 +# +# source://prism//lib/prism/node.rb#19192 +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 +# +# source://prism//lib/prism/node.rb#11669 +class Prism::KeywordRestParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void + # + # @return [KeywordRestParameterNode] a new instance of KeywordRestParameterNode + # + # source://prism//lib/prism/node.rb#11671 + sig do + params( + source: Prism::Source, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, flags, name, name_loc, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#11785 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#11681 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11686 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#11696 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#11691 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location, ?location: Location) -> KeywordRestParameterNode + # + # source://prism//lib/prism/node.rb#11701 + sig do + params( + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::KeywordRestParameterNode) + end + def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11686 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#11709 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#11751 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol? + # + # source://prism//lib/prism/node.rb#11718 + sig { returns(T.nilable(Symbol)) } + def name; end + + # attr_reader name_loc: Location? + # + # source://prism//lib/prism/node.rb#11721 + sig { returns(T.nilable(Prism::Location)) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#11746 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#11734 + sig { returns(Prism::Location) } + def operator_loc; end + + # def repeated_parameter?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#11741 + sig { returns(T::Boolean) } + def repeated_parameter?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#11769 + sig { override.returns(Symbol) } + def type; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#11714 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#11779 + def type; end + end +end + +# Represents using a lambda literal (not the lambda method call). +# +# ->(value) { value * 2 } +# ^^^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#11798 +class Prism::LambdaNode < ::Prism::Node + # def initialize: (Array[Symbol] locals, Location operator_loc, Location opening_loc, Location closing_loc, Prism::node? parameters, Prism::node? body, Location location) -> void + # + # @return [LambdaNode] a new instance of LambdaNode + # + # source://prism//lib/prism/node.rb#11800 + sig do + params( + source: Prism::Source, + locals: T::Array[Symbol], + operator_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + parameters: T.nilable(Prism::Node), + body: T.nilable(Prism::Node), + location: Prism::Location + ).void + end + def initialize(source, locals, operator_loc, opening_loc, closing_loc, parameters, body, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#11927 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#11812 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader body: Prism::node? + # + # source://prism//lib/prism/node.rb#11875 + sig { returns(T.nilable(Prism::Node)) } + def body; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11817 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#11888 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#11865 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#11830 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#11822 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?locals: Array[Symbol], ?operator_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?parameters: Prism::node?, ?body: Prism::node?, ?location: Location) -> LambdaNode + # + # source://prism//lib/prism/node.rb#11835 + sig do + params( + locals: T::Array[Symbol], + operator_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + parameters: T.nilable(Prism::Node), + body: T.nilable(Prism::Node), + location: Prism::Location + ).returns(Prism::LambdaNode) + end + def copy(locals: T.unsafe(nil), operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11817 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], operator_loc: Location, opening_loc: Location, closing_loc: Location, parameters: Prism::node?, body: Prism::node?, location: Location } + # + # source://prism//lib/prism/node.rb#11843 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#11893 + sig { override.returns(String) } + def inspect; end + + # attr_reader locals: Array[Symbol] + # + # source://prism//lib/prism/node.rb#11848 + sig { returns(T::Array[Symbol]) } + def locals; end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#11883 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#11858 + sig { returns(Prism::Location) } + def opening_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#11878 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#11851 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader parameters: Prism::node? + # + # source://prism//lib/prism/node.rb#11872 + sig { returns(T.nilable(Prism::Node)) } + def parameters; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#11911 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#11921 + 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. +# +# source://prism//lib/prism/lex_compat.rb#12 +class Prism::LexCompat + # @return [LexCompat] a new instance of LexCompat + # + # source://prism//lib/prism/lex_compat.rb#619 + def initialize(source, **options); end + + # Returns the value of attribute options. + # + # source://prism//lib/prism/lex_compat.rb#617 + def options; end + + # source://prism//lib/prism/lex_compat.rb#624 + def result; end + + # Returns the value of attribute source. + # + # source://prism//lib/prism/lex_compat.rb#617 + def source; end +end + +# Ripper doesn't include the rest of the token in the event, so we need to +# trim it down to just the content on the first line when comparing. +# +# source://prism//lib/prism/lex_compat.rb#230 +class Prism::LexCompat::EndContentToken < ::Prism::LexCompat::Token + # source://prism//lib/prism/lex_compat.rb#231 + def ==(other); end +end + +# 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. +# +# source://prism//lib/prism/lex_compat.rb#291 +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. + # + # source://prism//lib/prism/lex_compat.rb#603 + 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. +# +# source://prism//lib/prism/lex_compat.rb#315 +class Prism::LexCompat::Heredoc::DashHeredoc + # @return [DashHeredoc] a new instance of DashHeredoc + # + # source://prism//lib/prism/lex_compat.rb#318 + def initialize(split); end + + # source://prism//lib/prism/lex_compat.rb#323 + def <<(token); end + + # source://prism//lib/prism/lex_compat.rb#316 + def split; end + + # source://prism//lib/prism/lex_compat.rb#327 + def to_a; end + + # source://prism//lib/prism/lex_compat.rb#316 + 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. +# +# source://prism//lib/prism/lex_compat.rb#374 +class Prism::LexCompat::Heredoc::DedentingHeredoc + # @return [DedentingHeredoc] a new instance of DedentingHeredoc + # + # source://prism//lib/prism/lex_compat.rb#379 + 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. + # + # source://prism//lib/prism/lex_compat.rb#390 + def <<(token); end + + # Returns the value of attribute dedent. + # + # source://prism//lib/prism/lex_compat.rb#377 + def dedent; end + + # Returns the value of attribute dedent_next. + # + # source://prism//lib/prism/lex_compat.rb#377 + def dedent_next; end + + # Returns the value of attribute embexpr_balance. + # + # source://prism//lib/prism/lex_compat.rb#377 + def embexpr_balance; end + + # source://prism//lib/prism/lex_compat.rb#427 + def to_a; end + + # Returns the value of attribute tokens. + # + # source://prism//lib/prism/lex_compat.rb#377 + def tokens; end +end + +# source://prism//lib/prism/lex_compat.rb#375 +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. +# +# source://prism//lib/prism/lex_compat.rb#296 +class Prism::LexCompat::Heredoc::PlainHeredoc + # @return [PlainHeredoc] a new instance of PlainHeredoc + # + # source://prism//lib/prism/lex_compat.rb#299 + def initialize; end + + # source://prism//lib/prism/lex_compat.rb#303 + def <<(token); end + + # source://prism//lib/prism/lex_compat.rb#307 + def to_a; end + + # source://prism//lib/prism/lex_compat.rb#297 + def tokens; end +end + +# Ident tokens for the most part are exactly the same, except sometimes we +# know an ident is a local when ripper doesn't (when they are introduced +# through named captures in regular expressions). In that case we don't +# compare the state. +# +# source://prism//lib/prism/lex_compat.rb#248 +class Prism::LexCompat::IdentToken < ::Prism::LexCompat::Token + # source://prism//lib/prism/lex_compat.rb#249 + def ==(other); end +end + +# Tokens where state should be ignored +# used for :on_comment, :on_heredoc_end, :on_embexpr_end +# +# source://prism//lib/prism/lex_compat.rb#238 +class Prism::LexCompat::IgnoreStateToken < ::Prism::LexCompat::Token + # source://prism//lib/prism/lex_compat.rb#239 + def ==(other); end +end + +# Ignored newlines can occasionally have a LABEL state attached to them, so +# we compare the state differently here. +# +# source://prism//lib/prism/lex_compat.rb#259 +class Prism::LexCompat::IgnoredNewlineToken < ::Prism::LexCompat::Token + # source://prism//lib/prism/lex_compat.rb#260 + def ==(other); end +end + +# If we have an identifier that follows a method name like: +# +# def foo bar +# +# then Ripper will mark bar as END|LABEL if there is a local in a parent +# scope named bar because it hasn't pushed the local table yet. We do this +# more accurately, so we need to allow comparing against both END and +# END|LABEL. +# +# source://prism//lib/prism/lex_compat.rb#279 +class Prism::LexCompat::ParamToken < ::Prism::LexCompat::Token + # source://prism//lib/prism/lex_compat.rb#280 + 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. +# +# source://prism//lib/prism/lex_compat.rb#33 +Prism::LexCompat::RIPPER = T.let(T.unsafe(nil), Hash) + +# A result class specialized for holding tokens produced by the lexer. +# +# source://prism//lib/prism/lex_compat.rb#14 +class Prism::LexCompat::Result < ::Prism::Result + # Create a new lex compat result object with the given values. + # + # @return [Result] a new instance of Result + # + # source://prism//lib/prism/lex_compat.rb#19 + def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end + + # Implement the hash pattern matching interface for Result. + # + # source://prism//lib/prism/lex_compat.rb#25 + def deconstruct_keys(keys); end + + # The list of tokens that were produced by the lexer. + # + # source://prism//lib/prism/lex_compat.rb#16 + 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. +# +# source://prism//lib/prism/lex_compat.rb#204 +class Prism::LexCompat::Token < ::SimpleDelegator + # The type of the token. + # + # source://prism//lib/prism/lex_compat.rb#213 + def event; end + + # The location of the token in the source. + # + # source://prism//lib/prism/lex_compat.rb#208 + def location; end + + # The state of the lexer when this token was produced. + # + # source://prism//lib/prism/lex_compat.rb#223 + def state; end + + # The slice of the source that this token represents. + # + # source://prism//lib/prism/lex_compat.rb#218 + def value; end +end + +# This is a result specific to the `lex` and `lex_file` methods. +# +# source://prism//lib/prism/parse_result.rb#610 +class Prism::LexResult < ::Prism::Result + # Create a new lex result object with the given values. + # + # @return [LexResult] a new instance of LexResult + # + # source://prism//lib/prism/parse_result.rb#615 + 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. + # + # source://prism//lib/prism/parse_result.rb#621 + 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. + # + # source://prism//lib/prism/parse_result.rb#612 + sig { returns(T::Array[T.untyped]) } + def value; end +end + +# This is a class that wraps the Ripper lexer to produce almost exactly the +# same tokens. +# +# source://prism//lib/prism/lex_compat.rb#872 +class Prism::LexRipper + # @return [LexRipper] a new instance of LexRipper + # + # source://prism//lib/prism/lex_compat.rb#875 + def initialize(source); end + + # source://prism//lib/prism/lex_compat.rb#879 + def result; end + + # source://prism//lib/prism/lex_compat.rb#873 + def source; end + + private + + # source://prism//lib/prism/lex_compat.rb#913 + def lex(source); end +end + +# Represents the use of the `&&=` operator for assignment to a local variable. +# +# target &&= value +# ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#11943 +class Prism::LocalVariableAndWriteNode < ::Prism::Node + # def initialize: (Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth, Location location) -> void + # + # @return [LocalVariableAndWriteNode] a new instance of LocalVariableAndWriteNode + # + # source://prism//lib/prism/node.rb#11945 + sig do + params( + source: Prism::Source, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer, + location: Prism::Location + ).void + end + def initialize(source, name_loc, operator_loc, value, name, depth, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#12051 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#11956 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11961 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#11971 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#11966 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableAndWriteNode + # + # source://prism//lib/prism/node.rb#11976 + sig do + params( + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer, + location: Prism::Location + ).returns(Prism::LocalVariableAndWriteNode) + end + def copy(name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#11961 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer, location: Location } + # + # source://prism//lib/prism/node.rb#11984 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # attr_reader depth: Integer + # + # source://prism//lib/prism/node.rb#12009 + sig { returns(Integer) } + def depth; end + + # source://prism//lib/prism/desugar_compiler.rb#199 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#12017 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#12006 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#11989 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#12012 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#11996 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#12035 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#12003 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#12045 + def type; end + end +end + +# Represents assigning to a local variable using an operator that isn't `=`. +# +# target += value +# ^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#12065 +class Prism::LocalVariableOperatorWriteNode < ::Prism::Node + # def initialize: (Location name_loc, Location binary_operator_loc, Prism::node value, Symbol name, Symbol binary_operator, Integer depth, Location location) -> void + # + # @return [LocalVariableOperatorWriteNode] a new instance of LocalVariableOperatorWriteNode + # + # source://prism//lib/prism/node.rb#12067 + sig do + params( + source: Prism::Source, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + binary_operator: Symbol, + depth: Integer, + location: Prism::Location + ).void + end + def initialize(source, name_loc, binary_operator_loc, value, name, binary_operator, depth, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#12172 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#12079 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader binary_operator: Symbol + # + # source://prism//lib/prism/node.rb#12132 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # source://prism//lib/prism/node.rb#12119 + sig { returns(Prism::Location) } + def binary_operator_loc; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#12084 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#12094 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#12089 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?binary_operator: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableOperatorWriteNode + # + # source://prism//lib/prism/node.rb#12099 + sig do + params( + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + binary_operator: Symbol, + depth: Integer, + location: Prism::Location + ).returns(Prism::LocalVariableOperatorWriteNode) + end + def copy(name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), binary_operator: T.unsafe(nil), depth: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#12084 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, binary_operator_loc: Location, value: Prism::node, name: Symbol, binary_operator: Symbol, depth: Integer, location: Location } + # + # source://prism//lib/prism/node.rb#12107 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # attr_reader depth: Integer + # + # source://prism//lib/prism/node.rb#12135 + sig { returns(Integer) } + def depth; end + + # source://prism//lib/prism/desugar_compiler.rb#211 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#12138 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#12129 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#12112 + 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. + # + # source://prism//lib/prism/node_ext.rb#435 + 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. + # + # source://prism//lib/prism/node_ext.rb#442 + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#12156 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#12126 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#12166 + def type; end + end +end + +# Represents the use of the `||=` operator for assignment to a local variable. +# +# target ||= value +# ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#12187 +class Prism::LocalVariableOrWriteNode < ::Prism::Node + # def initialize: (Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth, Location location) -> void + # + # @return [LocalVariableOrWriteNode] a new instance of LocalVariableOrWriteNode + # + # source://prism//lib/prism/node.rb#12189 + sig do + params( + source: Prism::Source, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer, + location: Prism::Location + ).void + end + def initialize(source, name_loc, operator_loc, value, name, depth, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#12295 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#12200 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#12205 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#12215 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#12210 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableOrWriteNode + # + # source://prism//lib/prism/node.rb#12220 + sig do + params( + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer, + location: Prism::Location + ).returns(Prism::LocalVariableOrWriteNode) + end + def copy(name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#12205 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer, location: Location } + # + # source://prism//lib/prism/node.rb#12228 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # attr_reader depth: Integer + # + # source://prism//lib/prism/node.rb#12253 + sig { returns(Integer) } + def depth; end + + # source://prism//lib/prism/desugar_compiler.rb#205 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#12261 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#12250 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#12233 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#12256 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#12240 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#12279 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#12247 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#12289 + 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 +# ^^^ +# +# source://prism//lib/prism/node.rb#12309 +class Prism::LocalVariableReadNode < ::Prism::Node + # def initialize: (Symbol name, Integer depth, Location location) -> void + # + # @return [LocalVariableReadNode] a new instance of LocalVariableReadNode + # + # source://prism//lib/prism/node.rb#12311 + sig { params(source: Prism::Source, name: Symbol, depth: Integer, location: Prism::Location).void } + def initialize(source, name, depth, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#12406 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#12319 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#12324 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#12334 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#12329 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableReadNode + # + # source://prism//lib/prism/node.rb#12339 + sig { params(name: Symbol, depth: Integer, location: Prism::Location).returns(Prism::LocalVariableReadNode) } + def copy(name: T.unsafe(nil), depth: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#12324 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, location: Location } + # + # source://prism//lib/prism/node.rb#12347 + 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). + # + # source://prism//lib/prism/node.rb#12369 + sig { returns(Integer) } + def depth; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#12372 + 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` + # + # source://prism//lib/prism/node.rb#12360 + sig { returns(Symbol) } + def name; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#12390 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#12400 + def type; end + end +end + +# Represents writing to a local variable in a context that doesn't have an explicit value. +# +# foo, bar = baz +# ^^^ ^^^ +# +# source://prism//lib/prism/node.rb#12417 +class Prism::LocalVariableTargetNode < ::Prism::Node + # def initialize: (Symbol name, Integer depth, Location location) -> void + # + # @return [LocalVariableTargetNode] a new instance of LocalVariableTargetNode + # + # source://prism//lib/prism/node.rb#12419 + sig { params(source: Prism::Source, name: Symbol, depth: Integer, location: Prism::Location).void } + def initialize(source, name, depth, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#12500 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#12427 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#12432 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#12442 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#12437 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableTargetNode + # + # source://prism//lib/prism/node.rb#12447 + sig { params(name: Symbol, depth: Integer, location: Prism::Location).returns(Prism::LocalVariableTargetNode) } + def copy(name: T.unsafe(nil), depth: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#12432 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, location: Location } + # + # source://prism//lib/prism/node.rb#12455 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # attr_reader depth: Integer + # + # source://prism//lib/prism/node.rb#12463 + sig { returns(Integer) } + def depth; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#12466 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#12460 + sig { returns(Symbol) } + def name; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#12484 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#12494 + def type; end + end +end + +# Represents writing to a local variable. +# +# foo = 1 +# ^^^^^^^ +# +# source://prism//lib/prism/node.rb#12511 +class Prism::LocalVariableWriteNode < ::Prism::Node + # def initialize: (Symbol name, Integer depth, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void + # + # @return [LocalVariableWriteNode] a new instance of LocalVariableWriteNode + # + # source://prism//lib/prism/node.rb#12513 + sig do + params( + source: Prism::Source, + name: Symbol, + depth: Integer, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, name, depth, name_loc, value, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#12645 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#12524 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#12529 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#12539 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#12534 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?name: Symbol, ?depth: Integer, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> LocalVariableWriteNode + # + # source://prism//lib/prism/node.rb#12544 + sig do + params( + name: Symbol, + depth: Integer, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::LocalVariableWriteNode) + end + def copy(name: T.unsafe(nil), depth: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#12529 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#12552 + 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). + # + # source://prism//lib/prism/node.rb#12570 + sig { returns(Integer) } + def depth; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#12611 + 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` + # + # source://prism//lib/prism/node.rb#12561 + sig { returns(Symbol) } + def name; end + + # The location of the variable name. + # + # foo = :bar + # ^^^ + # + # source://prism//lib/prism/node.rb#12576 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#12606 + sig { returns(String) } + def operator; end + + # The location of the `=` operator. + # + # x = :y + # ^ + # + # source://prism//lib/prism/node.rb#12599 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#12629 + 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 + # + # source://prism//lib/prism/node.rb#12593 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#12639 + def type; end + end +end + +# This represents a location in the source. +# +# source://prism//lib/prism/parse_result.rb#156 +class Prism::Location + # Create a new location object with the given source, start byte offset, and + # byte length. + # + # @return [Location] a new instance of Location + # + # source://prism//lib/prism/parse_result.rb#171 + 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. + # + # source://prism//lib/prism/parse_result.rb#335 + 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. + # + # source://prism//lib/prism/parse_result.rb#354 + sig { params(string: String).returns(Prism::Location) } + def adjoin(string); end + + # Returns a new location that is the result of chopping off the last byte. + # + # source://prism//lib/prism/parse_result.rb#217 + sig { returns(Prism::Location) } + def chop; end + + # Returns all comments that are associated with this location (both leading + # and trailing comments). + # + # source://prism//lib/prism/parse_result.rb#207 + sig { returns(T::Array[Prism::Comment]) } + def comments; end + + # Create a new location object with the given options. + # + # source://prism//lib/prism/parse_result.rb#212 + sig { params(source: Prism::Source, start_offset: Integer, length: Integer).returns(Prism::Location) } + def copy(source: T.unsafe(nil), start_offset: T.unsafe(nil), length: T.unsafe(nil)); end + + # Implement the hash pattern matching interface for Location. + # + # source://prism//lib/prism/parse_result.rb#325 + 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. + # + # source://prism//lib/prism/parse_result.rb#314 + sig { returns(Integer) } + def end_character_column; end + + # The character offset from the beginning of the source where this location + # ends. + # + # source://prism//lib/prism/parse_result.rb#263 + 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. + # + # source://prism//lib/prism/parse_result.rb#320 + sig { params(encoding: Encoding).returns(Integer) } + def end_code_units_column(encoding = T.unsafe(nil)); end + + # The offset from the start of the file in code units of the given encoding. + # + # source://prism//lib/prism/parse_result.rb#268 + sig { params(encoding: Encoding).returns(Integer) } + def end_code_units_offset(encoding = T.unsafe(nil)); end + + # The column number in bytes where this location ends from the start of the + # line. + # + # source://prism//lib/prism/parse_result.rb#308 + sig { returns(Integer) } + def end_column; end + + # The line number where this location ends. + # + # source://prism//lib/prism/parse_result.rb#284 + sig { returns(Integer) } + def end_line; end + + # The byte offset from the beginning of the source where this location ends. + # + # source://prism//lib/prism/parse_result.rb#257 + sig { returns(Integer) } + def end_offset; end + + # Returns a string representation of this location. + # + # source://prism//lib/prism/parse_result.rb#222 + 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. + # + # source://prism//lib/prism/parse_result.rb#344 + sig { params(other: Prism::Location).returns(Prism::Location) } + def join(other); end + + # Attach a comment to the leading comments of this location. + # + # source://prism//lib/prism/parse_result.rb#190 + 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. + # + # source://prism//lib/prism/parse_result.rb#185 + sig { returns(T::Array[Prism::Comment]) } + def leading_comments; end + + # The length of this location in bytes. + # + # source://prism//lib/prism/parse_result.rb#167 + sig { returns(Integer) } + def length; end + + # Implement the pretty print interface for Location. + # + # source://prism//lib/prism/parse_result.rb#330 + sig { params(q: T.untyped).void } + def pretty_print(q); end + + # The source code that this location represents. + # + # source://prism//lib/prism/parse_result.rb#232 + 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. + # + # source://prism//lib/prism/parse_result.rb#239 + def slice_lines; end + + # Returns all of the lines of the source code associated with this location. + # + # source://prism//lib/prism/parse_result.rb#227 + sig { returns(T::Array[String]) } + def source_lines; end + + # The column number in characters where this location ends from the start of + # the line. + # + # source://prism//lib/prism/parse_result.rb#296 + sig { returns(Integer) } + def start_character_column; end + + # The character offset from the beginning of the source where this location + # starts. + # + # source://prism//lib/prism/parse_result.rb#247 + 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. + # + # source://prism//lib/prism/parse_result.rb#302 + sig { params(encoding: Encoding).returns(Integer) } + def start_code_units_column(encoding = T.unsafe(nil)); end + + # The offset from the start of the file in code units of the given encoding. + # + # source://prism//lib/prism/parse_result.rb#252 + sig { params(encoding: Encoding).returns(Integer) } + def start_code_units_offset(encoding = T.unsafe(nil)); end + + # The column number in bytes where this location starts from the start of + # the line. + # + # source://prism//lib/prism/parse_result.rb#290 + sig { returns(Integer) } + def start_column; end + + # The line number where this location starts. + # + # source://prism//lib/prism/parse_result.rb#273 + sig { returns(Integer) } + def start_line; end + + # The content of the line where this location starts before this location. + # + # source://prism//lib/prism/parse_result.rb#278 + sig { returns(String) } + def start_line_slice; end + + # The byte offset from the beginning of the source where this location + # starts. + # + # source://prism//lib/prism/parse_result.rb#164 + sig { returns(Integer) } + def start_offset; end + + # Attach a comment to the trailing comments of this location. + # + # source://prism//lib/prism/parse_result.rb#201 + 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. + # + # source://prism//lib/prism/parse_result.rb#196 + 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. + # + # source://prism//lib/prism/parse_result.rb#159 + sig { returns(Prism::Source) } + def source; end +end + +# Flags for while and until loop nodes. +# +# source://prism//lib/prism/node.rb#19196 +module Prism::LoopFlags; end + +# a loop after a begin statement, so the body is executed first before the condition +# +# source://prism//lib/prism/node.rb#19198 +Prism::LoopFlags::BEGIN_MODIFIER = T.let(T.unsafe(nil), Integer) + +# This represents a magic comment that was encountered during parsing. +# +# source://prism//lib/prism/parse_result.rb#416 +class Prism::MagicComment + # Create a new magic comment object with the given key and value locations. + # + # @return [MagicComment] a new instance of MagicComment + # + # source://prism//lib/prism/parse_result.rb#424 + 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. + # + # source://prism//lib/prism/parse_result.rb#440 + 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. + # + # source://prism//lib/prism/parse_result.rb#445 + sig { returns(String) } + def inspect; end + + # Returns the key of the magic comment by slicing it from the source code. + # + # source://prism//lib/prism/parse_result.rb#430 + sig { returns(String) } + def key; end + + # A Location object representing the location of the key in the source. + # + # source://prism//lib/prism/parse_result.rb#418 + sig { returns(Prism::Location) } + def key_loc; end + + # Returns the value of the magic comment by slicing it from the source code. + # + # source://prism//lib/prism/parse_result.rb#435 + sig { returns(String) } + def value; end + + # A Location object representing the location of the value in the source. + # + # source://prism//lib/prism/parse_result.rb#421 + 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 +# ^^^^^^ +# +# source://prism//lib/prism/node.rb#12659 +class Prism::MatchLastLineNode < ::Prism::Node + include ::Prism::RegularExpressionOptions + + # def initialize: (Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped, Location location) -> void + # + # @return [MatchLastLineNode] a new instance of MatchLastLineNode + # + # source://prism//lib/prism/node.rb#12661 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).void + end + def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#12837 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#12672 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def ascii_8bit?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#12758 + sig { returns(T::Boolean) } + def ascii_8bit?; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#12677 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#12798 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#12723 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#12687 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#12682 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def content: () -> String + # + # source://prism//lib/prism/node.rb#12793 + sig { returns(String) } + def content; end + + # attr_reader content_loc: Location + # + # source://prism//lib/prism/node.rb#12716 + sig { returns(Prism::Location) } + def content_loc; end + + # def copy: (?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String, ?location: Location) -> MatchLastLineNode + # + # source://prism//lib/prism/node.rb#12692 + sig do + params( + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).returns(Prism::MatchLastLineNode) + end + def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#12677 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location } + # + # source://prism//lib/prism/node.rb#12700 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def euc_jp?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#12753 + sig { returns(T::Boolean) } + def euc_jp?; end + + # def extended?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#12738 + sig { returns(T::Boolean) } + def extended?; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def forced_binary_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#12778 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_us_ascii_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#12783 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#12773 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def ignore_case?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#12733 + sig { returns(T::Boolean) } + def ignore_case?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#12803 + sig { override.returns(String) } + def inspect; end + + # def multi_line?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#12743 + sig { returns(T::Boolean) } + def multi_line?; end + + # def once?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#12748 + sig { returns(T::Boolean) } + def once?; end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#12788 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#12709 + sig { returns(Prism::Location) } + def opening_loc; end + + sig { returns(Integer) } + def options; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#12821 + sig { override.returns(Symbol) } + def type; end + + # attr_reader unescaped: String + # + # source://prism//lib/prism/node.rb#12730 + sig { returns(String) } + def unescaped; end + + # def utf_8?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#12768 + sig { returns(T::Boolean) } + def utf_8?; end + + # def windows_31j?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#12763 + sig { returns(T::Boolean) } + def windows_31j?; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#12705 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#12831 + def type; end + end +end + +# Represents the use of the modifier `in` operator. +# +# foo in bar +# ^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#12851 +class Prism::MatchPredicateNode < ::Prism::Node + # def initialize: (Prism::node value, Prism::node pattern, Location operator_loc, Location location) -> void + # + # @return [MatchPredicateNode] a new instance of MatchPredicateNode + # + # source://prism//lib/prism/node.rb#12853 + sig do + params( + source: Prism::Source, + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, value, pattern, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#12947 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#12862 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#12867 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#12877 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#12872 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location, ?location: Location) -> MatchPredicateNode + # + # source://prism//lib/prism/node.rb#12882 + sig do + params( + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::MatchPredicateNode) + end + def copy(value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#12867 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, pattern: Prism::node, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#12890 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#12913 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#12908 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#12901 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader pattern: Prism::node + # + # source://prism//lib/prism/node.rb#12898 + sig { returns(Prism::Node) } + def pattern; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#12931 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#12895 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#12941 + def type; end + end +end + +# Represents the use of the `=>` operator. +# +# foo => bar +# ^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#12959 +class Prism::MatchRequiredNode < ::Prism::Node + # def initialize: (Prism::node value, Prism::node pattern, Location operator_loc, Location location) -> void + # + # @return [MatchRequiredNode] a new instance of MatchRequiredNode + # + # source://prism//lib/prism/node.rb#12961 + sig do + params( + source: Prism::Source, + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, value, pattern, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#13055 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#12970 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#12975 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#12985 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#12980 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location, ?location: Location) -> MatchRequiredNode + # + # source://prism//lib/prism/node.rb#12990 + sig do + params( + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::MatchRequiredNode) + end + def copy(value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#12975 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, pattern: Prism::node, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#12998 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#13021 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#13016 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#13009 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader pattern: Prism::node + # + # source://prism//lib/prism/node.rb#13006 + sig { returns(Prism::Node) } + def pattern; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13039 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#13003 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13049 + def type; end + end +end + +# Represents writing local variables using a regular expression match with named capture groups. +# +# /(?bar)/ =~ baz +# ^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#13067 +class Prism::MatchWriteNode < ::Prism::Node + # def initialize: (CallNode call, Array[LocalVariableTargetNode] targets, Location location) -> void + # + # @return [MatchWriteNode] a new instance of MatchWriteNode + # + # source://prism//lib/prism/node.rb#13069 + sig do + params( + source: Prism::Source, + call: Prism::CallNode, + targets: T::Array[Prism::LocalVariableTargetNode], + location: Prism::Location + ).void + end + def initialize(source, call, targets, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#13150 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#13077 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader call: CallNode + # + # source://prism//lib/prism/node.rb#13110 + sig { returns(Prism::CallNode) } + def call; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#13082 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#13092 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#13087 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?call: CallNode, ?targets: Array[LocalVariableTargetNode], ?location: Location) -> MatchWriteNode + # + # source://prism//lib/prism/node.rb#13097 + sig do + params( + call: Prism::CallNode, + targets: T::Array[Prism::LocalVariableTargetNode], + location: Prism::Location + ).returns(Prism::MatchWriteNode) + end + def copy(call: T.unsafe(nil), targets: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#13082 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { call: CallNode, targets: Array[LocalVariableTargetNode], location: Location } + # + # source://prism//lib/prism/node.rb#13105 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#13116 + sig { override.returns(String) } + def inspect; end + + # attr_reader targets: Array[LocalVariableTargetNode] + # + # source://prism//lib/prism/node.rb#13113 + sig { returns(T::Array[Prism::LocalVariableTargetNode]) } + def targets; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13134 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13144 + def type; end + end +end + +# Represents a node that is missing from the source and results in a syntax error. +# +# source://prism//lib/prism/node.rb#13159 +class Prism::MissingNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [MissingNode] a new instance of MissingNode + # + # source://prism//lib/prism/node.rb#13161 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#13234 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#13167 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#13172 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#13182 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#13177 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?location: Location) -> MissingNode + # + # source://prism//lib/prism/node.rb#13187 + sig { params(location: Prism::Location).returns(Prism::MissingNode) } + def copy(location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#13172 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#13195 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#13200 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13218 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13228 + def type; end + end +end + +# Represents a module declaration involving the `module` keyword. +# +# module Foo end +# ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#13243 +class Prism::ModuleNode < ::Prism::Node + # def initialize: (Array[Symbol] locals, Location module_keyword_loc, Prism::node constant_path, Prism::node? body, Location end_keyword_loc, Symbol name, Location location) -> void + # + # @return [ModuleNode] a new instance of ModuleNode + # + # source://prism//lib/prism/node.rb#13245 + sig do + params( + source: Prism::Source, + locals: T::Array[Symbol], + module_keyword_loc: Prism::Location, + constant_path: Prism::Node, + body: T.nilable(Prism::Node), + end_keyword_loc: Prism::Location, + name: Symbol, + location: Prism::Location + ).void + end + def initialize(source, locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#13363 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#13257 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader body: Prism::node? + # + # source://prism//lib/prism/node.rb#13306 + sig { returns(T.nilable(Prism::Node)) } + def body; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#13262 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#13275 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#13267 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # attr_reader constant_path: Prism::node + # + # source://prism//lib/prism/node.rb#13303 + sig { returns(Prism::Node) } + def constant_path; end + + # def copy: (?locals: Array[Symbol], ?module_keyword_loc: Location, ?constant_path: Prism::node, ?body: Prism::node?, ?end_keyword_loc: Location, ?name: Symbol, ?location: Location) -> ModuleNode + # + # source://prism//lib/prism/node.rb#13280 + sig do + params( + locals: T::Array[Symbol], + module_keyword_loc: Prism::Location, + constant_path: Prism::Node, + body: T.nilable(Prism::Node), + end_keyword_loc: Prism::Location, + name: Symbol, + location: Prism::Location + ).returns(Prism::ModuleNode) + end + def copy(locals: T.unsafe(nil), module_keyword_loc: T.unsafe(nil), constant_path: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), name: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#13262 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], module_keyword_loc: Location, constant_path: Prism::node, body: Prism::node?, end_keyword_loc: Location, name: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#13288 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def end_keyword: () -> String + # + # source://prism//lib/prism/node.rb#13324 + sig { returns(String) } + def end_keyword; end + + # attr_reader end_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#13309 + sig { returns(Prism::Location) } + def end_keyword_loc; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#13329 + sig { override.returns(String) } + def inspect; end + + # attr_reader locals: Array[Symbol] + # + # source://prism//lib/prism/node.rb#13293 + sig { returns(T::Array[Symbol]) } + def locals; end + + # def module_keyword: () -> String + # + # source://prism//lib/prism/node.rb#13319 + sig { returns(String) } + def module_keyword; end + + # attr_reader module_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#13296 + sig { returns(Prism::Location) } + def module_keyword_loc; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#13316 + sig { returns(Symbol) } + def name; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13347 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13357 + def type; end + end +end + +# Represents a multi-target expression. +# +# a, (b, c) = 1, 2, 3 +# ^^^^^^ +# +# source://prism//lib/prism/node.rb#13379 +class Prism::MultiTargetNode < ::Prism::Node + # def initialize: (Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] lefts, Prism::node? rest, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode] rights, Location? lparen_loc, Location? rparen_loc, Location location) -> void + # + # @return [MultiTargetNode] a new instance of MultiTargetNode + # + # source://prism//lib/prism/node.rb#13381 + sig do + params( + source: Prism::Source, + 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(Prism::Node), + 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)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end + def initialize(source, lefts, rest, rights, lparen_loc, rparen_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#13508 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#13392 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#13397 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#13411 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#13402 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], ?rest: Prism::node?, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode], ?lparen_loc: Location?, ?rparen_loc: Location?, ?location: Location) -> MultiTargetNode + # + # source://prism//lib/prism/node.rb#13416 + sig do + params( + 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(Prism::Node), + 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)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::MultiTargetNode) + end + def copy(lefts: T.unsafe(nil), rest: T.unsafe(nil), rights: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#13397 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], rest: Prism::node?, rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode], lparen_loc: Location?, rparen_loc: Location?, location: Location } + # + # source://prism//lib/prism/node.rb#13424 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#13474 + sig { override.returns(String) } + def inspect; end + + # attr_reader lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] + # + # source://prism//lib/prism/node.rb#13429 + 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? + # + # source://prism//lib/prism/node.rb#13464 + sig { returns(T.nilable(String)) } + def lparen; end + + # attr_reader lparen_loc: Location? + # + # source://prism//lib/prism/node.rb#13438 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end + + # attr_reader rest: Prism::node? + # + # source://prism//lib/prism/node.rb#13432 + sig { returns(T.nilable(Prism::Node)) } + def rest; end + + # attr_reader rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode] + # + # source://prism//lib/prism/node.rb#13435 + 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)]) + end + def rights; end + + # def rparen: () -> String? + # + # source://prism//lib/prism/node.rb#13469 + sig { returns(T.nilable(String)) } + def rparen; end + + # attr_reader rparen_loc: Location? + # + # source://prism//lib/prism/node.rb#13451 + sig { returns(T.nilable(Prism::Location)) } + def rparen_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13492 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13502 + def type; end + end +end + +# Represents a write to a multi-target expression. +# +# a, b, c = 1, 2, 3 +# ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#13524 +class Prism::MultiWriteNode < ::Prism::Node + # def initialize: (Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode] lefts, Prism::node? rest, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode] rights, Location? lparen_loc, Location? rparen_loc, Location operator_loc, Prism::node value, Location location) -> void + # + # @return [MultiWriteNode] a new instance of MultiWriteNode + # + # source://prism//lib/prism/node.rb#13526 + sig do + params( + source: Prism::Source, + lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode)], + rest: T.nilable(Prism::Node), + rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#13671 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#13539 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#13544 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#13559 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#13549 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], ?rest: Prism::node?, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], ?lparen_loc: Location?, ?rparen_loc: Location?, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> MultiWriteNode + # + # source://prism//lib/prism/node.rb#13564 + sig do + params( + lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode)], + rest: T.nilable(Prism::Node), + rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::MultiWriteNode) + end + def copy(lefts: T.unsafe(nil), rest: T.unsafe(nil), rights: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#13544 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], rest: Prism::node?, rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], lparen_loc: Location?, rparen_loc: Location?, operator_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#13572 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#13637 + sig { override.returns(String) } + def inspect; end + + # attr_reader lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode] + # + # source://prism//lib/prism/node.rb#13577 + 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)]) + end + def lefts; end + + # def lparen: () -> String? + # + # source://prism//lib/prism/node.rb#13622 + sig { returns(T.nilable(String)) } + def lparen; end + + # attr_reader lparen_loc: Location? + # + # source://prism//lib/prism/node.rb#13586 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#13632 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#13612 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader rest: Prism::node? + # + # source://prism//lib/prism/node.rb#13580 + sig { returns(T.nilable(Prism::Node)) } + def rest; end + + # attr_reader rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode] + # + # source://prism//lib/prism/node.rb#13583 + 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)]) + end + def rights; end + + # def rparen: () -> String? + # + # source://prism//lib/prism/node.rb#13627 + sig { returns(T.nilable(String)) } + def rparen; end + + # attr_reader rparen_loc: Location? + # + # source://prism//lib/prism/node.rb#13599 + sig { returns(T.nilable(Prism::Location)) } + def rparen_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13655 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#13619 + sig { returns(Prism::Node) } + def value; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13665 + 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. +# +# source://prism//lib/prism/mutation_compiler.rb#13 +class Prism::MutationCompiler < ::Prism::Compiler + # Copy a AliasGlobalVariableNode node + # + # source://prism//lib/prism/mutation_compiler.rb#15 + def visit_alias_global_variable_node(node); end + + # Copy a AliasMethodNode node + # + # source://prism//lib/prism/mutation_compiler.rb#20 + def visit_alias_method_node(node); end + + # Copy a AlternationPatternNode node + # + # source://prism//lib/prism/mutation_compiler.rb#25 + def visit_alternation_pattern_node(node); end + + # Copy a AndNode node + # + # source://prism//lib/prism/mutation_compiler.rb#30 + def visit_and_node(node); end + + # Copy a ArgumentsNode node + # + # source://prism//lib/prism/mutation_compiler.rb#35 + def visit_arguments_node(node); end + + # Copy a ArrayNode node + # + # source://prism//lib/prism/mutation_compiler.rb#40 + def visit_array_node(node); end + + # Copy a ArrayPatternNode node + # + # source://prism//lib/prism/mutation_compiler.rb#45 + def visit_array_pattern_node(node); end + + # Copy a AssocNode node + # + # source://prism//lib/prism/mutation_compiler.rb#50 + def visit_assoc_node(node); end + + # Copy a AssocSplatNode node + # + # source://prism//lib/prism/mutation_compiler.rb#55 + def visit_assoc_splat_node(node); end + + # Copy a BackReferenceReadNode node + # + # source://prism//lib/prism/mutation_compiler.rb#60 + def visit_back_reference_read_node(node); end + + # Copy a BeginNode node + # + # source://prism//lib/prism/mutation_compiler.rb#65 + def visit_begin_node(node); end + + # Copy a BlockArgumentNode node + # + # source://prism//lib/prism/mutation_compiler.rb#70 + def visit_block_argument_node(node); end + + # Copy a BlockLocalVariableNode node + # + # source://prism//lib/prism/mutation_compiler.rb#75 + def visit_block_local_variable_node(node); end + + # Copy a BlockNode node + # + # source://prism//lib/prism/mutation_compiler.rb#80 + def visit_block_node(node); end + + # Copy a BlockParameterNode node + # + # source://prism//lib/prism/mutation_compiler.rb#85 + def visit_block_parameter_node(node); end + + # Copy a BlockParametersNode node + # + # source://prism//lib/prism/mutation_compiler.rb#90 + def visit_block_parameters_node(node); end + + # Copy a BreakNode node + # + # source://prism//lib/prism/mutation_compiler.rb#95 + def visit_break_node(node); end + + # Copy a CallAndWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#100 + def visit_call_and_write_node(node); end + + # Copy a CallNode node + # + # source://prism//lib/prism/mutation_compiler.rb#105 + def visit_call_node(node); end + + # Copy a CallOperatorWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#110 + def visit_call_operator_write_node(node); end + + # Copy a CallOrWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#115 + def visit_call_or_write_node(node); end + + # Copy a CallTargetNode node + # + # source://prism//lib/prism/mutation_compiler.rb#120 + def visit_call_target_node(node); end + + # Copy a CapturePatternNode node + # + # source://prism//lib/prism/mutation_compiler.rb#125 + def visit_capture_pattern_node(node); end + + # Copy a CaseMatchNode node + # + # source://prism//lib/prism/mutation_compiler.rb#130 + def visit_case_match_node(node); end + + # Copy a CaseNode node + # + # source://prism//lib/prism/mutation_compiler.rb#135 + def visit_case_node(node); end + + # Copy a ClassNode node + # + # source://prism//lib/prism/mutation_compiler.rb#140 + def visit_class_node(node); end + + # Copy a ClassVariableAndWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#145 + def visit_class_variable_and_write_node(node); end + + # Copy a ClassVariableOperatorWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#150 + def visit_class_variable_operator_write_node(node); end + + # Copy a ClassVariableOrWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#155 + def visit_class_variable_or_write_node(node); end + + # Copy a ClassVariableReadNode node + # + # source://prism//lib/prism/mutation_compiler.rb#160 + def visit_class_variable_read_node(node); end + + # Copy a ClassVariableTargetNode node + # + # source://prism//lib/prism/mutation_compiler.rb#165 + def visit_class_variable_target_node(node); end + + # Copy a ClassVariableWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#170 + def visit_class_variable_write_node(node); end + + # Copy a ConstantAndWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#175 + def visit_constant_and_write_node(node); end + + # Copy a ConstantOperatorWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#180 + def visit_constant_operator_write_node(node); end + + # Copy a ConstantOrWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#185 + def visit_constant_or_write_node(node); end + + # Copy a ConstantPathAndWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#190 + def visit_constant_path_and_write_node(node); end + + # Copy a ConstantPathNode node + # + # source://prism//lib/prism/mutation_compiler.rb#195 + def visit_constant_path_node(node); end + + # Copy a ConstantPathOperatorWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#200 + def visit_constant_path_operator_write_node(node); end + + # Copy a ConstantPathOrWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#205 + def visit_constant_path_or_write_node(node); end + + # Copy a ConstantPathTargetNode node + # + # source://prism//lib/prism/mutation_compiler.rb#210 + def visit_constant_path_target_node(node); end + + # Copy a ConstantPathWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#215 + def visit_constant_path_write_node(node); end + + # Copy a ConstantReadNode node + # + # source://prism//lib/prism/mutation_compiler.rb#220 + def visit_constant_read_node(node); end + + # Copy a ConstantTargetNode node + # + # source://prism//lib/prism/mutation_compiler.rb#225 + def visit_constant_target_node(node); end + + # Copy a ConstantWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#230 + def visit_constant_write_node(node); end + + # Copy a DefNode node + # + # source://prism//lib/prism/mutation_compiler.rb#235 + def visit_def_node(node); end + + # Copy a DefinedNode node + # + # source://prism//lib/prism/mutation_compiler.rb#240 + def visit_defined_node(node); end + + # Copy a ElseNode node + # + # source://prism//lib/prism/mutation_compiler.rb#245 + def visit_else_node(node); end + + # Copy a EmbeddedStatementsNode node + # + # source://prism//lib/prism/mutation_compiler.rb#250 + def visit_embedded_statements_node(node); end + + # Copy a EmbeddedVariableNode node + # + # source://prism//lib/prism/mutation_compiler.rb#255 + def visit_embedded_variable_node(node); end + + # Copy a EnsureNode node + # + # source://prism//lib/prism/mutation_compiler.rb#260 + def visit_ensure_node(node); end + + # Copy a FalseNode node + # + # source://prism//lib/prism/mutation_compiler.rb#265 + def visit_false_node(node); end + + # Copy a FindPatternNode node + # + # source://prism//lib/prism/mutation_compiler.rb#270 + def visit_find_pattern_node(node); end + + # Copy a FlipFlopNode node + # + # source://prism//lib/prism/mutation_compiler.rb#275 + def visit_flip_flop_node(node); end + + # Copy a FloatNode node + # + # source://prism//lib/prism/mutation_compiler.rb#280 + def visit_float_node(node); end + + # Copy a ForNode node + # + # source://prism//lib/prism/mutation_compiler.rb#285 + def visit_for_node(node); end + + # Copy a ForwardingArgumentsNode node + # + # source://prism//lib/prism/mutation_compiler.rb#290 + def visit_forwarding_arguments_node(node); end + + # Copy a ForwardingParameterNode node + # + # source://prism//lib/prism/mutation_compiler.rb#295 + def visit_forwarding_parameter_node(node); end + + # Copy a ForwardingSuperNode node + # + # source://prism//lib/prism/mutation_compiler.rb#300 + def visit_forwarding_super_node(node); end + + # Copy a GlobalVariableAndWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#305 + def visit_global_variable_and_write_node(node); end + + # Copy a GlobalVariableOperatorWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#310 + def visit_global_variable_operator_write_node(node); end + + # Copy a GlobalVariableOrWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#315 + def visit_global_variable_or_write_node(node); end + + # Copy a GlobalVariableReadNode node + # + # source://prism//lib/prism/mutation_compiler.rb#320 + def visit_global_variable_read_node(node); end + + # Copy a GlobalVariableTargetNode node + # + # source://prism//lib/prism/mutation_compiler.rb#325 + def visit_global_variable_target_node(node); end + + # Copy a GlobalVariableWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#330 + def visit_global_variable_write_node(node); end + + # Copy a HashNode node + # + # source://prism//lib/prism/mutation_compiler.rb#335 + def visit_hash_node(node); end + + # Copy a HashPatternNode node + # + # source://prism//lib/prism/mutation_compiler.rb#340 + def visit_hash_pattern_node(node); end + + # Copy a IfNode node + # + # source://prism//lib/prism/mutation_compiler.rb#345 + def visit_if_node(node); end + + # Copy a ImaginaryNode node + # + # source://prism//lib/prism/mutation_compiler.rb#350 + def visit_imaginary_node(node); end + + # Copy a ImplicitNode node + # + # source://prism//lib/prism/mutation_compiler.rb#355 + def visit_implicit_node(node); end + + # Copy a ImplicitRestNode node + # + # source://prism//lib/prism/mutation_compiler.rb#360 + def visit_implicit_rest_node(node); end + + # Copy a InNode node + # + # source://prism//lib/prism/mutation_compiler.rb#365 + def visit_in_node(node); end + + # Copy a IndexAndWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#370 + def visit_index_and_write_node(node); end + + # Copy a IndexOperatorWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#375 + def visit_index_operator_write_node(node); end + + # Copy a IndexOrWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#380 + def visit_index_or_write_node(node); end + + # Copy a IndexTargetNode node + # + # source://prism//lib/prism/mutation_compiler.rb#385 + def visit_index_target_node(node); end + + # Copy a InstanceVariableAndWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#390 + def visit_instance_variable_and_write_node(node); end + + # Copy a InstanceVariableOperatorWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#395 + def visit_instance_variable_operator_write_node(node); end + + # Copy a InstanceVariableOrWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#400 + def visit_instance_variable_or_write_node(node); end + + # Copy a InstanceVariableReadNode node + # + # source://prism//lib/prism/mutation_compiler.rb#405 + def visit_instance_variable_read_node(node); end + + # Copy a InstanceVariableTargetNode node + # + # source://prism//lib/prism/mutation_compiler.rb#410 + def visit_instance_variable_target_node(node); end + + # Copy a InstanceVariableWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#415 + def visit_instance_variable_write_node(node); end + + # Copy a IntegerNode node + # + # source://prism//lib/prism/mutation_compiler.rb#420 + def visit_integer_node(node); end + + # Copy a InterpolatedMatchLastLineNode node + # + # source://prism//lib/prism/mutation_compiler.rb#425 + def visit_interpolated_match_last_line_node(node); end + + # Copy a InterpolatedRegularExpressionNode node + # + # source://prism//lib/prism/mutation_compiler.rb#430 + def visit_interpolated_regular_expression_node(node); end + + # Copy a InterpolatedStringNode node + # + # source://prism//lib/prism/mutation_compiler.rb#435 + def visit_interpolated_string_node(node); end + + # Copy a InterpolatedSymbolNode node + # + # source://prism//lib/prism/mutation_compiler.rb#440 + def visit_interpolated_symbol_node(node); end + + # Copy a InterpolatedXStringNode node + # + # source://prism//lib/prism/mutation_compiler.rb#445 + def visit_interpolated_x_string_node(node); end + + # Copy a ItLocalVariableReadNode node + # + # source://prism//lib/prism/mutation_compiler.rb#450 + def visit_it_local_variable_read_node(node); end + + # Copy a ItParametersNode node + # + # source://prism//lib/prism/mutation_compiler.rb#455 + def visit_it_parameters_node(node); end + + # Copy a KeywordHashNode node + # + # source://prism//lib/prism/mutation_compiler.rb#460 + def visit_keyword_hash_node(node); end + + # Copy a KeywordRestParameterNode node + # + # source://prism//lib/prism/mutation_compiler.rb#465 + def visit_keyword_rest_parameter_node(node); end + + # Copy a LambdaNode node + # + # source://prism//lib/prism/mutation_compiler.rb#470 + def visit_lambda_node(node); end + + # Copy a LocalVariableAndWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#475 + def visit_local_variable_and_write_node(node); end + + # Copy a LocalVariableOperatorWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#480 + def visit_local_variable_operator_write_node(node); end + + # Copy a LocalVariableOrWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#485 + def visit_local_variable_or_write_node(node); end + + # Copy a LocalVariableReadNode node + # + # source://prism//lib/prism/mutation_compiler.rb#490 + def visit_local_variable_read_node(node); end + + # Copy a LocalVariableTargetNode node + # + # source://prism//lib/prism/mutation_compiler.rb#495 + def visit_local_variable_target_node(node); end + + # Copy a LocalVariableWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#500 + def visit_local_variable_write_node(node); end + + # Copy a MatchLastLineNode node + # + # source://prism//lib/prism/mutation_compiler.rb#505 + def visit_match_last_line_node(node); end + + # Copy a MatchPredicateNode node + # + # source://prism//lib/prism/mutation_compiler.rb#510 + def visit_match_predicate_node(node); end + + # Copy a MatchRequiredNode node + # + # source://prism//lib/prism/mutation_compiler.rb#515 + def visit_match_required_node(node); end + + # Copy a MatchWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#520 + def visit_match_write_node(node); end + + # Copy a MissingNode node + # + # source://prism//lib/prism/mutation_compiler.rb#525 + def visit_missing_node(node); end + + # Copy a ModuleNode node + # + # source://prism//lib/prism/mutation_compiler.rb#530 + def visit_module_node(node); end + + # Copy a MultiTargetNode node + # + # source://prism//lib/prism/mutation_compiler.rb#535 + def visit_multi_target_node(node); end + + # Copy a MultiWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#540 + def visit_multi_write_node(node); end + + # Copy a NextNode node + # + # source://prism//lib/prism/mutation_compiler.rb#545 + def visit_next_node(node); end + + # Copy a NilNode node + # + # source://prism//lib/prism/mutation_compiler.rb#550 + def visit_nil_node(node); end + + # Copy a NoKeywordsParameterNode node + # + # source://prism//lib/prism/mutation_compiler.rb#555 + def visit_no_keywords_parameter_node(node); end + + # Copy a NumberedParametersNode node + # + # source://prism//lib/prism/mutation_compiler.rb#560 + def visit_numbered_parameters_node(node); end + + # Copy a NumberedReferenceReadNode node + # + # source://prism//lib/prism/mutation_compiler.rb#565 + def visit_numbered_reference_read_node(node); end + + # Copy a OptionalKeywordParameterNode node + # + # source://prism//lib/prism/mutation_compiler.rb#570 + def visit_optional_keyword_parameter_node(node); end + + # Copy a OptionalParameterNode node + # + # source://prism//lib/prism/mutation_compiler.rb#575 + def visit_optional_parameter_node(node); end + + # Copy a OrNode node + # + # source://prism//lib/prism/mutation_compiler.rb#580 + def visit_or_node(node); end + + # Copy a ParametersNode node + # + # source://prism//lib/prism/mutation_compiler.rb#585 + def visit_parameters_node(node); end + + # Copy a ParenthesesNode node + # + # source://prism//lib/prism/mutation_compiler.rb#590 + def visit_parentheses_node(node); end + + # Copy a PinnedExpressionNode node + # + # source://prism//lib/prism/mutation_compiler.rb#595 + def visit_pinned_expression_node(node); end + + # Copy a PinnedVariableNode node + # + # source://prism//lib/prism/mutation_compiler.rb#600 + def visit_pinned_variable_node(node); end + + # Copy a PostExecutionNode node + # + # source://prism//lib/prism/mutation_compiler.rb#605 + def visit_post_execution_node(node); end + + # Copy a PreExecutionNode node + # + # source://prism//lib/prism/mutation_compiler.rb#610 + def visit_pre_execution_node(node); end + + # Copy a ProgramNode node + # + # source://prism//lib/prism/mutation_compiler.rb#615 + def visit_program_node(node); end + + # Copy a RangeNode node + # + # source://prism//lib/prism/mutation_compiler.rb#620 + def visit_range_node(node); end + + # Copy a RationalNode node + # + # source://prism//lib/prism/mutation_compiler.rb#625 + def visit_rational_node(node); end + + # Copy a RedoNode node + # + # source://prism//lib/prism/mutation_compiler.rb#630 + def visit_redo_node(node); end + + # Copy a RegularExpressionNode node + # + # source://prism//lib/prism/mutation_compiler.rb#635 + def visit_regular_expression_node(node); end + + # Copy a RequiredKeywordParameterNode node + # + # source://prism//lib/prism/mutation_compiler.rb#640 + def visit_required_keyword_parameter_node(node); end + + # Copy a RequiredParameterNode node + # + # source://prism//lib/prism/mutation_compiler.rb#645 + def visit_required_parameter_node(node); end + + # Copy a RescueModifierNode node + # + # source://prism//lib/prism/mutation_compiler.rb#650 + def visit_rescue_modifier_node(node); end + + # Copy a RescueNode node + # + # source://prism//lib/prism/mutation_compiler.rb#655 + def visit_rescue_node(node); end + + # Copy a RestParameterNode node + # + # source://prism//lib/prism/mutation_compiler.rb#660 + def visit_rest_parameter_node(node); end + + # Copy a RetryNode node + # + # source://prism//lib/prism/mutation_compiler.rb#665 + def visit_retry_node(node); end + + # Copy a ReturnNode node + # + # source://prism//lib/prism/mutation_compiler.rb#670 + def visit_return_node(node); end + + # Copy a SelfNode node + # + # source://prism//lib/prism/mutation_compiler.rb#675 + def visit_self_node(node); end + + # Copy a ShareableConstantNode node + # + # source://prism//lib/prism/mutation_compiler.rb#680 + def visit_shareable_constant_node(node); end + + # Copy a SingletonClassNode node + # + # source://prism//lib/prism/mutation_compiler.rb#685 + def visit_singleton_class_node(node); end + + # Copy a SourceEncodingNode node + # + # source://prism//lib/prism/mutation_compiler.rb#690 + def visit_source_encoding_node(node); end + + # Copy a SourceFileNode node + # + # source://prism//lib/prism/mutation_compiler.rb#695 + def visit_source_file_node(node); end + + # Copy a SourceLineNode node + # + # source://prism//lib/prism/mutation_compiler.rb#700 + def visit_source_line_node(node); end + + # Copy a SplatNode node + # + # source://prism//lib/prism/mutation_compiler.rb#705 + def visit_splat_node(node); end + + # Copy a StatementsNode node + # + # source://prism//lib/prism/mutation_compiler.rb#710 + def visit_statements_node(node); end + + # Copy a StringNode node + # + # source://prism//lib/prism/mutation_compiler.rb#715 + def visit_string_node(node); end + + # Copy a SuperNode node + # + # source://prism//lib/prism/mutation_compiler.rb#720 + def visit_super_node(node); end + + # Copy a SymbolNode node + # + # source://prism//lib/prism/mutation_compiler.rb#725 + def visit_symbol_node(node); end + + # Copy a TrueNode node + # + # source://prism//lib/prism/mutation_compiler.rb#730 + def visit_true_node(node); end + + # Copy a UndefNode node + # + # source://prism//lib/prism/mutation_compiler.rb#735 + def visit_undef_node(node); end + + # Copy a UnlessNode node + # + # source://prism//lib/prism/mutation_compiler.rb#740 + def visit_unless_node(node); end + + # Copy a UntilNode node + # + # source://prism//lib/prism/mutation_compiler.rb#745 + def visit_until_node(node); end + + # Copy a WhenNode node + # + # source://prism//lib/prism/mutation_compiler.rb#750 + def visit_when_node(node); end + + # Copy a WhileNode node + # + # source://prism//lib/prism/mutation_compiler.rb#755 + def visit_while_node(node); end + + # Copy a XStringNode node + # + # source://prism//lib/prism/mutation_compiler.rb#760 + def visit_x_string_node(node); end + + # Copy a YieldNode node + # + # source://prism//lib/prism/mutation_compiler.rb#765 + def visit_yield_node(node); end +end + +# Represents the use of the `next` keyword. +# +# next 1 +# ^^^^^^ +# +# source://prism//lib/prism/node.rb#13689 +class Prism::NextNode < ::Prism::Node + # def initialize: (ArgumentsNode? arguments, Location keyword_loc, Location location) -> void + # + # @return [NextNode] a new instance of NextNode + # + # source://prism//lib/prism/node.rb#13691 + sig do + params( + source: Prism::Source, + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, arguments, keyword_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#13783 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#13699 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # source://prism//lib/prism/node.rb#13734 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#13704 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#13716 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#13709 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?arguments: ArgumentsNode?, ?keyword_loc: Location, ?location: Location) -> NextNode + # + # source://prism//lib/prism/node.rb#13721 + sig do + params( + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::NextNode) + end + def copy(arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#13704 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { arguments: ArgumentsNode?, keyword_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#13729 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#13749 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#13744 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#13737 + sig { returns(Prism::Location) } + def keyword_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13767 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13777 + def type; end + end +end + +# Represents the use of the `nil` keyword. +# +# nil +# ^^^ +# +# source://prism//lib/prism/node.rb#13794 +class Prism::NilNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [NilNode] a new instance of NilNode + # + # source://prism//lib/prism/node.rb#13796 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#13869 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#13802 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#13807 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#13817 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#13812 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?location: Location) -> NilNode + # + # source://prism//lib/prism/node.rb#13822 + sig { params(location: Prism::Location).returns(Prism::NilNode) } + def copy(location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#13807 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#13830 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#13835 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13853 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13863 + def type; end + end +end + +# Represents the use of `**nil` inside method arguments. +# +# def a(**nil) +# ^^^^^ +# end +# +# source://prism//lib/prism/node.rb#13879 +class Prism::NoKeywordsParameterNode < ::Prism::Node + # def initialize: (Location operator_loc, Location keyword_loc, Location location) -> void + # + # @return [NoKeywordsParameterNode] a new instance of NoKeywordsParameterNode + # + # source://prism//lib/prism/node.rb#13881 + sig do + params( + source: Prism::Source, + operator_loc: Prism::Location, + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, operator_loc, keyword_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#13980 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#13889 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#13894 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#13904 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#13899 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?operator_loc: Location, ?keyword_loc: Location, ?location: Location) -> NoKeywordsParameterNode + # + # source://prism//lib/prism/node.rb#13909 + sig do + params( + operator_loc: Prism::Location, + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::NoKeywordsParameterNode) + end + def copy(operator_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#13894 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, keyword_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#13917 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#13946 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#13941 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#13929 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#13936 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#13922 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13964 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13974 + def type; end + end +end + +# This represents a node in the tree. It is the parent class of all of the +# various node types. +# +# source://prism//lib/prism/node.rb#12 +class Prism::Node + abstract! + + # Accepts a visitor and calls back into the specialized visit function. + # + # @raise [NoMethodError] + # + # source://prism//lib/prism/node.rb#131 + sig { abstract.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # Returns an array of child nodes, including `nil`s in the place of optional + # nodes that were not present. + # + # @raise [NoMethodError] + # + # source://prism//lib/prism/node.rb#137 + 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. + # + # @raise [NoMethodError] + # + # source://prism//lib/prism/node.rb#151 + sig { abstract.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # Returns an array of child nodes, excluding any `nil`s in the place of + # optional nodes that were not present. + # + # @raise [NoMethodError] + # + # source://prism//lib/prism/node.rb#145 + sig { abstract.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # Returns an array of child nodes, including `nil`s in the place of optional + # nodes that were not present. + # + # @raise [NoMethodError] + # + # source://prism//lib/prism/node.rb#137 + sig { abstract.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # source://prism//lib/prism/node_ext.rb#7 + def deprecated(*replacements); end + + # The end offset of the node in the source. This method is effectively a + # delegate method to the location object. + # + # source://prism//lib/prism/node.rb#34 + sig { returns(Integer) } + def end_offset; end + + sig { abstract.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # Returns a string representation of the node. + # + # @raise [NoMethodError] + # + # source://prism//lib/prism/node.rb#162 + sig { abstract.returns(String) } + def inspect; end + + # A Location instance that represents the location of this node in the + # source. + # + # source://prism//lib/prism/node.rb#19 + sig { returns(Prism::Location) } + def location; end + + # source://prism//lib/prism/parse_result/newlines.rb#69 + def newline!(lines); end + + # @return [Boolean] + # + # source://prism//lib/prism/parse_result/newlines.rb#65 + def newline?; end + + # Similar to inspect, but respects the current level of indentation given by + # the pretty print object. + # + # source://prism//lib/prism/node.rb#62 + sig { params(q: T.untyped).void } + def pretty_print(q); end + + # Returns all of the lines of the source code associated with this node. + # An alias for source_lines, used to mimic the API from + # RubyVM::AbstractSyntaxTree to make it easier to migrate. + # + # source://prism//lib/prism/node.rb#40 + sig { returns(T::Array[String]) } + def script_lines; end + + # Slice the location of the node from the source. + # + # source://prism//lib/prism/node.rb#49 + 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. + # + # source://prism//lib/prism/node.rb#56 + sig { returns(String) } + def slice_lines; end + + # Returns all of the lines of the source code associated with this node. + # + # source://prism//lib/prism/node.rb#40 + sig { returns(T::Array[String]) } + def source_lines; end + + # The start offset of the node in the source. This method is effectively a + # delegate method to the location object. + # + # source://prism//lib/prism/node.rb#27 + sig { returns(Integer) } + def start_offset; end + + # Convert this node into a graphviz dot graph string. + # + # source://prism//lib/prism/node.rb#70 + sig { returns(String) } + def to_dot; 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. + # + # source://prism//lib/prism/node.rb#81 + sig { params(line: Integer, column: Integer).returns(T::Array[Prism::Node]) } + def tunnel(line, column); end + + # Returns a symbol symbolizing the type of node that this represents. This + # is particularly useful for case statements and array comparisons. + # + # @raise [NoMethodError] + # + # source://prism//lib/prism/node.rb#157 + sig { abstract.returns(Symbol) } + def type; end + + private + + # A pointer to the source that this node was created from. + # + # source://prism//lib/prism/node.rb#14 + 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. + # + # @raise [NoMethodError] + # + # source://prism//lib/prism/node.rb#115 + def fields; end + + # Returns the type of the node as a symbol. + # + # @raise [NoMethodError] + # + # source://prism//lib/prism/node.rb#167 + def type; end + end +end + +# Represents an implicit set of parameters through the use of numbered parameters within a block or lambda. +# +# -> { _1 + _2 } +# ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#13991 +class Prism::NumberedParametersNode < ::Prism::Node + # def initialize: (Integer maximum, Location location) -> void + # + # @return [NumberedParametersNode] a new instance of NumberedParametersNode + # + # source://prism//lib/prism/node.rb#13993 + sig { params(source: Prism::Source, maximum: Integer, location: Prism::Location).void } + def initialize(source, maximum, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#14070 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#14000 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14005 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#14015 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#14010 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?maximum: Integer, ?location: Location) -> NumberedParametersNode + # + # source://prism//lib/prism/node.rb#14020 + sig { params(maximum: Integer, location: Prism::Location).returns(Prism::NumberedParametersNode) } + def copy(maximum: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14005 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { maximum: Integer, location: Location } + # + # source://prism//lib/prism/node.rb#14028 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#14036 + sig { override.returns(String) } + def inspect; end + + # attr_reader maximum: Integer + # + # source://prism//lib/prism/node.rb#14033 + sig { returns(Integer) } + def maximum; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14054 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14064 + def type; end + end +end + +# Represents reading a numbered reference to a capture in the previous match. +# +# $1 +# ^^ +# +# source://prism//lib/prism/node.rb#14080 +class Prism::NumberedReferenceReadNode < ::Prism::Node + # def initialize: (Integer number, Location location) -> void + # + # @return [NumberedReferenceReadNode] a new instance of NumberedReferenceReadNode + # + # source://prism//lib/prism/node.rb#14082 + sig { params(source: Prism::Source, number: Integer, location: Prism::Location).void } + def initialize(source, number, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#14165 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#14089 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14094 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#14104 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#14099 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?number: Integer, ?location: Location) -> NumberedReferenceReadNode + # + # source://prism//lib/prism/node.rb#14109 + sig { params(number: Integer, location: Prism::Location).returns(Prism::NumberedReferenceReadNode) } + def copy(number: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14094 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { number: Integer, location: Location } + # + # source://prism//lib/prism/node.rb#14117 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#14131 + 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` + # + # source://prism//lib/prism/node.rb#14128 + sig { returns(Integer) } + def number; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14149 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14159 + def type; end + end +end + +# Represents an optional keyword parameter to a method, block, or lambda definition. +# +# def a(b: 1) +# ^^^^ +# end +# +# source://prism//lib/prism/node.rb#14176 +class Prism::OptionalKeywordParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol name, Location name_loc, Prism::node value, Location location) -> void + # + # @return [OptionalKeywordParameterNode] a new instance of OptionalKeywordParameterNode + # + # source://prism//lib/prism/node.rb#14178 + sig do + params( + source: Prism::Source, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, flags, name, name_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#14277 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#14188 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14193 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#14203 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#14198 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?location: Location) -> OptionalKeywordParameterNode + # + # source://prism//lib/prism/node.rb#14208 + sig do + params( + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::OptionalKeywordParameterNode) + end + def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14193 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, name_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#14216 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#14243 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#14225 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#14228 + sig { returns(Prism::Location) } + def name_loc; end + + # def repeated_parameter?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#14238 + sig { returns(T::Boolean) } + def repeated_parameter?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14261 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#14235 + sig { returns(Prism::Node) } + def value; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#14221 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14271 + def type; end + end +end + +# Represents an optional parameter to a method, block, or lambda definition. +# +# def a(b = 1) +# ^^^^^ +# end +# +# source://prism//lib/prism/node.rb#14291 +class Prism::OptionalParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void + # + # @return [OptionalParameterNode] a new instance of OptionalParameterNode + # + # source://prism//lib/prism/node.rb#14293 + sig do + params( + source: Prism::Source, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, flags, name, name_loc, operator_loc, value, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#14405 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#14304 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14309 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#14319 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#14314 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> OptionalParameterNode + # + # source://prism//lib/prism/node.rb#14324 + sig do + params( + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::OptionalParameterNode) + end + def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14309 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#14332 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#14371 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#14341 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#14344 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#14366 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#14351 + sig { returns(Prism::Location) } + def operator_loc; end + + # def repeated_parameter?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#14361 + sig { returns(T::Boolean) } + def repeated_parameter?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14389 + sig { override.returns(Symbol) } + def type; end + + # attr_reader value: Prism::node + # + # source://prism//lib/prism/node.rb#14358 + sig { returns(Prism::Node) } + def value; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#14337 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14399 + def type; end + end +end + +# Represents the use of the `||` operator or the `or` keyword. +# +# left or right +# ^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#14419 +class Prism::OrNode < ::Prism::Node + # def initialize: (Prism::node left, Prism::node right, Location operator_loc, Location location) -> void + # + # @return [OrNode] a new instance of OrNode + # + # source://prism//lib/prism/node.rb#14421 + sig do + params( + source: Prism::Source, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, left, right, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#14530 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#14430 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14435 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#14445 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#14440 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?left: Prism::node, ?right: Prism::node, ?operator_loc: Location, ?location: Location) -> OrNode + # + # source://prism//lib/prism/node.rb#14450 + sig do + params( + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::OrNode) + end + def copy(left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14435 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { left: Prism::node, right: Prism::node, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#14458 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#14496 + 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 + # ^ + # + # source://prism//lib/prism/node.rb#14469 + sig { returns(Prism::Node) } + def left; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#14491 + sig { returns(String) } + def operator; end + + # The location of the `or` keyword or the `||` operator. + # + # left or right + # ^^ + # + # source://prism//lib/prism/node.rb#14484 + sig { returns(Prism::Location) } + def operator_loc; end + + # Represents the right 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 || right + # ^^^^^ + # + # 1 or 2 + # ^ + # + # source://prism//lib/prism/node.rb#14478 + sig { returns(Prism::Node) } + def right; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14514 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14524 + def type; end + end +end + +# A parser for the pack template language. +# +# source://prism//lib/prism/pack.rb#6 +module Prism::Pack + class << self + def parse(_arg0, _arg1, _arg2); end + end +end + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::AGNOSTIC_ENDIAN = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::BACK = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::BER = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::BIG_ENDIAN = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::COMMENT = T.let(T.unsafe(nil), Symbol) + +# A directive in the pack template language. +# +# source://prism//lib/prism/pack.rb#60 +class Prism::Pack::Directive + # Initialize a new directive with the given values. + # + # @return [Directive] a new instance of Directive + # + # source://prism//lib/prism/pack.rb#89 + def initialize(version, variant, source, type, signed, endian, size, length_type, length); end + + # Provide a human-readable description of the directive. + # + # source://prism//lib/prism/pack.rb#131 + def describe; end + + # The type of endianness of the directive. + # + # source://prism//lib/prism/pack.rb#77 + def endian; end + + # The length of this directive (used for integers). + # + # source://prism//lib/prism/pack.rb#86 + def length; end + + # The length type of this directive (used for integers). + # + # source://prism//lib/prism/pack.rb#83 + def length_type; end + + # The type of signedness of the directive. + # + # source://prism//lib/prism/pack.rb#74 + def signed; end + + # The size of the directive. + # + # source://prism//lib/prism/pack.rb#80 + def size; end + + # A byteslice of the source string that this directive represents. + # + # source://prism//lib/prism/pack.rb#68 + def source; end + + # The type of the directive. + # + # source://prism//lib/prism/pack.rb#71 + def type; end + + # A symbol representing whether or not we are packing or unpacking. + # + # source://prism//lib/prism/pack.rb#65 + def variant; end + + # A symbol representing the version of Ruby. + # + # source://prism//lib/prism/pack.rb#62 + def version; end +end + +# The descriptions of the various types of endianness. +# +# source://prism//lib/prism/pack.rb#102 +Prism::Pack::Directive::ENDIAN_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) + +# The descriptions of the various types of signedness. +# +# source://prism//lib/prism/pack.rb#111 +Prism::Pack::Directive::SIGNED_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) + +# The descriptions of the various types of sizes. +# +# source://prism//lib/prism/pack.rb#118 +Prism::Pack::Directive::SIZE_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::ENDIAN_NA = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::FLOAT = T.let(T.unsafe(nil), Symbol) + +# The result of parsing a pack template. +# +# source://prism//lib/prism/pack.rb#198 +class Prism::Pack::Format + # Create a new Format with the given directives and encoding. + # + # @return [Format] a new instance of Format + # + # source://prism//lib/prism/pack.rb#206 + def initialize(directives, encoding); end + + # Provide a human-readable description of the format. + # + # source://prism//lib/prism/pack.rb#212 + def describe; end + + # A list of the directives in the template. + # + # source://prism//lib/prism/pack.rb#200 + def directives; end + + # The encoding of the template. + # + # source://prism//lib/prism/pack.rb#203 + def encoding; end +end + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::INTEGER = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::LENGTH_FIXED = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::LENGTH_MAX = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::LENGTH_NA = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::LENGTH_RELATIVE = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::LITTLE_ENDIAN = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::MOVE = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::NATIVE_ENDIAN = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::NULL = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::SIGNED = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::SIGNED_NA = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::SIZE_16 = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::SIZE_32 = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::SIZE_64 = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::SIZE_8 = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::SIZE_INT = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::SIZE_LONG = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::SIZE_LONG_LONG = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::SIZE_NA = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::SIZE_P = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::SIZE_SHORT = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::SPACE = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::STRING_BASE64 = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::STRING_FIXED = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::STRING_HEX_HIGH = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::STRING_HEX_LOW = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::STRING_LSB = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::STRING_MIME = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::STRING_MSB = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::STRING_NULL_PADDED = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::STRING_NULL_TERMINATED = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::STRING_POINTER = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::STRING_SPACE_PADDED = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::STRING_UU = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::UNSIGNED = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#56 +Prism::Pack::UTF8 = T.let(T.unsafe(nil), Symbol) + +# Flags for parameter nodes. +# +# source://prism//lib/prism/node.rb#19202 +module Prism::ParameterFlags; end + +# a parameter name that has been repeated in the method signature +# +# source://prism//lib/prism/node.rb#19204 +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 +# +# source://prism//lib/prism/node.rb#14543 +class Prism::ParametersNode < ::Prism::Node + # def initialize: (Array[RequiredParameterNode | MultiTargetNode] requireds, Array[OptionalParameterNode] optionals, RestParameterNode | ImplicitRestNode | nil rest, Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode] posts, Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] keywords, KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil keyword_rest, BlockParameterNode? block, Location location) -> void + # + # @return [ParametersNode] a new instance of ParametersNode + # + # source://prism//lib/prism/node.rb#14545 + sig do + params( + source: Prism::Source, + 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), + location: Prism::Location + ).void + end + def initialize(source, requireds, optionals, rest, posts, keywords, keyword_rest, block, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#14654 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#14558 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader block: BlockParameterNode? + # + # source://prism//lib/prism/node.rb#14617 + sig { returns(T.nilable(Prism::BlockParameterNode)) } + def block; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14563 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#14581 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#14568 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?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?, ?location: Location) -> ParametersNode + # + # source://prism//lib/prism/node.rb#14586 + sig do + params( + 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), + location: Prism::Location + ).returns(Prism::ParametersNode) + end + def copy(requireds: T.unsafe(nil), optionals: T.unsafe(nil), rest: T.unsafe(nil), posts: T.unsafe(nil), keywords: T.unsafe(nil), keyword_rest: T.unsafe(nil), block: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14563 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { 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?, location: Location } + # + # source://prism//lib/prism/node.rb#14594 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#14620 + sig { override.returns(String) } + def inspect; end + + # attr_reader keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil + # + # source://prism//lib/prism/node.rb#14614 + sig do + returns(T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode))) + end + def keyword_rest; end + + # attr_reader keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] + # + # source://prism//lib/prism/node.rb#14611 + sig { returns(T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)]) } + def keywords; end + + # attr_reader optionals: Array[OptionalParameterNode] + # + # source://prism//lib/prism/node.rb#14602 + sig { returns(T::Array[Prism::OptionalParameterNode]) } + def optionals; end + + # attr_reader posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode] + # + # source://prism//lib/prism/node.rb#14608 + 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] + # + # source://prism//lib/prism/node.rb#14599 + sig { returns(T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode)]) } + def requireds; end + + # attr_reader rest: RestParameterNode | ImplicitRestNode | nil + # + # source://prism//lib/prism/node.rb#14605 + sig { returns(T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode))) } + def rest; end + + # Mirrors the Method#parameters method. + # + # source://prism//lib/prism/node_ext.rb#253 + sig { returns(T::Array[T.any([Symbol, Symbol], [Symbol])]) } + def signature; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14638 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14648 + def type; end + end +end + +# Represents a parenthesized expression +# +# (10 + 34) +# ^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#14674 +class Prism::ParenthesesNode < ::Prism::Node + # def initialize: (Prism::node? body, Location opening_loc, Location closing_loc, Location location) -> void + # + # @return [ParenthesesNode] a new instance of ParenthesesNode + # + # source://prism//lib/prism/node.rb#14676 + sig do + params( + source: Prism::Source, + body: T.nilable(Prism::Node), + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, body, opening_loc, closing_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#14781 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#14685 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader body: Prism::node? + # + # source://prism//lib/prism/node.rb#14720 + sig { returns(T.nilable(Prism::Node)) } + def body; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14690 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#14742 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#14730 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#14702 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#14695 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> ParenthesesNode + # + # source://prism//lib/prism/node.rb#14707 + sig do + params( + body: T.nilable(Prism::Node), + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::ParenthesesNode) + end + def copy(body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14690 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { body: Prism::node?, opening_loc: Location, closing_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#14715 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#14747 + sig { override.returns(String) } + def inspect; end + + # source://prism//lib/prism/parse_result/newlines.rb#85 + def newline!(lines); end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#14737 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#14723 + sig { returns(Prism::Location) } + def opening_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14765 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14775 + def type; end + end +end + +# This represents an error that was encountered during parsing. +# +# source://prism//lib/prism/parse_result.rb#451 +class Prism::ParseError + # Create a new error object with the given message and location. + # + # @return [ParseError] a new instance of ParseError + # + # source://prism//lib/prism/parse_result.rb#466 + 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. + # + # source://prism//lib/prism/parse_result.rb#474 + 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. + # + # source://prism//lib/prism/parse_result.rb#479 + sig { returns(String) } + def inspect; end + + # The level of this error. + # + # source://prism//lib/prism/parse_result.rb#463 + sig { returns(Symbol) } + def level; end + + # A Location object representing the location of this error in the source. + # + # source://prism//lib/prism/parse_result.rb#460 + sig { returns(Prism::Location) } + def location; end + + # The message associated with this error. + # + # source://prism//lib/prism/parse_result.rb#457 + 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. + # + # source://prism//lib/prism/parse_result.rb#454 + sig { returns(Symbol) } + def type; end +end + +# This is a result specific to the `parse_lex` and `parse_lex_file` methods. +# +# source://prism//lib/prism/parse_result.rb#627 +class Prism::ParseLexResult < ::Prism::Result + # Create a new parse lex result object with the given values. + # + # @return [ParseLexResult] a new instance of ParseLexResult + # + # source://prism//lib/prism/parse_result.rb#633 + 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. + # + # source://prism//lib/prism/parse_result.rb#639 + 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. + # + # source://prism//lib/prism/parse_result.rb#630 + sig { returns([Prism::ProgramNode, T::Array[T.untyped]]) } + def value; end +end + +# This is a result specific to the `parse` and `parse_file` methods. +# +# source://prism//lib/prism/parse_result.rb#576 +class Prism::ParseResult < ::Prism::Result + # Create a new parse result object with the given values. + # + # @return [ParseResult] a new instance of ParseResult + # + # source://prism//lib/prism/parse_result.rb#587 + 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. + # + # source://prism//lib/prism/parse_result.rb#598 + def attach_comments!; end + + # Implement the hash pattern matching interface for ParseResult. + # + # source://prism//lib/prism/parse_result.rb#593 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # Walk the tree and mark nodes that are on a new line, loosely emulating + # the behavior of CRuby's `:line` tracepoint event. + # + # source://prism//lib/prism/parse_result.rb#604 + def mark_newlines!; end + + # The syntax tree that was parsed from the source code. + # + # source://prism//lib/prism/parse_result.rb#584 + 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. +# +# source://prism//lib/prism/parse_result/comments.rb#19 +class Prism::ParseResult::Comments + # Create a new Comments object that will attach comments to the given + # parse result. + # + # @return [Comments] a new instance of Comments + # + # source://prism//lib/prism/parse_result/comments.rb#86 + def initialize(parse_result); end + + # Attach the comments to their respective locations in the tree by + # mutating the parse result. + # + # source://prism//lib/prism/parse_result/comments.rb#92 + def attach!; end + + # The parse result that we are attaching comments to. + # + # source://prism//lib/prism/parse_result/comments.rb#82 + def parse_result; end + + private + + # Responsible for finding the nearest targets to the given comment within + # the context of the given encapsulating node. + # + # source://prism//lib/prism/parse_result/comments.rb#119 + 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. +# +# source://prism//lib/prism/parse_result/comments.rb#53 +class Prism::ParseResult::Comments::LocationTarget + # @return [LocationTarget] a new instance of LocationTarget + # + # source://prism//lib/prism/parse_result/comments.rb#56 + def initialize(location); end + + # @return [Boolean] + # + # source://prism//lib/prism/parse_result/comments.rb#68 + def encloses?(comment); end + + # source://prism//lib/prism/parse_result/comments.rb#64 + def end_offset; end + + # source://prism//lib/prism/parse_result/comments.rb#72 + def leading_comment(comment); end + + # source://prism//lib/prism/parse_result/comments.rb#54 + def location; end + + # source://prism//lib/prism/parse_result/comments.rb#60 + def start_offset; end + + # source://prism//lib/prism/parse_result/comments.rb#76 + def trailing_comment(comment); end +end + +# A target for attaching comments that is based on a specific node's +# location. +# +# source://prism//lib/prism/parse_result/comments.rb#22 +class Prism::ParseResult::Comments::NodeTarget + # @return [NodeTarget] a new instance of NodeTarget + # + # source://prism//lib/prism/parse_result/comments.rb#25 + def initialize(node); end + + # @return [Boolean] + # + # source://prism//lib/prism/parse_result/comments.rb#37 + def encloses?(comment); end + + # source://prism//lib/prism/parse_result/comments.rb#33 + def end_offset; end + + # source://prism//lib/prism/parse_result/comments.rb#42 + def leading_comment(comment); end + + # source://prism//lib/prism/parse_result/comments.rb#23 + def node; end + + # source://prism//lib/prism/parse_result/comments.rb#29 + def start_offset; end + + # source://prism//lib/prism/parse_result/comments.rb#46 + def trailing_comment(comment); 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. +# +# source://prism//lib/prism/parse_result/newlines.rb#25 +class Prism::ParseResult::Newlines < ::Prism::Visitor + # Create a new Newlines visitor with the given newline offsets. + # + # @return [Newlines] a new instance of Newlines + # + # source://prism//lib/prism/parse_result/newlines.rb#27 + def initialize(lines); end + + # Permit block/lambda nodes to mark newlines within themselves. + # + # source://prism//lib/prism/parse_result/newlines.rb#33 + def visit_block_node(node); end + + # Mark if/unless nodes as newlines. + # + # source://prism//lib/prism/parse_result/newlines.rb#47 + def visit_if_node(node); end + + # Permit block/lambda nodes to mark newlines within themselves. + # + # source://prism//lib/prism/parse_result/newlines.rb#33 + def visit_lambda_node(node); end + + # Permit statements lists to mark newlines within themselves. + # + # source://prism//lib/prism/parse_result/newlines.rb#55 + def visit_statements_node(node); end + + # Mark if/unless nodes as newlines. + # + # source://prism//lib/prism/parse_result/newlines.rb#47 + def visit_unless_node(node); end +end + +# This represents a warning that was encountered during parsing. +# +# source://prism//lib/prism/parse_result.rb#485 +class Prism::ParseWarning + # Create a new warning object with the given message and location. + # + # @return [ParseWarning] a new instance of ParseWarning + # + # source://prism//lib/prism/parse_result.rb#500 + 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. + # + # source://prism//lib/prism/parse_result.rb#508 + 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. + # + # source://prism//lib/prism/parse_result.rb#513 + sig { returns(String) } + def inspect; end + + # The level of this warning. + # + # source://prism//lib/prism/parse_result.rb#497 + sig { returns(Symbol) } + def level; end + + # A Location object representing the location of this warning in the source. + # + # source://prism//lib/prism/parse_result.rb#494 + sig { returns(Prism::Location) } + def location; end + + # The message associated with this warning. + # + # source://prism//lib/prism/parse_result.rb#491 + 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. + # + # source://prism//lib/prism/parse_result.rb#488 + 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. +# +# source://prism//lib/prism/pattern.rb#37 +class Prism::Pattern + # Create a new pattern with the given query. The query should be a string + # containing a Ruby pattern matching expression. + # + # @return [Pattern] a new instance of Pattern + # + # source://prism//lib/prism/pattern.rb#63 + def initialize(query); end + + # Compile the query into a callable object that can be used to match against + # nodes. + # + # @raise [CompilationError] + # + # source://prism//lib/prism/pattern.rb#70 + def compile; end + + # The query that this pattern was initialized with. + # + # source://prism//lib/prism/pattern.rb#59 + 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. + # + # source://prism//lib/prism/pattern.rb#86 + def scan(root); end + + private + + # Shortcut for combining two procs into one that returns true if both return + # true. + # + # source://prism//lib/prism/pattern.rb#102 + def combine_and(left, right); end + + # Shortcut for combining two procs into one that returns true if either + # returns true. + # + # source://prism//lib/prism/pattern.rb#108 + def combine_or(left, right); end + + # in foo | bar + # + # source://prism//lib/prism/pattern.rb#143 + def compile_alternation_pattern_node(node); end + + # in [foo, bar, baz] + # + # source://prism//lib/prism/pattern.rb#118 + def compile_array_pattern_node(node); end + + # Compile a name associated with a constant. + # + # source://prism//lib/prism/pattern.rb#168 + def compile_constant_name(node, name); end + + # in Prism::ConstantReadNode + # + # source://prism//lib/prism/pattern.rb#148 + def compile_constant_path_node(node); end + + # in ConstantReadNode + # in String + # + # source://prism//lib/prism/pattern.rb#163 + def compile_constant_read_node(node); end + + # Raise an error because the given node is not supported. + # + # @raise [CompilationError] + # + # source://prism//lib/prism/pattern.rb#113 + def compile_error(node); end + + # in InstanceVariableReadNode[name: Symbol] + # in { name: Symbol } + # + # source://prism//lib/prism/pattern.rb#184 + def compile_hash_pattern_node(node); end + + # in nil + # + # source://prism//lib/prism/pattern.rb#214 + def compile_nil_node(node); end + + # Compile any kind of node. Dispatch out to the individual compilation + # methods based on the type of node. + # + # source://prism//lib/prism/pattern.rb#243 + def compile_node(node); end + + # in /foo/ + # + # source://prism//lib/prism/pattern.rb#219 + def compile_regular_expression_node(node); end + + # in "" + # in "foo" + # + # source://prism//lib/prism/pattern.rb#227 + def compile_string_node(node); end + + # in :+ + # in :foo + # + # source://prism//lib/prism/pattern.rb#235 + 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. +# +# source://prism//lib/prism/pattern.rb#40 +class Prism::Pattern::CompilationError < ::StandardError + # Create a new CompilationError with the given representation of the node + # that caused the error. + # + # @return [CompilationError] a new instance of CompilationError + # + # source://prism//lib/prism/pattern.rb#43 + def initialize(repr); end +end + +# Represents the use of the `^` operator for pinning an expression in a pattern matching expression. +# +# foo in ^(bar) +# ^^^^^^ +# +# source://prism//lib/prism/node.rb#14793 +class Prism::PinnedExpressionNode < ::Prism::Node + # def initialize: (Prism::node expression, Location operator_loc, Location lparen_loc, Location rparen_loc, Location location) -> void + # + # @return [PinnedExpressionNode] a new instance of PinnedExpressionNode + # + # source://prism//lib/prism/node.rb#14795 + sig do + params( + source: Prism::Source, + expression: Prism::Node, + operator_loc: Prism::Location, + lparen_loc: Prism::Location, + rparen_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, expression, operator_loc, lparen_loc, rparen_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#14911 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#14805 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14810 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#14820 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#14815 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?expression: Prism::node, ?operator_loc: Location, ?lparen_loc: Location, ?rparen_loc: Location, ?location: Location) -> PinnedExpressionNode + # + # source://prism//lib/prism/node.rb#14825 + sig do + params( + expression: Prism::Node, + operator_loc: Prism::Location, + lparen_loc: Prism::Location, + rparen_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::PinnedExpressionNode) + end + def copy(expression: T.unsafe(nil), operator_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14810 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Prism::node, operator_loc: Location, lparen_loc: Location, rparen_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#14833 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # attr_reader expression: Prism::node + # + # source://prism//lib/prism/node.rb#14838 + sig { returns(Prism::Node) } + def expression; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#14877 + sig { override.returns(String) } + def inspect; end + + # def lparen: () -> String + # + # source://prism//lib/prism/node.rb#14867 + sig { returns(String) } + def lparen; end + + # attr_reader lparen_loc: Location + # + # source://prism//lib/prism/node.rb#14848 + sig { returns(Prism::Location) } + def lparen_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#14862 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#14841 + sig { returns(Prism::Location) } + def operator_loc; end + + # def rparen: () -> String + # + # source://prism//lib/prism/node.rb#14872 + sig { returns(String) } + def rparen; end + + # attr_reader rparen_loc: Location + # + # source://prism//lib/prism/node.rb#14855 + sig { returns(Prism::Location) } + def rparen_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14895 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14905 + def type; end + end +end + +# Represents the use of the `^` operator for pinning a variable in a pattern matching expression. +# +# foo in ^bar +# ^^^^ +# +# source://prism//lib/prism/node.rb#14924 +class Prism::PinnedVariableNode < ::Prism::Node + # def initialize: (Prism::node variable, Location operator_loc, Location location) -> void + # + # @return [PinnedVariableNode] a new instance of PinnedVariableNode + # + # source://prism//lib/prism/node.rb#14926 + sig do + params( + source: Prism::Source, + variable: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, variable, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#15016 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#14934 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14939 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#14949 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#14944 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?variable: Prism::node, ?operator_loc: Location, ?location: Location) -> PinnedVariableNode + # + # source://prism//lib/prism/node.rb#14954 + sig do + params( + variable: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::PinnedVariableNode) + end + def copy(variable: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#14939 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { variable: Prism::node, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#14962 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#14982 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#14977 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#14970 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15000 + sig { override.returns(Symbol) } + def type; end + + # attr_reader variable: Prism::node + # + # source://prism//lib/prism/node.rb#14967 + sig { returns(Prism::Node) } + def variable; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15010 + def type; end + end +end + +# Represents the use of the `END` keyword. +# +# END { foo } +# ^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#15027 +class Prism::PostExecutionNode < ::Prism::Node + # def initialize: (StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc, Location location) -> void + # + # @return [PostExecutionNode] a new instance of PostExecutionNode + # + # source://prism//lib/prism/node.rb#15029 + sig do + params( + source: Prism::Source, + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, statements, keyword_loc, opening_loc, closing_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#15147 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#15039 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15044 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#15108 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#15091 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#15056 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#15049 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> PostExecutionNode + # + # source://prism//lib/prism/node.rb#15061 + sig do + params( + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::PostExecutionNode) + end + def copy(statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15044 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#15069 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#15113 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#15098 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#15077 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#15103 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#15084 + sig { returns(Prism::Location) } + def opening_loc; end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#15074 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15131 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15141 + def type; end + end +end + +# Represents the use of the `BEGIN` keyword. +# +# BEGIN { foo } +# ^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#15160 +class Prism::PreExecutionNode < ::Prism::Node + # def initialize: (StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc, Location location) -> void + # + # @return [PreExecutionNode] a new instance of PreExecutionNode + # + # source://prism//lib/prism/node.rb#15162 + sig do + params( + source: Prism::Source, + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, statements, keyword_loc, opening_loc, closing_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#15280 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#15172 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15177 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#15241 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#15224 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#15189 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#15182 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> PreExecutionNode + # + # source://prism//lib/prism/node.rb#15194 + sig do + params( + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::PreExecutionNode) + end + def copy(statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15177 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#15202 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#15246 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#15231 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#15210 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#15236 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#15217 + sig { returns(Prism::Location) } + def opening_loc; end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#15207 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15264 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15274 + def type; end + end +end + +# The top level node of any parse tree. +# +# source://prism//lib/prism/node.rb#15290 +class Prism::ProgramNode < ::Prism::Node + # def initialize: (Array[Symbol] locals, StatementsNode statements, Location location) -> void + # + # @return [ProgramNode] a new instance of ProgramNode + # + # source://prism//lib/prism/node.rb#15292 + sig do + params( + source: Prism::Source, + locals: T::Array[Symbol], + statements: Prism::StatementsNode, + location: Prism::Location + ).void + end + def initialize(source, locals, statements, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#15373 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#15300 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15305 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#15315 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#15310 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?locals: Array[Symbol], ?statements: StatementsNode, ?location: Location) -> ProgramNode + # + # source://prism//lib/prism/node.rb#15320 + sig do + params( + locals: T::Array[Symbol], + statements: Prism::StatementsNode, + location: Prism::Location + ).returns(Prism::ProgramNode) + end + def copy(locals: T.unsafe(nil), statements: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15305 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], statements: StatementsNode, location: Location } + # + # source://prism//lib/prism/node.rb#15328 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#15339 + sig { override.returns(String) } + def inspect; end + + # attr_reader locals: Array[Symbol] + # + # source://prism//lib/prism/node.rb#15333 + sig { returns(T::Array[Symbol]) } + def locals; end + + # attr_reader statements: StatementsNode + # + # source://prism//lib/prism/node.rb#15336 + sig { returns(Prism::StatementsNode) } + def statements; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15357 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15367 + def type; end + end +end + +# Flags for range and flip-flop nodes. +# +# source://prism//lib/prism/node.rb#19208 +module Prism::RangeFlags; end + +# ... operator +# +# source://prism//lib/prism/node.rb#19210 +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/ +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#15388 +class Prism::RangeNode < ::Prism::Node + # def initialize: (Integer flags, Prism::node? left, Prism::node? right, Location operator_loc, Location location) -> void + # + # @return [RangeNode] a new instance of RangeNode + # + # source://prism//lib/prism/node.rb#15390 + sig do + params( + source: Prism::Source, + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, flags, left, right, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#15510 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#15400 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15405 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#15418 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#15410 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location, ?location: Location) -> RangeNode + # + # source://prism//lib/prism/node.rb#15423 + sig do + params( + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::RangeNode) + end + def copy(flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15405 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, left: Prism::node?, right: Prism::node?, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#15431 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def exclude_end?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15466 + sig { returns(T::Boolean) } + def exclude_end?; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#15476 + 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 + # ^^^^^ + # + # source://prism//lib/prism/node.rb#15446 + sig { returns(T.nilable(Prism::Node)) } + def left; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#15471 + sig { returns(String) } + def operator; end + + # The location of the `..` or `...` operator. + # + # source://prism//lib/prism/node.rb#15459 + 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. + # + # source://prism//lib/prism/node.rb#15456 + sig { returns(T.nilable(Prism::Node)) } + def right; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15494 + sig { override.returns(Symbol) } + def type; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#15436 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15504 + def type; end + end +end + +# Represents a rational number literal. +# +# 1.0r +# ^^^^ +# +# source://prism//lib/prism/node.rb#15523 +class Prism::RationalNode < ::Prism::Node + # def initialize: (Integer flags, Integer numerator, Integer denominator, Location location) -> void + # + # @return [RationalNode] a new instance of RationalNode + # + # source://prism//lib/prism/node.rb#15525 + sig do + params( + source: Prism::Source, + flags: Integer, + numerator: Integer, + denominator: Integer, + location: Prism::Location + ).void + end + def initialize(source, flags, numerator, denominator, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#15635 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#15534 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def binary?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15581 + sig { returns(T::Boolean) } + def binary?; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15539 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#15549 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#15544 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?numerator: Integer, ?denominator: Integer, ?location: Location) -> RationalNode + # + # source://prism//lib/prism/node.rb#15554 + sig do + params( + flags: Integer, + numerator: Integer, + denominator: Integer, + location: Prism::Location + ).returns(Prism::RationalNode) + end + def copy(flags: T.unsafe(nil), numerator: T.unsafe(nil), denominator: T.unsafe(nil), location: T.unsafe(nil)); end + + # def decimal?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15586 + sig { returns(T::Boolean) } + def decimal?; end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15539 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, numerator: Integer, denominator: Integer, location: Location } + # + # source://prism//lib/prism/node.rb#15562 + 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 + # + # source://prism//lib/prism/node.rb#15578 + sig { returns(Integer) } + def denominator; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def hexadecimal?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15596 + sig { returns(T::Boolean) } + def hexadecimal?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#15601 + sig { override.returns(String) } + def inspect; end + + # The numerator of the rational number. + # + # 1.5r # numerator 3 + # + # source://prism//lib/prism/node.rb#15573 + 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. + # + # source://prism//lib/prism/node_ext.rb#114 + def numeric; end + + # def octal?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15591 + sig { returns(T::Boolean) } + def octal?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15619 + sig { override.returns(Symbol) } + def type; end + + # Returns the value of the node as a Ruby Rational. + # + # source://prism//lib/prism/node_ext.rb#108 + sig { returns(Rational) } + def value; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#15567 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15629 + def type; end + end +end + +# Represents the use of the `redo` keyword. +# +# redo +# ^^^^ +# +# source://prism//lib/prism/node.rb#15647 +class Prism::RedoNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [RedoNode] a new instance of RedoNode + # + # source://prism//lib/prism/node.rb#15649 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#15722 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#15655 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15660 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#15670 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#15665 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?location: Location) -> RedoNode + # + # source://prism//lib/prism/node.rb#15675 + sig { params(location: Prism::Location).returns(Prism::RedoNode) } + def copy(location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15660 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#15683 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#15688 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15706 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15716 + 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. +# +# source://prism//lib/prism/reflection.rb#13 +module Prism::Reflection + class << self + # Returns the fields for the given node. + # + # source://prism//lib/prism/reflection.rb#104 + 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. +# +# source://prism//lib/prism/reflection.rb#45 +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. +# +# source://prism//lib/prism/reflection.rb#55 +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. +# +# source://prism//lib/prism/reflection.rb#16 +class Prism::Reflection::Field + # Initializes the field with the given name. + # + # @return [Field] a new instance of Field + # + # source://prism//lib/prism/reflection.rb#21 + sig { params(name: Symbol).void } + def initialize(name); end + + # The name of the field. + # + # source://prism//lib/prism/reflection.rb#18 + 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. +# +# source://prism//lib/prism/reflection.rb#92 +class Prism::Reflection::FlagsField < ::Prism::Reflection::Field + # Initializes the flags field with the given name and flags. + # + # @return [FlagsField] a new instance of FlagsField + # + # source://prism//lib/prism/reflection.rb#97 + sig { params(name: Symbol, flags: T::Array[Symbol]).void } + def initialize(name, flags); end + + # The names of the flags in the bitset. + # + # source://prism//lib/prism/reflection.rb#94 + 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. +# +# source://prism//lib/prism/reflection.rb#85 +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. +# +# source://prism//lib/prism/reflection.rb#79 +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. +# +# source://prism//lib/prism/reflection.rb#67 +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. +# +# source://prism//lib/prism/reflection.rb#28 +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. +# +# source://prism//lib/prism/reflection.rb#39 +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. +# +# source://prism//lib/prism/reflection.rb#50 +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. +# +# source://prism//lib/prism/reflection.rb#73 +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. +# +# source://prism//lib/prism/reflection.rb#34 +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. +# +# source://prism//lib/prism/reflection.rb#61 +class Prism::Reflection::StringField < ::Prism::Reflection::Field; end + +# Flags for regular expression and match last line nodes. +# +# source://prism//lib/prism/node.rb#19214 +module Prism::RegularExpressionFlags; end + +# n - forces the ASCII-8BIT encoding +# +# source://prism//lib/prism/node.rb#19231 +Prism::RegularExpressionFlags::ASCII_8BIT = T.let(T.unsafe(nil), Integer) + +# e - forces the EUC-JP encoding +# +# source://prism//lib/prism/node.rb#19228 +Prism::RegularExpressionFlags::EUC_JP = T.let(T.unsafe(nil), Integer) + +# x - ignores whitespace and allows comments in regular expressions +# +# source://prism//lib/prism/node.rb#19219 +Prism::RegularExpressionFlags::EXTENDED = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to binary +# +# source://prism//lib/prism/node.rb#19243 +Prism::RegularExpressionFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to US-ASCII +# +# source://prism//lib/prism/node.rb#19246 +Prism::RegularExpressionFlags::FORCED_US_ASCII_ENCODING = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to UTF-8 +# +# source://prism//lib/prism/node.rb#19240 +Prism::RegularExpressionFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) + +# i - ignores the case of characters when matching +# +# source://prism//lib/prism/node.rb#19216 +Prism::RegularExpressionFlags::IGNORE_CASE = T.let(T.unsafe(nil), Integer) + +# m - allows $ to match the end of lines within strings +# +# source://prism//lib/prism/node.rb#19222 +Prism::RegularExpressionFlags::MULTI_LINE = T.let(T.unsafe(nil), Integer) + +# o - only interpolates values into the regular expression once +# +# source://prism//lib/prism/node.rb#19225 +Prism::RegularExpressionFlags::ONCE = T.let(T.unsafe(nil), Integer) + +# u - forces the UTF-8 encoding +# +# source://prism//lib/prism/node.rb#19237 +Prism::RegularExpressionFlags::UTF_8 = T.let(T.unsafe(nil), Integer) + +# s - forces the Windows-31J encoding +# +# source://prism//lib/prism/node.rb#19234 +Prism::RegularExpressionFlags::WINDOWS_31J = T.let(T.unsafe(nil), Integer) + +# Represents a regular expression literal with no interpolation. +# +# /foo/i +# ^^^^^^ +# +# source://prism//lib/prism/node.rb#15731 +class Prism::RegularExpressionNode < ::Prism::Node + include ::Prism::RegularExpressionOptions + + # def initialize: (Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped, Location location) -> void + # + # @return [RegularExpressionNode] a new instance of RegularExpressionNode + # + # source://prism//lib/prism/node.rb#15733 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).void + end + def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#15909 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#15744 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def ascii_8bit?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15830 + sig { returns(T::Boolean) } + def ascii_8bit?; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15749 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#15870 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#15795 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#15759 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#15754 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def content: () -> String + # + # source://prism//lib/prism/node.rb#15865 + sig { returns(String) } + def content; end + + # attr_reader content_loc: Location + # + # source://prism//lib/prism/node.rb#15788 + sig { returns(Prism::Location) } + def content_loc; end + + # def copy: (?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String, ?location: Location) -> RegularExpressionNode + # + # source://prism//lib/prism/node.rb#15764 + sig do + params( + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).returns(Prism::RegularExpressionNode) + end + def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15749 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location } + # + # source://prism//lib/prism/node.rb#15772 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def euc_jp?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15825 + sig { returns(T::Boolean) } + def euc_jp?; end + + # def extended?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15810 + sig { returns(T::Boolean) } + def extended?; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def forced_binary_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15850 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_us_ascii_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15855 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15845 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def ignore_case?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15805 + sig { returns(T::Boolean) } + def ignore_case?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#15875 + sig { override.returns(String) } + def inspect; end + + # def multi_line?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15815 + sig { returns(T::Boolean) } + def multi_line?; end + + # def once?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15820 + sig { returns(T::Boolean) } + def once?; end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#15860 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#15781 + sig { returns(Prism::Location) } + def opening_loc; end + + sig { returns(Integer) } + def options; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15893 + sig { override.returns(Symbol) } + def type; end + + # attr_reader unescaped: String + # + # source://prism//lib/prism/node.rb#15802 + sig { returns(String) } + def unescaped; end + + # def utf_8?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15840 + sig { returns(T::Boolean) } + def utf_8?; end + + # def windows_31j?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15835 + sig { returns(T::Boolean) } + def windows_31j?; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#15777 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15903 + def type; end + end +end + +# source://prism//lib/prism/node_ext.rb#20 +module Prism::RegularExpressionOptions + # Returns a numeric value that represents the flags that were used to create + # the regular expression. + # + # source://prism//lib/prism/node_ext.rb#23 + def options; end +end + +# Represents a required keyword parameter to a method, block, or lambda definition. +# +# def a(b: ) +# ^^ +# end +# +# source://prism//lib/prism/node.rb#15924 +class Prism::RequiredKeywordParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol name, Location name_loc, Location location) -> void + # + # @return [RequiredKeywordParameterNode] a new instance of RequiredKeywordParameterNode + # + # source://prism//lib/prism/node.rb#15926 + sig do + params( + source: Prism::Source, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, flags, name, name_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#16021 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#15935 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15940 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#15950 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#15945 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?name: Symbol, ?name_loc: Location, ?location: Location) -> RequiredKeywordParameterNode + # + # source://prism//lib/prism/node.rb#15955 + sig do + params( + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::RequiredKeywordParameterNode) + end + def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15940 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, name_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#15963 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#15987 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#15972 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#15975 + sig { returns(Prism::Location) } + def name_loc; end + + # def repeated_parameter?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15982 + sig { returns(T::Boolean) } + def repeated_parameter?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16005 + sig { override.returns(Symbol) } + def type; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#15968 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16015 + def type; end + end +end + +# Represents a required parameter to a method, block, or lambda definition. +# +# def a(b) +# ^ +# end +# +# source://prism//lib/prism/node.rb#16034 +class Prism::RequiredParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol name, Location location) -> void + # + # @return [RequiredParameterNode] a new instance of RequiredParameterNode + # + # source://prism//lib/prism/node.rb#16036 + sig { params(source: Prism::Source, flags: Integer, name: Symbol, location: Prism::Location).void } + def initialize(source, flags, name, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#16123 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#16044 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16049 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#16059 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#16054 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?name: Symbol, ?location: Location) -> RequiredParameterNode + # + # source://prism//lib/prism/node.rb#16064 + sig { params(flags: Integer, name: Symbol, location: Prism::Location).returns(Prism::RequiredParameterNode) } + def copy(flags: T.unsafe(nil), name: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16049 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#16072 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#16089 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#16081 + sig { returns(Symbol) } + def name; end + + # def repeated_parameter?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#16084 + sig { returns(T::Boolean) } + def repeated_parameter?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16107 + sig { override.returns(Symbol) } + def type; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#16077 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16117 + def type; end + end +end + +# Represents an expression modified with a rescue. +# +# foo rescue nil +# ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#16134 +class Prism::RescueModifierNode < ::Prism::Node + # def initialize: (Prism::node expression, Location keyword_loc, Prism::node rescue_expression, Location location) -> void + # + # @return [RescueModifierNode] a new instance of RescueModifierNode + # + # source://prism//lib/prism/node.rb#16136 + sig do + params( + source: Prism::Source, + expression: Prism::Node, + keyword_loc: Prism::Location, + rescue_expression: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, expression, keyword_loc, rescue_expression, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#16230 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#16145 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16150 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#16160 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#16155 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?expression: Prism::node, ?keyword_loc: Location, ?rescue_expression: Prism::node, ?location: Location) -> RescueModifierNode + # + # source://prism//lib/prism/node.rb#16165 + sig do + params( + expression: Prism::Node, + keyword_loc: Prism::Location, + rescue_expression: Prism::Node, + location: Prism::Location + ).returns(Prism::RescueModifierNode) + end + def copy(expression: T.unsafe(nil), keyword_loc: T.unsafe(nil), rescue_expression: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16150 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Prism::node, keyword_loc: Location, rescue_expression: Prism::node, location: Location } + # + # source://prism//lib/prism/node.rb#16173 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # attr_reader expression: Prism::node + # + # source://prism//lib/prism/node.rb#16178 + sig { returns(Prism::Node) } + def expression; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#16196 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#16191 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#16181 + sig { returns(Prism::Location) } + def keyword_loc; end + + # source://prism//lib/prism/parse_result/newlines.rb#115 + def newline!(lines); end + + # attr_reader rescue_expression: Prism::node + # + # source://prism//lib/prism/node.rb#16188 + sig { returns(Prism::Node) } + def rescue_expression; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16214 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16224 + 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 `exception` field. +# +# source://prism//lib/prism/node.rb#16247 +class Prism::RescueNode < ::Prism::Node + # def initialize: (Location keyword_loc, Array[Prism::node] exceptions, Location? operator_loc, Prism::node? reference, StatementsNode? statements, RescueNode? consequent, Location location) -> void + # + # @return [RescueNode] a new instance of RescueNode + # + # source://prism//lib/prism/node.rb#16249 + sig do + params( + source: Prism::Source, + keyword_loc: Prism::Location, + exceptions: T::Array[Prism::Node], + operator_loc: T.nilable(Prism::Location), + reference: T.nilable(Prism::Node), + statements: T.nilable(Prism::StatementsNode), + consequent: T.nilable(Prism::RescueNode), + location: Prism::Location + ).void + end + def initialize(source, keyword_loc, exceptions, operator_loc, reference, statements, consequent, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#16375 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#16261 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16266 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#16281 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#16271 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # attr_reader consequent: RescueNode? + # + # source://prism//lib/prism/node.rb#16328 + sig { returns(T.nilable(Prism::RescueNode)) } + def consequent; end + + # def copy: (?keyword_loc: Location, ?exceptions: Array[Prism::node], ?operator_loc: Location?, ?reference: Prism::node?, ?statements: StatementsNode?, ?consequent: RescueNode?, ?location: Location) -> RescueNode + # + # source://prism//lib/prism/node.rb#16286 + sig do + params( + keyword_loc: Prism::Location, + exceptions: T::Array[Prism::Node], + operator_loc: T.nilable(Prism::Location), + reference: T.nilable(Prism::Node), + statements: T.nilable(Prism::StatementsNode), + consequent: T.nilable(Prism::RescueNode), + location: Prism::Location + ).returns(Prism::RescueNode) + end + def copy(keyword_loc: T.unsafe(nil), exceptions: T.unsafe(nil), operator_loc: T.unsafe(nil), reference: T.unsafe(nil), statements: T.unsafe(nil), consequent: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16266 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, exceptions: Array[Prism::node], operator_loc: Location?, reference: Prism::node?, statements: StatementsNode?, consequent: RescueNode?, location: Location } + # + # source://prism//lib/prism/node.rb#16294 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # attr_reader exceptions: Array[Prism::node] + # + # source://prism//lib/prism/node.rb#16306 + sig { returns(T::Array[Prism::Node]) } + def exceptions; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#16341 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#16331 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#16299 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def operator: () -> String? + # + # source://prism//lib/prism/node.rb#16336 + sig { returns(T.nilable(String)) } + def operator; end + + # attr_reader operator_loc: Location? + # + # source://prism//lib/prism/node.rb#16309 + sig { returns(T.nilable(Prism::Location)) } + def operator_loc; end + + # attr_reader reference: Prism::node? + # + # source://prism//lib/prism/node.rb#16322 + sig { returns(T.nilable(Prism::Node)) } + def reference; end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#16325 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16359 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16369 + def type; end + end +end + +# Represents a rest parameter to a method, block, or lambda definition. +# +# def a(*b) +# ^^ +# end +# +# source://prism//lib/prism/node.rb#16392 +class Prism::RestParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void + # + # @return [RestParameterNode] a new instance of RestParameterNode + # + # source://prism//lib/prism/node.rb#16394 + sig do + params( + source: Prism::Source, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, flags, name, name_loc, operator_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#16508 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#16404 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16409 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#16419 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#16414 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location, ?location: Location) -> RestParameterNode + # + # source://prism//lib/prism/node.rb#16424 + sig do + params( + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::RestParameterNode) + end + def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16409 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#16432 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#16474 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol? + # + # source://prism//lib/prism/node.rb#16441 + sig { returns(T.nilable(Symbol)) } + def name; end + + # attr_reader name_loc: Location? + # + # source://prism//lib/prism/node.rb#16444 + sig { returns(T.nilable(Prism::Location)) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#16469 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#16457 + sig { returns(Prism::Location) } + def operator_loc; end + + # def repeated_parameter?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#16464 + sig { returns(T::Boolean) } + def repeated_parameter?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16492 + sig { override.returns(Symbol) } + def type; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#16437 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16502 + 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. +# +# source://prism//lib/prism/parse_result.rb#521 +class Prism::Result + # Create a new result object with the given values. + # + # @return [Result] a new instance of Result + # + # source://prism//lib/prism/parse_result.rb#543 + 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 + + # The list of comments that were encountered during parsing. + # + # source://prism//lib/prism/parse_result.rb#523 + 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. + # + # source://prism//lib/prism/parse_result.rb#531 + sig { returns(T.nilable(Prism::Location)) } + def data_loc; end + + # Implement the hash pattern matching interface for Result. + # + # source://prism//lib/prism/parse_result.rb#553 + 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. + # + # source://prism//lib/prism/parse_result.rb#558 + sig { returns(Encoding) } + def encoding; end + + # The list of errors that were generated during parsing. + # + # source://prism//lib/prism/parse_result.rb#534 + sig { returns(T::Array[Prism::ParseError]) } + def errors; end + + # Returns true if there were errors during parsing and false if there were + # not. + # + # @return [Boolean] + # + # source://prism//lib/prism/parse_result.rb#570 + sig { returns(T::Boolean) } + def failure?; end + + # The list of magic comments that were encountered during parsing. + # + # source://prism//lib/prism/parse_result.rb#526 + sig { returns(T::Array[Prism::MagicComment]) } + def magic_comments; end + + # A Source instance that represents the source code that was parsed. + # + # source://prism//lib/prism/parse_result.rb#540 + sig { returns(Prism::Source) } + def source; end + + # Returns true if there were no errors during parsing and false if there + # were. + # + # @return [Boolean] + # + # source://prism//lib/prism/parse_result.rb#564 + sig { returns(T::Boolean) } + def success?; end + + # The list of warnings that were generated during parsing. + # + # source://prism//lib/prism/parse_result.rb#537 + sig { returns(T::Array[Prism::ParseWarning]) } + def warnings; end +end + +# Represents the use of the `retry` keyword. +# +# retry +# ^^^^^ +# +# source://prism//lib/prism/node.rb#16521 +class Prism::RetryNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [RetryNode] a new instance of RetryNode + # + # source://prism//lib/prism/node.rb#16523 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#16596 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#16529 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16534 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#16544 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#16539 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?location: Location) -> RetryNode + # + # source://prism//lib/prism/node.rb#16549 + sig { params(location: Prism::Location).returns(Prism::RetryNode) } + def copy(location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16534 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#16557 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#16562 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16580 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16590 + def type; end + end +end + +# Represents the use of the `return` keyword. +# +# return 1 +# ^^^^^^^^ +# +# source://prism//lib/prism/node.rb#16605 +class Prism::ReturnNode < ::Prism::Node + # def initialize: (Integer flags, Location keyword_loc, ArgumentsNode? arguments, Location location) -> void + # + # @return [ReturnNode] a new instance of ReturnNode + # + # source://prism//lib/prism/node.rb#16607 + sig do + params( + source: Prism::Source, + flags: Integer, + keyword_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + location: Prism::Location + ).void + end + def initialize(source, flags, keyword_loc, arguments, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#16709 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#16616 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # source://prism//lib/prism/node.rb#16662 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16621 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#16633 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#16626 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?keyword_loc: Location, ?arguments: ArgumentsNode?, ?location: Location) -> ReturnNode + # + # source://prism//lib/prism/node.rb#16638 + sig do + params( + flags: Integer, + keyword_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + location: Prism::Location + ).returns(Prism::ReturnNode) + end + def copy(flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), arguments: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16621 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, keyword_loc: Location, arguments: ArgumentsNode?, location: Location } + # + # source://prism//lib/prism/node.rb#16646 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#16675 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#16670 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#16655 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def redundant?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#16665 + sig { returns(T::Boolean) } + def redundant?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16693 + sig { override.returns(Symbol) } + def type; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#16651 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16703 + def type; end + end +end + +# Flags for return nodes. +# +# source://prism//lib/prism/node.rb#19250 +module Prism::ReturnNodeFlags; end + +# a return statement that is redundant because it is the last statement in a method +# +# source://prism//lib/prism/node.rb#19252 +Prism::ReturnNodeFlags::REDUNDANT = T.let(T.unsafe(nil), Integer) + +# Represents the `self` keyword. +# +# self +# ^^^^ +# +# source://prism//lib/prism/node.rb#16721 +class Prism::SelfNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [SelfNode] a new instance of SelfNode + # + # source://prism//lib/prism/node.rb#16723 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#16796 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#16729 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16734 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#16744 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#16739 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?location: Location) -> SelfNode + # + # source://prism//lib/prism/node.rb#16749 + sig { params(location: Prism::Location).returns(Prism::SelfNode) } + def copy(location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16734 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#16757 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#16762 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16780 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16790 + def type; end + end +end + +# A module responsible for deserializing parse results. +# +# source://prism//lib/prism/serialize.rb#14 +module Prism::Serialize + class << self + # Deserialize the AST represented by the given string into a parse result. + # + # source://prism//lib/prism/serialize.rb#28 + def load(input, serialized); end + + # Deserialize the tokens represented by the given string into a parse + # result. + # + # source://prism//lib/prism/serialize.rb#40 + def load_tokens(source, serialized); end + end +end + +# source://prism//lib/prism/serialize.rb#44 +class Prism::Serialize::Loader + # @return [Loader] a new instance of Loader + # + # source://prism//lib/prism/serialize.rb#80 + def initialize(source, serialized); end + + # Returns the value of attribute constant_pool. + # + # source://prism//lib/prism/serialize.rb#77 + def constant_pool; end + + # Returns the value of attribute constant_pool_offset. + # + # source://prism//lib/prism/serialize.rb#77 + def constant_pool_offset; end + + # Returns the value of attribute encoding. + # + # source://prism//lib/prism/serialize.rb#76 + def encoding; end + + # Returns the value of attribute input. + # + # source://prism//lib/prism/serialize.rb#76 + def input; end + + # Returns the value of attribute io. + # + # source://prism//lib/prism/serialize.rb#76 + def io; end + + # source://prism//lib/prism/serialize.rb#118 + def load_comments; end + + # source://prism//lib/prism/serialize.rb#104 + def load_encoding; end + + # source://prism//lib/prism/serialize.rb#95 + def load_header; end + + # source://prism//lib/prism/serialize.rb#114 + def load_line_offsets; end + + # source://prism//lib/prism/serialize.rb#438 + def load_metadata; end + + # source://prism//lib/prism/serialize.rb#472 + def load_nodes; end + + # source://prism//lib/prism/serialize.rb#486 + def load_result; end + + # source://prism//lib/prism/serialize.rb#110 + def load_start_line; end + + # source://prism//lib/prism/serialize.rb#447 + def load_tokens; end + + # source://prism//lib/prism/serialize.rb#460 + def load_tokens_result; end + + # Returns the value of attribute serialized. + # + # source://prism//lib/prism/serialize.rb#76 + def serialized; end + + # Returns the value of attribute source. + # + # source://prism//lib/prism/serialize.rb#77 + def source; end + + # Returns the value of attribute start_line. + # + # source://prism//lib/prism/serialize.rb#78 + def start_line; end + + private + + # source://prism//lib/prism/serialize.rb#572 + def load_constant(index); end + + # source://prism//lib/prism/serialize.rb#525 + def load_double; end + + # source://prism//lib/prism/serialize.rb#540 + def load_embedded_string; end + + # source://prism//lib/prism/serialize.rb#602 + def load_error_level; end + + # source://prism//lib/prism/serialize.rb#514 + def load_integer; end + + # source://prism//lib/prism/serialize.rb#556 + def load_location; end + + # source://prism//lib/prism/serialize.rb#560 + def load_location_object; end + + # source://prism//lib/prism/serialize.rb#631 + def load_node; end + + # source://prism//lib/prism/serialize.rb#597 + def load_optional_constant; end + + # source://prism//lib/prism/serialize.rb#564 + def load_optional_location; end + + # source://prism//lib/prism/serialize.rb#568 + def load_optional_location_object; end + + # source://prism//lib/prism/serialize.rb#533 + def load_optional_node; end + + # source://prism//lib/prism/serialize.rb#593 + def load_required_constant; end + + # source://prism//lib/prism/serialize.rb#544 + def load_string; end + + # source://prism//lib/prism/serialize.rb#529 + def load_uint32; end + + # source://prism//lib/prism/serialize.rb#509 + 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 + # + # source://prism//lib/prism/serialize.rb#495 + def load_varuint; end + + # source://prism//lib/prism/serialize.rb#617 + def load_warning_level; end +end + +# source://prism//lib/prism/serialize.rb#127 +Prism::Serialize::Loader::DIAGNOSTIC_TYPES = T.let(T.unsafe(nil), Array) + +# StringIO is synchronized and that adds a high overhead on TruffleRuby. +# +# source://prism//lib/prism/serialize.rb#72 +Prism::Serialize::Loader::FastStringIO = StringIO + +# The major version of prism that we are expecting to find in the serialized +# strings. +# +# source://prism//lib/prism/serialize.rb#17 +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. +# +# source://prism//lib/prism/serialize.rb#21 +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. +# +# source://prism//lib/prism/serialize.rb#25 +Prism::Serialize::PATCH_VERSION = T.let(T.unsafe(nil), Integer) + +# The token types that can be indexed by their enum values. +# +# source://prism//lib/prism/serialize.rb#1863 +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 } +# ^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#16806 +class Prism::ShareableConstantNode < ::Prism::Node + # def initialize: (Integer flags, ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode write, Location location) -> void + # + # @return [ShareableConstantNode] a new instance of ShareableConstantNode + # + # source://prism//lib/prism/node.rb#16808 + sig do + params( + source: Prism::Source, + flags: Integer, + write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode), + location: Prism::Location + ).void + end + def initialize(source, flags, write, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#16905 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#16816 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16821 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#16831 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#16826 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode, ?location: Location) -> ShareableConstantNode + # + # source://prism//lib/prism/node.rb#16836 + sig do + params( + flags: Integer, + write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode), + location: Prism::Location + ).returns(Prism::ShareableConstantNode) + end + def copy(flags: T.unsafe(nil), write: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16821 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode, location: Location } + # + # source://prism//lib/prism/node.rb#16844 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def experimental_copy?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#16866 + sig { returns(T::Boolean) } + def experimental_copy?; end + + # def experimental_everything?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#16861 + sig { returns(T::Boolean) } + def experimental_everything?; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#16871 + sig { override.returns(String) } + def inspect; end + + # def literal?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#16856 + sig { returns(T::Boolean) } + def literal?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16889 + sig { override.returns(Symbol) } + def type; end + + # The constant write that should be modified with the shareability state. + # + # source://prism//lib/prism/node.rb#16853 + 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 + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#16849 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16899 + def type; end + end +end + +# Flags for shareable constant nodes. +# +# source://prism//lib/prism/node.rb#19256 +module Prism::ShareableConstantNodeFlags; end + +# constant writes that should be modified with shareable constant value experimental copy +# +# source://prism//lib/prism/node.rb#19264 +Prism::ShareableConstantNodeFlags::EXPERIMENTAL_COPY = T.let(T.unsafe(nil), Integer) + +# constant writes that should be modified with shareable constant value experimental everything +# +# source://prism//lib/prism/node.rb#19261 +Prism::ShareableConstantNodeFlags::EXPERIMENTAL_EVERYTHING = T.let(T.unsafe(nil), Integer) + +# constant writes that should be modified with shareable constant value literal +# +# source://prism//lib/prism/node.rb#19258 +Prism::ShareableConstantNodeFlags::LITERAL = T.let(T.unsafe(nil), Integer) + +# Represents a singleton class declaration involving the `class` keyword. +# +# class << self end +# ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#16916 +class Prism::SingletonClassNode < ::Prism::Node + # def initialize: (Array[Symbol] locals, Location class_keyword_loc, Location operator_loc, Prism::node expression, Prism::node? body, Location end_keyword_loc, Location location) -> void + # + # @return [SingletonClassNode] a new instance of SingletonClassNode + # + # source://prism//lib/prism/node.rb#16918 + sig do + params( + source: Prism::Source, + locals: T::Array[Symbol], + class_keyword_loc: Prism::Location, + operator_loc: Prism::Location, + expression: Prism::Node, + body: T.nilable(Prism::Node), + end_keyword_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#17045 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#16930 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader body: Prism::node? + # + # source://prism//lib/prism/node.rb#16986 + sig { returns(T.nilable(Prism::Node)) } + def body; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16935 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def class_keyword: () -> String + # + # source://prism//lib/prism/node.rb#16996 + sig { returns(String) } + def class_keyword; end + + # attr_reader class_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#16969 + sig { returns(Prism::Location) } + def class_keyword_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#16948 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#16940 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?locals: Array[Symbol], ?class_keyword_loc: Location, ?operator_loc: Location, ?expression: Prism::node, ?body: Prism::node?, ?end_keyword_loc: Location, ?location: Location) -> SingletonClassNode + # + # source://prism//lib/prism/node.rb#16953 + sig do + params( + locals: T::Array[Symbol], + class_keyword_loc: Prism::Location, + operator_loc: Prism::Location, + expression: Prism::Node, + body: T.nilable(Prism::Node), + end_keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::SingletonClassNode) + end + def copy(locals: T.unsafe(nil), class_keyword_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), expression: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16935 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], class_keyword_loc: Location, operator_loc: Location, expression: Prism::node, body: Prism::node?, end_keyword_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#16961 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def end_keyword: () -> String + # + # source://prism//lib/prism/node.rb#17006 + sig { returns(String) } + def end_keyword; end + + # attr_reader end_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#16989 + sig { returns(Prism::Location) } + def end_keyword_loc; end + + # attr_reader expression: Prism::node + # + # source://prism//lib/prism/node.rb#16983 + sig { returns(Prism::Node) } + def expression; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#17011 + sig { override.returns(String) } + def inspect; end + + # attr_reader locals: Array[Symbol] + # + # source://prism//lib/prism/node.rb#16966 + sig { returns(T::Array[Symbol]) } + def locals; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#17001 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#16976 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17029 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17039 + 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. +# +# source://prism//lib/prism/parse_result.rb#7 +class Prism::Source + # Create a new source object with the given source code. + # + # @return [Source] a new instance of Source + # + # source://prism//lib/prism/parse_result.rb#26 + sig { params(source: String, start_line: Integer, offsets: T::Array[Integer]).void } + def initialize(source, start_line = T.unsafe(nil), offsets = T.unsafe(nil)); end + + # Return the column number in characters for the given byte offset. + # + # source://prism//lib/prism/parse_result.rb#78 + sig { params(byte_offset: Integer).returns(Integer) } + def character_column(byte_offset); end + + # Return the character offset for the given byte offset. + # + # source://prism//lib/prism/parse_result.rb#73 + sig { params(byte_offset: Integer).returns(Integer) } + def character_offset(byte_offset); end + + # Returns the column number in code units for the given encoding for the + # given byte offset. + # + # source://prism//lib/prism/parse_result.rb#95 + 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. + # + # source://prism//lib/prism/parse_result.rb#88 + 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. + # + # source://prism//lib/prism/parse_result.rb#68 + sig { params(byte_offset: Integer).returns(Integer) } + def column(byte_offset); end + + # Returns the encoding of the source code, which is set by parameters to the + # parser or by the encoding magic comment. + # + # source://prism//lib/prism/parse_result.rb#34 + sig { returns(Encoding) } + def encoding; end + + # Binary search through the offsets to find the line number for the given + # byte offset. + # + # source://prism//lib/prism/parse_result.rb#51 + 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. + # + # source://prism//lib/prism/parse_result.rb#63 + def line_end(byte_offset); end + + # Return the byte offset of the start of the line corresponding to the given + # byte offset. + # + # source://prism//lib/prism/parse_result.rb#57 + 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. + # + # source://prism//lib/prism/parse_result.rb#39 + sig { returns(T::Array[String]) } + def lines; end + + # The list of newline byte offsets in the source code. + # + # source://prism//lib/prism/parse_result.rb#23 + sig { returns(T::Array[Integer]) } + def offsets; end + + # Perform a byteslice on the source code using the given byte offset and + # byte length. + # + # source://prism//lib/prism/parse_result.rb#45 + sig { params(byte_offset: Integer, length: Integer).returns(String) } + def slice(byte_offset, length); end + + # The source code that this source object represents. + # + # source://prism//lib/prism/parse_result.rb#17 + sig { returns(String) } + def source; end + + # The line number where this source starts. + # + # source://prism//lib/prism/parse_result.rb#20 + sig { returns(Integer) } + def start_line; end + + private + + # Binary search through the offsets to find the line number for the given + # byte offset. + # + # source://prism//lib/prism/parse_result.rb#103 + 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. + # + # source://prism//lib/prism/parse_result.rb#12 + def for(source, start_line = T.unsafe(nil), offsets = T.unsafe(nil)); end + end +end + +# Represents the use of the `__ENCODING__` keyword. +# +# __ENCODING__ +# ^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#17061 +class Prism::SourceEncodingNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [SourceEncodingNode] a new instance of SourceEncodingNode + # + # source://prism//lib/prism/node.rb#17063 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#17136 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#17069 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17074 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#17084 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#17079 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?location: Location) -> SourceEncodingNode + # + # source://prism//lib/prism/node.rb#17089 + sig { params(location: Prism::Location).returns(Prism::SourceEncodingNode) } + def copy(location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17074 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#17097 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#17102 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17120 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17130 + def type; end + end +end + +# Represents the use of the `__FILE__` keyword. +# +# __FILE__ +# ^^^^^^^^ +# +# source://prism//lib/prism/node.rb#17145 +class Prism::SourceFileNode < ::Prism::Node + # def initialize: (Integer flags, String filepath, Location location) -> void + # + # @return [SourceFileNode] a new instance of SourceFileNode + # + # source://prism//lib/prism/node.rb#17147 + sig { params(source: Prism::Source, flags: Integer, filepath: String, location: Prism::Location).void } + def initialize(source, flags, filepath, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#17249 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#17155 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17160 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#17170 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#17165 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?filepath: String, ?location: Location) -> SourceFileNode + # + # source://prism//lib/prism/node.rb#17175 + sig { params(flags: Integer, filepath: String, location: Prism::Location).returns(Prism::SourceFileNode) } + def copy(flags: T.unsafe(nil), filepath: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17160 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, filepath: String, location: Location } + # + # source://prism//lib/prism/node.rb#17183 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); 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. + # + # source://prism//lib/prism/node.rb#17192 + sig { returns(String) } + def filepath; end + + # def forced_binary_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#17200 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#17195 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def frozen?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#17205 + sig { returns(T::Boolean) } + def frozen?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#17215 + sig { override.returns(String) } + def inspect; end + + # def mutable?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#17210 + sig { returns(T::Boolean) } + def mutable?; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17233 + sig { override.returns(Symbol) } + def type; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#17188 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17243 + def type; end + end +end + +# Represents the use of the `__LINE__` keyword. +# +# __LINE__ +# ^^^^^^^^ +# +# source://prism//lib/prism/node.rb#17260 +class Prism::SourceLineNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [SourceLineNode] a new instance of SourceLineNode + # + # source://prism//lib/prism/node.rb#17262 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#17335 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#17268 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17273 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#17283 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#17278 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?location: Location) -> SourceLineNode + # + # source://prism//lib/prism/node.rb#17288 + sig { params(location: Prism::Location).returns(Prism::SourceLineNode) } + def copy(location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17273 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#17296 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#17301 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17319 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17329 + def type; end + end +end + +# Represents the use of the splat operator. +# +# [*a] +# ^^ +# +# source://prism//lib/prism/node.rb#17344 +class Prism::SplatNode < ::Prism::Node + # def initialize: (Location operator_loc, Prism::node? expression, Location location) -> void + # + # @return [SplatNode] a new instance of SplatNode + # + # source://prism//lib/prism/node.rb#17346 + sig do + params( + source: Prism::Source, + operator_loc: Prism::Location, + expression: T.nilable(Prism::Node), + location: Prism::Location + ).void + end + def initialize(source, operator_loc, expression, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#17438 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#17354 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17359 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#17371 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#17364 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?operator_loc: Location, ?expression: Prism::node?, ?location: Location) -> SplatNode + # + # source://prism//lib/prism/node.rb#17376 + sig do + params( + operator_loc: Prism::Location, + expression: T.nilable(Prism::Node), + location: Prism::Location + ).returns(Prism::SplatNode) + end + def copy(operator_loc: T.unsafe(nil), expression: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17359 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, expression: Prism::node?, location: Location } + # + # source://prism//lib/prism/node.rb#17384 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # attr_reader expression: Prism::node? + # + # source://prism//lib/prism/node.rb#17396 + sig { returns(T.nilable(Prism::Node)) } + def expression; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#17404 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#17399 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#17389 + sig { returns(Prism::Location) } + def operator_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17422 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17432 + def type; end + end +end + +# Represents a set of statements contained within some scope. +# +# foo; bar; baz +# ^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#17449 +class Prism::StatementsNode < ::Prism::Node + # def initialize: (Array[Prism::node] body, Location location) -> void + # + # @return [StatementsNode] a new instance of StatementsNode + # + # source://prism//lib/prism/node.rb#17451 + sig { params(source: Prism::Source, body: T::Array[Prism::Node], location: Prism::Location).void } + def initialize(source, body, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#17528 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#17458 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader body: Array[Prism::node] + # + # source://prism//lib/prism/node.rb#17491 + sig { returns(T::Array[Prism::Node]) } + def body; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17463 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#17473 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#17468 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?body: Array[Prism::node], ?location: Location) -> StatementsNode + # + # source://prism//lib/prism/node.rb#17478 + sig { params(body: T::Array[Prism::Node], location: Prism::Location).returns(Prism::StatementsNode) } + def copy(body: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17463 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { body: Array[Prism::node], location: Location } + # + # source://prism//lib/prism/node.rb#17486 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#17494 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17512 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17522 + def type; end + end +end + +# Flags for string nodes. +# +# source://prism//lib/prism/node.rb#19268 +module Prism::StringFlags; end + +# internal bytes forced the encoding to binary +# +# source://prism//lib/prism/node.rb#19273 +Prism::StringFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to UTF-8 +# +# source://prism//lib/prism/node.rb#19270 +Prism::StringFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) + +# source://prism//lib/prism/node.rb#19276 +Prism::StringFlags::FROZEN = T.let(T.unsafe(nil), Integer) + +# source://prism//lib/prism/node.rb#19279 +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" +# ^^^^ ^^^^ +# +# source://prism//lib/prism/node.rb#17545 +class Prism::StringNode < ::Prism::Node + include ::Prism::HeredocQuery + + # def initialize: (Integer flags, Location? opening_loc, Location content_loc, Location? closing_loc, String unescaped, Location location) -> void + # + # @return [StringNode] a new instance of StringNode + # + # source://prism//lib/prism/node.rb#17547 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + content_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + unescaped: String, + location: Prism::Location + ).void + end + def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#17700 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#17558 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17563 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # source://prism//lib/prism/node.rb#17661 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism//lib/prism/node.rb#17615 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#17573 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#17568 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def content: () -> String + # + # source://prism//lib/prism/node.rb#17656 + sig { returns(String) } + def content; end + + # attr_reader content_loc: Location + # + # source://prism//lib/prism/node.rb#17608 + sig { returns(Prism::Location) } + def content_loc; end + + # def copy: (?flags: Integer, ?opening_loc: Location?, ?content_loc: Location, ?closing_loc: Location?, ?unescaped: String, ?location: Location) -> StringNode + # + # source://prism//lib/prism/node.rb#17578 + sig do + params( + flags: Integer, + opening_loc: T.nilable(Prism::Location), + content_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + unescaped: String, + location: Prism::Location + ).returns(Prism::StringNode) + end + def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17563 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location?, content_loc: Location, closing_loc: Location?, unescaped: String, location: Location } + # + # source://prism//lib/prism/node.rb#17586 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def forced_binary_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#17636 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#17631 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def frozen?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#17641 + sig { returns(T::Boolean) } + def frozen?; end + + sig { returns(T::Boolean) } + def heredoc?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#17666 + sig { override.returns(String) } + def inspect; end + + # def mutable?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#17646 + sig { returns(T::Boolean) } + def mutable?; end + + # def opening: () -> String? + # + # source://prism//lib/prism/node.rb#17651 + sig { returns(T.nilable(String)) } + def opening; end + + # attr_reader opening_loc: Location? + # + # source://prism//lib/prism/node.rb#17595 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; 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. + # + # source://prism//lib/prism/node_ext.rb#69 + sig { returns(Prism::InterpolatedStringNode) } + def to_interpolated; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17684 + sig { override.returns(Symbol) } + def type; end + + # attr_reader unescaped: String + # + # source://prism//lib/prism/node.rb#17628 + sig { returns(String) } + def unescaped; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#17591 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17694 + def type; end + end +end + +# Represents the use of the `super` keyword with parentheses or arguments. +# +# super() +# ^^^^^^^ +# +# super foo, bar +# ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#17717 +class Prism::SuperNode < ::Prism::Node + # def initialize: (Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc, Prism::node? block, Location location) -> void + # + # @return [SuperNode] a new instance of SuperNode + # + # source://prism//lib/prism/node.rb#17719 + sig do + params( + source: Prism::Source, + keyword_loc: Prism::Location, + lparen_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + rparen_loc: T.nilable(Prism::Location), + block: T.nilable(Prism::Node), + location: Prism::Location + ).void + end + def initialize(source, keyword_loc, lparen_loc, arguments, rparen_loc, block, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#17854 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#17730 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # source://prism//lib/prism/node.rb#17786 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # attr_reader block: Prism::node? + # + # source://prism//lib/prism/node.rb#17802 + sig { returns(T.nilable(Prism::Node)) } + def block; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17735 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#17748 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#17740 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?block: Prism::node?, ?location: Location) -> SuperNode + # + # source://prism//lib/prism/node.rb#17753 + sig do + params( + keyword_loc: Prism::Location, + lparen_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + rparen_loc: T.nilable(Prism::Location), + block: T.nilable(Prism::Node), + location: Prism::Location + ).returns(Prism::SuperNode) + end + def copy(keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil), block: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17735 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, block: Prism::node?, location: Location } + # + # source://prism//lib/prism/node.rb#17761 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#17820 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#17805 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#17766 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def lparen: () -> String? + # + # source://prism//lib/prism/node.rb#17810 + sig { returns(T.nilable(String)) } + def lparen; end + + # attr_reader lparen_loc: Location? + # + # source://prism//lib/prism/node.rb#17773 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end + + # def rparen: () -> String? + # + # source://prism//lib/prism/node.rb#17815 + sig { returns(T.nilable(String)) } + def rparen; end + + # attr_reader rparen_loc: Location? + # + # source://prism//lib/prism/node.rb#17789 + sig { returns(T.nilable(Prism::Location)) } + def rparen_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17838 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17848 + def type; end + end +end + +# Flags for symbol nodes. +# +# source://prism//lib/prism/node.rb#19283 +module Prism::SymbolFlags; end + +# internal bytes forced the encoding to binary +# +# source://prism//lib/prism/node.rb#19288 +Prism::SymbolFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to US-ASCII +# +# source://prism//lib/prism/node.rb#19291 +Prism::SymbolFlags::FORCED_US_ASCII_ENCODING = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to UTF-8 +# +# source://prism//lib/prism/node.rb#19285 +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] +# ^^^ +# +# source://prism//lib/prism/node.rb#17871 +class Prism::SymbolNode < ::Prism::Node + # def initialize: (Integer flags, Location? opening_loc, Location? value_loc, Location? closing_loc, String unescaped, Location location) -> void + # + # @return [SymbolNode] a new instance of SymbolNode + # + # source://prism//lib/prism/node.rb#17873 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + value_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + unescaped: String, + location: Prism::Location + ).void + end + def initialize(source, flags, opening_loc, value_loc, closing_loc, unescaped, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#18027 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#17884 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17889 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # source://prism//lib/prism/node.rb#17988 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism//lib/prism/node.rb#17947 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#17899 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#17894 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?opening_loc: Location?, ?value_loc: Location?, ?closing_loc: Location?, ?unescaped: String, ?location: Location) -> SymbolNode + # + # source://prism//lib/prism/node.rb#17904 + sig do + params( + flags: Integer, + opening_loc: T.nilable(Prism::Location), + value_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + unescaped: String, + location: Prism::Location + ).returns(Prism::SymbolNode) + end + def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), value_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17889 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location?, value_loc: Location?, closing_loc: Location?, unescaped: String, location: Location } + # + # source://prism//lib/prism/node.rb#17912 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def forced_binary_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#17968 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_us_ascii_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#17973 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#17963 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#17993 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String? + # + # source://prism//lib/prism/node.rb#17978 + sig { returns(T.nilable(String)) } + def opening; end + + # attr_reader opening_loc: Location? + # + # source://prism//lib/prism/node.rb#17921 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18011 + sig { override.returns(Symbol) } + def type; end + + # attr_reader unescaped: String + # + # source://prism//lib/prism/node.rb#17960 + sig { returns(String) } + def unescaped; end + + # def value: () -> String? + # + # source://prism//lib/prism/node.rb#17983 + sig { returns(T.nilable(String)) } + def value; end + + # attr_reader value_loc: Location? + # + # source://prism//lib/prism/node.rb#17934 + sig { returns(T.nilable(Prism::Location)) } + def value_loc; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#17917 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18021 + def type; end + end +end + +# This represents a token from the Ruby source. +# +# source://prism//lib/prism/parse_result.rb#645 +class Prism::Token + # Create a new token object with the given type, value, and location. + # + # @return [Token] a new instance of Token + # + # source://prism//lib/prism/parse_result.rb#657 + 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. + # + # source://prism//lib/prism/parse_result.rb#692 + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other); end + + # Implement the hash pattern matching interface for Token. + # + # source://prism//lib/prism/parse_result.rb#665 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # A Location object representing the location of this token in the source. + # + # source://prism//lib/prism/parse_result.rb#670 + sig { returns(Prism::Location) } + def location; end + + # Implement the pretty print interface for Token. + # + # source://prism//lib/prism/parse_result.rb#677 + sig { params(q: T.untyped).void } + def pretty_print(q); end + + # The type of token that this token is. + # + # source://prism//lib/prism/parse_result.rb#651 + sig { returns(Symbol) } + def type; end + + # A byteslice of the source that this token represents. + # + # source://prism//lib/prism/parse_result.rb#654 + sig { returns(String) } + def value; end + + private + + # The Source object that represents the source this token came from. + # + # source://prism//lib/prism/parse_result.rb#647 + sig { returns(Prism::Source) } + def source; end +end + +# This module is responsible for converting the prism syntax tree into other +# syntax trees. +# +# source://prism//lib/prism/translation.rb#6 +module Prism::Translation; end + +class Prism::Translation::Parser < Parser::Base + sig { overridable.returns(Integer) } + def version; end +end + +class Prism::Translation::Parser33 < Prism::Translation::Parser + sig { override.returns(Integer) } + def version; end +end + +class Prism::Translation::Parser34 < Prism::Translation::Parser + sig { override.returns(Integer) } + def version; end +end + +# 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 +# +# source://prism//lib/prism/translation/ripper.rb#43 +class Prism::Translation::Ripper < ::Prism::Compiler + # Create a new Translation::Ripper object with the given source. + # + # @return [Ripper] a new instance of Ripper + # + # source://prism//lib/prism/translation/ripper.rb#444 + def initialize(source, filename = T.unsafe(nil), lineno = T.unsafe(nil)); end + + # The current column number of the parser. + # + # source://prism//lib/prism/translation/ripper.rb#441 + def column; end + + # True if the parser encountered an error during parsing. + # + # @return [Boolean] + # + # source://prism//lib/prism/translation/ripper.rb#457 + sig { returns(T::Boolean) } + def error?; end + + # The filename of the source being parsed. + # + # source://prism//lib/prism/translation/ripper.rb#435 + def filename; end + + # The current line number of the parser. + # + # source://prism//lib/prism/translation/ripper.rb#438 + def lineno; end + + # Parse the source and return the result. + # + # source://prism//lib/prism/translation/ripper.rb#462 + sig { returns(T.untyped) } + def parse; end + + # The source that is being parsed. + # + # source://prism//lib/prism/translation/ripper.rb#432 + def source; end + + # alias $foo $bar + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#561 + def visit_alias_global_variable_node(node); end + + # alias foo bar + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#551 + def visit_alias_method_node(node); end + + # foo => bar | baz + # ^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#585 + def visit_alternation_pattern_node(node); end + + # a and b + # ^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#605 + def visit_and_node(node); end + + # foo(bar) + # ^^^ + # + # source://prism//lib/prism/translation/ripper.rb#796 + def visit_arguments_node(node); end + + # [] + # ^^ + # + # source://prism//lib/prism/translation/ripper.rb#615 + def visit_array_node(node); end + + # foo => [bar] + # ^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#775 + def visit_array_pattern_node(node); end + + # { a: 1 } + # ^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#803 + def visit_assoc_node(node); end + + # def foo(**); bar(**); end + # ^^ + # + # { **foo } + # ^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#816 + def visit_assoc_splat_node(node); end + + # $+ + # ^^ + # + # source://prism//lib/prism/translation/ripper.rb#825 + def visit_back_reference_read_node(node); end + + # begin end + # ^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#832 + def visit_begin_node(node); end + + # foo(&bar) + # ^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#896 + def visit_block_argument_node(node); end + + # foo { |; bar| } + # ^^^ + # + # source://prism//lib/prism/translation/ripper.rb#902 + def visit_block_local_variable_node(node); end + + # Visit a BlockNode. + # + # source://prism//lib/prism/translation/ripper.rb#908 + def visit_block_node(node); end + + # def foo(&bar); end + # ^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#944 + def visit_block_parameter_node(node); end + + # A block's parameters. + # + # source://prism//lib/prism/translation/ripper.rb#958 + def visit_block_parameters_node(node); end + + # break + # ^^^^^ + # + # break foo + # ^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#982 + def visit_break_node(node); end + + # foo.bar &&= baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1194 + def visit_call_and_write_node(node); end + + # foo + # ^^^ + # + # foo.bar + # ^^^^^^^ + # + # foo.bar() {} + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1002 + def visit_call_node(node); end + + # foo.bar += baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1172 + def visit_call_operator_write_node(node); end + + # foo.bar ||= baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1216 + def visit_call_or_write_node(node); end + + # foo.bar, = 1 + # ^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1238 + def visit_call_target_node(node); end + + # foo => bar => baz + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1263 + def visit_capture_pattern_node(node); end + + # case foo; in bar; end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1286 + def visit_case_match_node(node); end + + # case foo; when bar; end + # ^^^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1273 + def visit_case_node(node); end + + # class Foo; end + # ^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1299 + def visit_class_node(node); end + + # @@foo &&= bar + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1352 + def visit_class_variable_and_write_node(node); end + + # @@foo += bar + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1338 + def visit_class_variable_operator_write_node(node); end + + # @@foo ||= bar + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1366 + def visit_class_variable_or_write_node(node); end + + # @@foo + # ^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1317 + def visit_class_variable_read_node(node); end + + # @@foo, = bar + # ^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1380 + def visit_class_variable_target_node(node); end + + # @@foo = 1 + # ^^^^^^^^^ + # + # @@foo, @@bar = 1 + # ^^^^^ ^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1327 + def visit_class_variable_write_node(node); end + + # Foo &&= bar + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1422 + def visit_constant_and_write_node(node); end + + # Foo += bar + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1408 + def visit_constant_operator_write_node(node); end + + # Foo ||= bar + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1436 + def visit_constant_or_write_node(node); end + + # Foo::Bar &&= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1523 + def visit_constant_path_and_write_node(node); end + + # Foo::Bar + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1457 + def visit_constant_path_node(node); end + + # Foo::Bar += baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1509 + def visit_constant_path_operator_write_node(node); end + + # Foo::Bar ||= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1537 + def visit_constant_path_or_write_node(node); end + + # Foo::Bar, = baz + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1551 + def visit_constant_path_target_node(node); end + + # Foo::Bar = 1 + # ^^^^^^^^^^^^ + # + # Foo::Foo, Bar::Bar = 1 + # ^^^^^^^^ ^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1480 + def visit_constant_path_write_node(node); end + + # Foo + # ^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1387 + def visit_constant_read_node(node); end + + # Foo, = bar + # ^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1450 + def visit_constant_target_node(node); end + + # Foo = 1 + # ^^^^^^^ + # + # Foo, Bar = 1 + # ^^^ ^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1397 + def visit_constant_write_node(node); end + + # def foo; end + # ^^^^^^^^^^^^ + # + # def self.foo; end + # ^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1560 + def visit_def_node(node); end + + # defined? a + # ^^^^^^^^^^ + # + # defined?(a) + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1607 + def visit_defined_node(node); end + + # if foo then bar else baz end + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1614 + def visit_else_node(node); end + + # "foo #{bar}" + # ^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1630 + def visit_embedded_statements_node(node); end + + # "foo #@bar" + # ^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1651 + def visit_embedded_variable_node(node); end + + # Visit an EnsureNode node. + # + # source://prism//lib/prism/translation/ripper.rb#1662 + def visit_ensure_node(node); end + + # false + # ^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1680 + def visit_false_node(node); end + + # foo => [*, bar, *] + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1687 + def visit_find_pattern_node(node); end + + # if foo .. bar; end + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1712 + def visit_flip_flop_node(node); end + + # 1.0 + # ^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1726 + def visit_float_node(node); end + + # for foo in bar do end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1732 + def visit_for_node(node); end + + # def foo(...); bar(...); end + # ^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1749 + def visit_forwarding_arguments_node(node); end + + # def foo(...); end + # ^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1756 + def visit_forwarding_parameter_node(node); end + + # super + # ^^^^^ + # + # super {} + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1766 + def visit_forwarding_super_node(node); end + + # $foo &&= bar + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1815 + def visit_global_variable_and_write_node(node); end + + # $foo += bar + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1801 + def visit_global_variable_operator_write_node(node); end + + # $foo ||= bar + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1829 + def visit_global_variable_or_write_node(node); end + + # $foo + # ^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1780 + def visit_global_variable_read_node(node); end + + # $foo, = bar + # ^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1843 + def visit_global_variable_target_node(node); end + + # $foo = 1 + # ^^^^^^^^ + # + # $foo, $bar = 1 + # ^^^^ ^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1790 + def visit_global_variable_write_node(node); end + + # {} + # ^^ + # + # source://prism//lib/prism/translation/ripper.rb#1850 + def visit_hash_node(node); end + + # foo => {} + # ^^ + # + # source://prism//lib/prism/translation/ripper.rb#1865 + def visit_hash_pattern_node(node); end + + # if foo then bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar if foo + # ^^^^^^^^^^ + # + # foo ? bar : baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1907 + def visit_if_node(node); end + + # 1i + # ^^ + # + # source://prism//lib/prism/translation/ripper.rb#1943 + def visit_imaginary_node(node); end + + # { foo: } + # ^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1949 + def visit_implicit_node(node); end + + # foo { |bar,| } + # ^ + # + # source://prism//lib/prism/translation/ripper.rb#1954 + def visit_implicit_rest_node(node); end + + # case foo; in bar; end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1961 + def visit_in_node(node); end + + # foo[bar] &&= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1996 + def visit_index_and_write_node(node); end + + # foo[bar] += baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#1979 + def visit_index_operator_write_node(node); end + + # foo[bar] ||= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2013 + def visit_index_or_write_node(node); end + + # foo[bar], = 1 + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2030 + def visit_index_target_node(node); end + + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2072 + def visit_instance_variable_and_write_node(node); end + + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2058 + def visit_instance_variable_operator_write_node(node); end + + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2086 + def visit_instance_variable_or_write_node(node); end + + # ^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2040 + def visit_instance_variable_read_node(node); end + + # @foo, = bar + # ^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2100 + def visit_instance_variable_target_node(node); end + + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2047 + def visit_instance_variable_write_node(node); end + + # 1 + # ^ + # + # source://prism//lib/prism/translation/ripper.rb#2107 + def visit_integer_node(node); end + + # if /foo #{bar}/ then end + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2113 + def visit_interpolated_match_last_line_node(node); end + + # /foo #{bar}/ + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2132 + def visit_interpolated_regular_expression_node(node); end + + # "foo #{bar}" + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2151 + def visit_interpolated_string_node(node); end + + # :"foo #{bar}" + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2179 + def visit_interpolated_symbol_node(node); end + + # `foo #{bar}` + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2192 + def visit_interpolated_x_string_node(node); end + + # -> { it } + # ^^ + # + # source://prism//lib/prism/translation/ripper.rb#2222 + def visit_it_local_variable_read_node(node); end + + # -> { it } + # ^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2229 + def visit_it_parameters_node(node); end + + # foo(bar: baz) + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2234 + def visit_keyword_hash_node(node); end + + # def foo(**bar); end + # ^^^^^ + # + # def foo(**); end + # ^^ + # + # source://prism//lib/prism/translation/ripper.rb#2246 + def visit_keyword_rest_parameter_node(node); end + + # -> {} + # + # source://prism//lib/prism/translation/ripper.rb#2260 + def visit_lambda_node(node); end + + # foo &&= bar + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2352 + def visit_local_variable_and_write_node(node); end + + # foo += bar + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2338 + def visit_local_variable_operator_write_node(node); end + + # foo ||= bar + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2366 + def visit_local_variable_or_write_node(node); end + + # foo + # ^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2320 + def visit_local_variable_read_node(node); end + + # foo, = bar + # ^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2380 + def visit_local_variable_target_node(node); end + + # foo = 1 + # ^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2327 + def visit_local_variable_write_node(node); end + + # if /foo/ then end + # ^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2387 + def visit_match_last_line_node(node); end + + # foo in bar + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2402 + def visit_match_predicate_node(node); end + + # foo => bar + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2411 + def visit_match_required_node(node); end + + # /(?foo)/ =~ bar + # ^^^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2420 + 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. + # + # source://prism//lib/prism/translation/ripper.rb#2426 + def visit_missing_node(node); end + + # module Foo; end + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2432 + def visit_module_node(node); end + + # (foo, bar), bar = qux + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2449 + def visit_multi_target_node(node); end + + # foo, bar = baz + # ^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2503 + def visit_multi_write_node(node); end + + # next + # ^^^^ + # + # next foo + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2523 + def visit_next_node(node); end + + # nil + # ^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2537 + def visit_nil_node(node); end + + # def foo(**nil); end + # ^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2544 + def visit_no_keywords_parameter_node(node); end + + # -> { _1 + _2 } + # ^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2553 + def visit_numbered_parameters_node(node); end + + # $1 + # ^^ + # + # source://prism//lib/prism/translation/ripper.rb#2558 + def visit_numbered_reference_read_node(node); end + + # def foo(bar: baz); end + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2565 + def visit_optional_keyword_parameter_node(node); end + + # def foo(bar = 1); end + # ^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2575 + def visit_optional_parameter_node(node); end + + # a or b + # ^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2585 + def visit_or_node(node); end + + # def foo(bar, *baz); end + # ^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2595 + def visit_parameters_node(node); end + + # () + # ^^ + # + # (1) + # ^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2622 + def visit_parentheses_node(node); end + + # foo => ^(bar) + # ^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2636 + def visit_pinned_expression_node(node); end + + # foo = 1 and bar => ^foo + # ^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2645 + def visit_pinned_variable_node(node); end + + # END {} + # ^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2651 + def visit_post_execution_node(node); end + + # BEGIN {} + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2666 + def visit_pre_execution_node(node); end + + # The top-level program node. + # + # source://prism//lib/prism/translation/ripper.rb#2680 + def visit_program_node(node); end + + # 0..5 + # ^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2691 + def visit_range_node(node); end + + # 1r + # ^^ + # + # source://prism//lib/prism/translation/ripper.rb#2705 + def visit_rational_node(node); end + + # redo + # ^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2711 + def visit_redo_node(node); end + + # /foo/ + # ^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2718 + def visit_regular_expression_node(node); end + + # def foo(bar:); end + # ^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2740 + def visit_required_keyword_parameter_node(node); end + + # def foo(bar); end + # ^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2747 + def visit_required_parameter_node(node); end + + # foo rescue bar + # ^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2754 + def visit_rescue_modifier_node(node); end + + # begin; rescue; end + # ^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2764 + def visit_rescue_node(node); end + + # def foo(*bar); end + # ^^^^ + # + # def foo(*); end + # ^ + # + # source://prism//lib/prism/translation/ripper.rb#2822 + def visit_rest_parameter_node(node); end + + # retry + # ^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2834 + def visit_retry_node(node); end + + # return + # ^^^^^^ + # + # return 1 + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2844 + def visit_return_node(node); end + + # self + # ^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2858 + def visit_self_node(node); end + + # A shareable constant. + # + # source://prism//lib/prism/translation/ripper.rb#2864 + def visit_shareable_constant_node(node); end + + # class << self; end + # ^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2870 + def visit_singleton_class_node(node); end + + # __ENCODING__ + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2880 + def visit_source_encoding_node(node); end + + # __FILE__ + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2887 + def visit_source_file_node(node); end + + # __LINE__ + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2894 + def visit_source_line_node(node); end + + # foo(*bar) + # ^^^^ + # + # def foo((bar, *baz)); end + # ^^^^ + # + # def foo(*); bar(*); end + # ^ + # + # source://prism//lib/prism/translation/ripper.rb#2907 + def visit_splat_node(node); end + + # A list of statements. + # + # source://prism//lib/prism/translation/ripper.rb#2912 + def visit_statements_node(node); end + + # "foo" + # ^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#2929 + def visit_string_node(node); end + + # super(foo) + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#3061 + def visit_super_node(node); end + + # :foo + # ^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#3082 + def visit_symbol_node(node); end + + # true + # ^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#3106 + def visit_true_node(node); end + + # undef foo + # ^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#3113 + def visit_undef_node(node); end + + # unless foo; bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar unless foo + # ^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#3125 + def visit_unless_node(node); end + + # until foo; bar end + # ^^^^^^^^^^^^^^^^^ + # + # bar until foo + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#3153 + def visit_until_node(node); end + + # case foo; when bar; end + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#3177 + def visit_when_node(node); end + + # while foo; bar end + # ^^^^^^^^^^^^^^^^^^ + # + # bar while foo + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#3198 + def visit_while_node(node); end + + # `foo` + # ^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#3222 + def visit_x_string_node(node); end + + # yield + # ^^^^^ + # + # yield 1 + # ^^^^^^^ + # + # source://prism//lib/prism/translation/ripper.rb#3245 + def visit_yield_node(node); end + + private + + # :stopdoc: + # + # source://prism//lib/prism/translation/ripper.rb#3389 + def _dispatch_0; end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def _dispatch_1(_); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def _dispatch_2(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3392 + def _dispatch_3(_, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3393 + def _dispatch_4(_, _, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3394 + def _dispatch_5(_, _, _, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3395 + def _dispatch_7(_, _, _, _, _, _, _); 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. + # + # source://prism//lib/prism/translation/ripper.rb#3379 + def bounds(location); end + + # Returns true if the given node is a command node. + # + # @return [Boolean] + # + # source://prism//lib/prism/translation/ripper.rb#1163 + def command?(node); end + + # This method is called when the parser found syntax error. + # + # source://prism//lib/prism/translation/ripper.rb#3417 + 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. + # + # source://prism//lib/prism/translation/ripper.rb#3432 + def dedent_string(string, width); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_BEGIN(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_CHAR(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_END(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on___end__(_); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_alias(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_alias_error(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_aref(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_aref_field(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_arg_ambiguous(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_arg_paren(_); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_args_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_args_add_block(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_args_add_star(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_args_forward; end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_args_new; end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_array(_); end + + # source://prism//lib/prism/translation/ripper.rb#3393 + def on_aryptn(_, _, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_assign(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_assign_error(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_assoc_new(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_assoc_splat(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_assoclist_from_args(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_backref(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_backtick(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_bare_assoc_hash(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_begin(_); end + + # source://prism//lib/prism/translation/ripper.rb#3392 + def on_binary(_, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_block_var(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_blockarg(_); end + + # source://prism//lib/prism/translation/ripper.rb#3393 + def on_bodystmt(_, _, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_brace_block(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_break(_); end + + # source://prism//lib/prism/translation/ripper.rb#3392 + def on_call(_, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_case(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3392 + def on_class(_, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_class_name_error(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_comma(_); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_command(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3393 + def on_command_call(_, _, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_comment(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_const(_); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_const_path_field(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_const_path_ref(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_const_ref(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_cvar(_); end + + # source://prism//lib/prism/translation/ripper.rb#3392 + def on_def(_, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_defined(_); end + + # source://prism//lib/prism/translation/ripper.rb#3394 + def on_defs(_, _, _, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_do_block(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_dot2(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_dot3(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_dyna_symbol(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_else(_); end + + # source://prism//lib/prism/translation/ripper.rb#3392 + def on_elsif(_, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_embdoc(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_embdoc_beg(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_embdoc_end(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_embexpr_beg(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_embexpr_end(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_embvar(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_ensure(_); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_excessed_comma; end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_fcall(_); end + + # source://prism//lib/prism/translation/ripper.rb#3392 + def on_field(_, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_float(_); end + + # source://prism//lib/prism/translation/ripper.rb#3393 + def on_fndptn(_, _, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3392 + def on_for(_, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_gvar(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_hash(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_heredoc_beg(_); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_heredoc_dedent(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_heredoc_end(_); end + + # source://prism//lib/prism/translation/ripper.rb#3392 + def on_hshptn(_, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_ident(_); end + + # source://prism//lib/prism/translation/ripper.rb#3392 + def on_if(_, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_if_mod(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3392 + def on_ifop(_, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_ignored_nl(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_ignored_sp(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_imaginary(_); end + + # source://prism//lib/prism/translation/ripper.rb#3392 + def on_in(_, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_int(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_ivar(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_kw(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_kwrest_param(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_label(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_label_end(_); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_lambda(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_lbrace(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_lbracket(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_lparen(_); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_magic_comment(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_massign(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_method_add_arg(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_method_add_block(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_mlhs_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_mlhs_add_post(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_mlhs_add_star(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_mlhs_new; end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_mlhs_paren(_); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_module(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_mrhs_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_mrhs_add_star(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_mrhs_new; end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_mrhs_new_from_args(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_next(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_nl(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_nokw_param(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_op(_); end + + # source://prism//lib/prism/translation/ripper.rb#3392 + def on_opassign(_, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_operator_ambiguous(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_param_error(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3395 + def on_params(_, _, _, _, _, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_paren(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_parse_error(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_period(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_program(_); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_qsymbols_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_qsymbols_beg(_); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_qsymbols_new; end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_qwords_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_qwords_beg(_); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_qwords_new; end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_rational(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_rbrace(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_rbracket(_); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_redo; end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_regexp_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_regexp_beg(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_regexp_end(_); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_regexp_literal(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_regexp_new; end + + # source://prism//lib/prism/translation/ripper.rb#3393 + def on_rescue(_, _, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_rescue_mod(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_rest_param(_); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_retry; end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_return(_); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_return0; end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_rparen(_); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_sclass(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_semicolon(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_sp(_); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_stmts_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_stmts_new; end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_string_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_string_concat(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_string_content; end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_string_dvar(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_string_embexpr(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_string_literal(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_super(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_symbeg(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_symbol(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_symbol_literal(_); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_symbols_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_symbols_beg(_); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_symbols_new; end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_tlambda(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_tlambeg(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_top_const_field(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_top_const_ref(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_tstring_beg(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_tstring_content(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_tstring_end(_); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_unary(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_undef(_); end + + # source://prism//lib/prism/translation/ripper.rb#3392 + def on_unless(_, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_unless_mod(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_until(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_until_mod(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_var_alias(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_var_field(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_var_ref(_); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_vcall(_); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_void_stmt; end + + # source://prism//lib/prism/translation/ripper.rb#3392 + def on_when(_, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_while(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_while_mod(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_word_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_word_new; end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_words_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_words_beg(_); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_words_new; end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_words_sep(_); end + + # source://prism//lib/prism/translation/ripper.rb#3391 + def on_xstring_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_xstring_literal(_); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_xstring_new; end + + # source://prism//lib/prism/translation/ripper.rb#3390 + def on_yield(_); end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_yield0; end + + # source://prism//lib/prism/translation/ripper.rb#3389 + def on_zsuper; end + + # Lazily initialize the parse result. + # + # source://prism//lib/prism/translation/ripper.rb#3271 + def result; end + + # Returns true if there is a comma between the two locations. + # + # @return [Boolean] + # + # source://prism//lib/prism/translation/ripper.rb#3284 + def trailing_comma?(left, right); end + + # Visit one side of an alias global variable node. + # + # source://prism//lib/prism/translation/ripper.rb#570 + def visit_alias_global_variable_node_value(node); end + + # Visit a list of elements, like the elements of an array or arguments. + # + # source://prism//lib/prism/translation/ripper.rb#756 + def visit_arguments(elements); end + + # Visit the clauses of a begin node to form an on_bodystmt call. + # + # source://prism//lib/prism/translation/ripper.rb#840 + 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. + # + # source://prism//lib/prism/translation/ripper.rb#875 + 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. + # + # source://prism//lib/prism/translation/ripper.rb#1136 + def visit_call_node_arguments(arguments_node, block_node, trailing_comma); end + + # Visit a constant path that is part of a write node. + # + # source://prism//lib/prism/translation/ripper.rb#1489 + def visit_constant_path_write_node_target(node); end + + # Visit a destructured positional parameter node. + # + # source://prism//lib/prism/translation/ripper.rb#2609 + def visit_destructured_parameter_node(node); end + + # Visit a string that is expressed using a <<~ heredoc. + # + # source://prism//lib/prism/translation/ripper.rb#2980 + 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. + # + # source://prism//lib/prism/translation/ripper.rb#2955 + def visit_heredoc_node_whitespace(parts); end + + # Visit a heredoc node that is representing a string. + # + # source://prism//lib/prism/translation/ripper.rb#3026 + def visit_heredoc_string_node(node); end + + # Visit a heredoc node that is representing an xstring. + # + # source://prism//lib/prism/translation/ripper.rb#3043 + def visit_heredoc_x_string_node(node); end + + # Visit the targets of a multi-target node. + # + # source://prism//lib/prism/translation/ripper.rb#2462 + 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. + # + # source://prism//lib/prism/translation/ripper.rb#3323 + 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. + # + # source://prism//lib/prism/translation/ripper.rb#595 + 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. + # + # source://prism//lib/prism/translation/ripper.rb#2921 + def visit_statements_node_body(body); end + + # Visit an individual part of a string-like node. + # + # source://prism//lib/prism/translation/ripper.rb#2211 + 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. + # + # source://prism//lib/prism/translation/ripper.rb#3296 + 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. + # + # source://prism//lib/prism/translation/ripper.rb#745 + 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. + # + # source://prism//lib/prism/translation/ripper.rb#3341 + def visit_write_value(node); end + + # Returns true if there is a semicolon between the two locations. + # + # @return [Boolean] + # + # source://prism//lib/prism/translation/ripper.rb#3289 + 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. + # + # source://prism//lib/prism/translation/ripper.rb#3408 + def warn(fmt, *args); end + + # This method is called when strong warning is produced by the parser. + # +fmt+ and +args+ is printf style. + # + # source://prism//lib/prism/translation/ripper.rb#3413 + 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 ]] + # + # source://prism//lib/prism/translation/ripper.rb#72 + def lex(src, filename = T.unsafe(nil), lineno = T.unsafe(nil), raise_errors: T.unsafe(nil)); end + + # Parses the given Ruby program read from +src+. + # +src+ must be a String or an IO or a object with a #gets method. + # + # source://prism//lib/prism/translation/ripper.rb#46 + 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]]]] + # + # source://prism//lib/prism/translation/ripper.rb#381 + def sexp(src, filename = T.unsafe(nil), lineno = T.unsafe(nil), raise_errors: T.unsafe(nil)); 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]]]] + # + # source://prism//lib/prism/translation/ripper.rb#416 + def sexp_raw(src, filename = T.unsafe(nil), lineno = T.unsafe(nil), raise_errors: T.unsafe(nil)); end + end +end + +# A list of all of the Ruby binary operators. +# +# source://prism//lib/prism/translation/ripper.rb#337 +Prism::Translation::Ripper::BINARY_OPERATORS = T.let(T.unsafe(nil), Array) + +# This array contains name of all ripper events. +# +# source://prism//lib/prism/translation/ripper.rb#289 +Prism::Translation::Ripper::EVENTS = T.let(T.unsafe(nil), Array) + +# A list of all of the Ruby keywords. +# +# source://prism//lib/prism/translation/ripper.rb#292 +Prism::Translation::Ripper::KEYWORDS = T.let(T.unsafe(nil), Array) + +# This array contains name of parser events. +# +# source://prism//lib/prism/translation/ripper.rb#283 +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. +# +# source://prism//lib/prism/translation/ripper.rb#84 +Prism::Translation::Ripper::PARSER_EVENT_TABLE = T.let(T.unsafe(nil), Hash) + +# This array contains name of scanner events. +# +# source://prism//lib/prism/translation/ripper.rb#286 +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. +# +# source://prism//lib/prism/translation/ripper.rb#227 +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]. +# +# source://prism//lib/prism/translation/ripper/sexp.rb#10 +class Prism::Translation::Ripper::SexpBuilder < ::Prism::Translation::Ripper + # :stopdoc: + # + # source://prism//lib/prism/translation/ripper/sexp.rb#13 + def error; end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_BEGIN(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_CHAR(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_END(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on___end__(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_alias(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_alias_error(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_aref(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_aref_field(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_arg_ambiguous(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_arg_paren(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_args_add(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_args_add_block(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_args_add_star(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_args_forward(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_args_new(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_array(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_aryptn(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_assign(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_assign_error(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_assoc_new(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_assoc_splat(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_assoclist_from_args(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_backref(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_backtick(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_bare_assoc_hash(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_begin(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_binary(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_block_var(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_blockarg(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_bodystmt(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_brace_block(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_break(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_call(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_case(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_class(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_class_name_error(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_comma(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_command(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_command_call(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_comment(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_const(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_const_path_field(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_const_path_ref(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_const_ref(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_cvar(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_def(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_defined(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_defs(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_do_block(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_dot2(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_dot3(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_dyna_symbol(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_else(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_elsif(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_embdoc(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_embdoc_beg(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_embdoc_end(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_embexpr_beg(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_embexpr_end(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_embvar(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_ensure(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_excessed_comma(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_fcall(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_field(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_float(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_fndptn(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_for(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_gvar(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_hash(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_heredoc_beg(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_heredoc_end(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_hshptn(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_ident(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_if(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_if_mod(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_ifop(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_ignored_nl(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_ignored_sp(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_imaginary(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_in(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_int(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_ivar(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_kw(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_kwrest_param(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_label(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_label_end(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_lambda(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_lbrace(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_lbracket(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_lparen(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_magic_comment(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_massign(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_method_add_arg(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_method_add_block(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_mlhs_add(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_mlhs_add_post(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_mlhs_add_star(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_mlhs_new(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_mlhs_paren(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_module(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_mrhs_add(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_mrhs_add_star(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_mrhs_new(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_mrhs_new_from_args(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_next(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_nl(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_nokw_param(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_op(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_opassign(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_operator_ambiguous(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_param_error(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_params(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_paren(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_period(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_program(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_qsymbols_add(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_qsymbols_beg(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_qsymbols_new(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_qwords_add(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_qwords_beg(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_qwords_new(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_rational(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_rbrace(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_rbracket(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_redo(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_regexp_add(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_regexp_beg(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_regexp_end(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_regexp_literal(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_regexp_new(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_rescue(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_rescue_mod(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_rest_param(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_retry(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_return(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_return0(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_rparen(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_sclass(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_semicolon(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_sp(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_stmts_add(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_stmts_new(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_string_add(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_string_concat(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_string_content(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_string_dvar(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_string_embexpr(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_string_literal(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_super(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_symbeg(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_symbol(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_symbol_literal(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_symbols_add(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_symbols_beg(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_symbols_new(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_tlambda(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_tlambeg(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_top_const_field(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_top_const_ref(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_tstring_beg(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_tstring_content(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_tstring_end(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_unary(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_undef(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_unless(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_unless_mod(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_until(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_until_mod(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_var_alias(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_var_field(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_var_ref(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_vcall(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_void_stmt(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_when(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_while(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_while_mod(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_word_add(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_word_new(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_words_add(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_words_beg(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_words_new(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#55 + def on_words_sep(tok); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_xstring_add(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_xstring_literal(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_xstring_new(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_yield(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_yield0(*args); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#47 + def on_zsuper(*args); end + + private + + # source://prism//lib/prism/translation/ripper/sexp.rb#61 + def compile_error(mesg); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#17 + def dedent_element(e, width); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#61 + def on_error(mesg); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#24 + def on_heredoc_dedent(val, width); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#61 + 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. +# +# source://prism//lib/prism/translation/ripper/sexp.rb#74 +class Prism::Translation::Ripper::SexpBuilderPP < ::Prism::Translation::Ripper::SexpBuilder + private + + # source://prism//lib/prism/translation/ripper/sexp.rb#92 + def _dispatch_event_new; end + + # source://prism//lib/prism/translation/ripper/sexp.rb#96 + def _dispatch_event_push(list, item); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#96 + def on_args_add(list, item); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#92 + def on_args_new; end + + # source://prism//lib/prism/translation/ripper/sexp.rb#79 + def on_heredoc_dedent(val, width); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#96 + def on_mlhs_add(list, item); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#109 + def on_mlhs_add_post(list, post); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#105 + def on_mlhs_add_star(list, star); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#92 + def on_mlhs_new; end + + # source://prism//lib/prism/translation/ripper/sexp.rb#101 + def on_mlhs_paren(list); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#96 + def on_mrhs_add(list, item); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#92 + def on_mrhs_new; end + + # source://prism//lib/prism/translation/ripper/sexp.rb#96 + def on_qsymbols_add(list, item); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#92 + def on_qsymbols_new; end + + # source://prism//lib/prism/translation/ripper/sexp.rb#96 + def on_qwords_add(list, item); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#92 + def on_qwords_new; end + + # source://prism//lib/prism/translation/ripper/sexp.rb#96 + def on_regexp_add(list, item); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#92 + def on_regexp_new; end + + # source://prism//lib/prism/translation/ripper/sexp.rb#96 + def on_stmts_add(list, item); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#92 + def on_stmts_new; end + + # source://prism//lib/prism/translation/ripper/sexp.rb#96 + def on_string_add(list, item); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#96 + def on_symbols_add(list, item); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#92 + def on_symbols_new; end + + # source://prism//lib/prism/translation/ripper/sexp.rb#96 + def on_word_add(list, item); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#92 + def on_word_new; end + + # source://prism//lib/prism/translation/ripper/sexp.rb#96 + def on_words_add(list, item); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#92 + def on_words_new; end + + # source://prism//lib/prism/translation/ripper/sexp.rb#96 + def on_xstring_add(list, item); end + + # source://prism//lib/prism/translation/ripper/sexp.rb#92 + 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. +# +# source://prism//lib/prism/translation/ruby_parser.rb#14 +class Prism::Translation::RubyParser + # Parse the given source and translate it into the seattlerb/ruby_parser + # gem's Sexp format. + # + # source://prism//lib/prism/translation/ruby_parser.rb#1556 + def parse(source, filepath = T.unsafe(nil)); end + + # Parse the given file and translate it into the seattlerb/ruby_parser + # gem's Sexp format. + # + # source://prism//lib/prism/translation/ruby_parser.rb#1562 + def parse_file(filepath); end + + private + + # Translate the given parse result and filepath into the + # seattlerb/ruby_parser gem's Sexp format. + # + # source://prism//lib/prism/translation/ruby_parser.rb#1584 + def translate(result, filepath); end + + class << self + # Parse the given source and translate it into the seattlerb/ruby_parser + # gem's Sexp format. + # + # source://prism//lib/prism/translation/ruby_parser.rb#1569 + def parse(source, filepath = T.unsafe(nil)); end + + # Parse the given file and translate it into the seattlerb/ruby_parser + # gem's Sexp format. + # + # source://prism//lib/prism/translation/ruby_parser.rb#1575 + def parse_file(filepath); end + end +end + +# A prism visitor that builds Sexp objects. +# +# source://prism//lib/prism/translation/ruby_parser.rb#16 +class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler + # Initialize a new compiler with the given file name. + # + # @return [Compiler] a new instance of Compiler + # + # source://prism//lib/prism/translation/ruby_parser.rb#31 + 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. + # + # source://prism//lib/prism/translation/ruby_parser.rb#20 + 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. + # + # source://prism//lib/prism/translation/ruby_parser.rb#24 + def in_def; end + + # Some nodes will change their representation if they are inside of a + # pattern, so we need to track that state. + # + # source://prism//lib/prism/translation/ruby_parser.rb#28 + def in_pattern; end + + # alias $foo $bar + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#45 + def visit_alias_global_variable_node(node); end + + # alias foo bar + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#39 + def visit_alias_method_node(node); end + + # foo => bar | baz + # ^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#51 + def visit_alternation_pattern_node(node); end + + # a and b + # ^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#57 + def visit_and_node(node); end + + # foo(bar) + # ^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#96 + def visit_arguments_node(node); end + + # [] + # ^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#63 + def visit_array_node(node); end + + # foo => [bar] + # ^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#73 + def visit_array_pattern_node(node); end + + # { a: 1 } + # ^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#102 + def visit_assoc_node(node); end + + # def foo(**); bar(**); end + # ^^ + # + # { **foo } + # ^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#111 + def visit_assoc_splat_node(node); end + + # $+ + # ^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#121 + def visit_back_reference_read_node(node); end + + # begin end + # ^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#127 + def visit_begin_node(node); end + + # foo(&bar) + # ^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#160 + def visit_block_argument_node(node); end + + # foo { |; bar| } + # ^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#168 + def visit_block_local_variable_node(node); end + + # A block on a keyword or method call. + # + # source://prism//lib/prism/translation/ruby_parser.rb#173 + def visit_block_node(node); end + + # def foo(&bar); end + # ^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#179 + def visit_block_parameter_node(node); end + + # A block's parameters. + # + # source://prism//lib/prism/translation/ruby_parser.rb#184 + def visit_block_parameters_node(node); end + + # break + # ^^^^^ + # + # break foo + # ^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#224 + def visit_break_node(node); end + + # foo.bar &&= baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#287 + def visit_call_and_write_node(node); end + + # foo + # ^^^ + # + # foo.bar + # ^^^^^^^ + # + # foo.bar() {} + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#242 + def visit_call_node(node); end + + # foo.bar += baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#277 + def visit_call_operator_write_node(node); end + + # foo.bar ||= baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#297 + def visit_call_or_write_node(node); end + + # foo.bar, = 1 + # ^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#320 + def visit_call_target_node(node); end + + # foo => bar => baz + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#326 + def visit_capture_pattern_node(node); end + + # case foo; in bar; end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#338 + def visit_case_match_node(node); end + + # case foo; when bar; end + # ^^^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#332 + def visit_case_node(node); end + + # class Foo; end + # ^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#344 + def visit_class_node(node); end + + # @@foo &&= bar + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#385 + def visit_class_variable_and_write_node(node); end + + # @@foo += bar + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#379 + def visit_class_variable_operator_write_node(node); end + + # @@foo ||= bar + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#391 + def visit_class_variable_or_write_node(node); end + + # @@foo + # ^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#364 + def visit_class_variable_read_node(node); end + + # @@foo, = bar + # ^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#397 + def visit_class_variable_target_node(node); end + + # @@foo = 1 + # ^^^^^^^^^ + # + # @@foo, @@bar = 1 + # ^^^^^ ^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#373 + def visit_class_variable_write_node(node); end + + # Foo &&= bar + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#430 + def visit_constant_and_write_node(node); end + + # Foo += bar + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#424 + def visit_constant_operator_write_node(node); end + + # Foo ||= bar + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#436 + def visit_constant_or_write_node(node); end + + # Foo::Bar &&= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#473 + def visit_constant_path_and_write_node(node); end + + # Foo::Bar + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#448 + def visit_constant_path_node(node); end + + # Foo::Bar += baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#467 + def visit_constant_path_operator_write_node(node); end + + # Foo::Bar ||= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#479 + def visit_constant_path_or_write_node(node); end + + # Foo::Bar, = baz + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#485 + def visit_constant_path_target_node(node); end + + # Foo::Bar = 1 + # ^^^^^^^^^^^^ + # + # Foo::Foo, Bar::Bar = 1 + # ^^^^^^^^ ^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#461 + def visit_constant_path_write_node(node); end + + # Foo + # ^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#409 + def visit_constant_read_node(node); end + + # Foo, = bar + # ^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#442 + def visit_constant_target_node(node); end + + # Foo = 1 + # ^^^^^^^ + # + # Foo, Bar = 1 + # ^^^ ^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#418 + def visit_constant_write_node(node); end + + # def foo; end + # ^^^^^^^^^^^^ + # + # def self.foo; end + # ^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#501 + def visit_def_node(node); end + + # defined? a + # ^^^^^^^^^^ + # + # defined?(a) + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#532 + def visit_defined_node(node); end + + # if foo then bar else baz end + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#538 + def visit_else_node(node); end + + # "foo #{bar}" + # ^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#544 + def visit_embedded_statements_node(node); end + + # "foo #@bar" + # ^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#552 + def visit_embedded_variable_node(node); end + + # begin; foo; ensure; bar; end + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#558 + def visit_ensure_node(node); end + + # false + # ^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#564 + def visit_false_node(node); end + + # foo => [*, bar, *] + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#570 + def visit_find_pattern_node(node); end + + # if foo .. bar; end + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#576 + def visit_flip_flop_node(node); end + + # 1.0 + # ^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#586 + def visit_float_node(node); end + + # for foo in bar do end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#592 + def visit_for_node(node); end + + # def foo(...); bar(...); end + # ^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#598 + def visit_forwarding_arguments_node(node); end + + # def foo(...); end + # ^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#604 + def visit_forwarding_parameter_node(node); end + + # super + # ^^^^^ + # + # super {} + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#613 + def visit_forwarding_super_node(node); end + + # $foo &&= bar + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#640 + def visit_global_variable_and_write_node(node); end + + # $foo += bar + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#634 + def visit_global_variable_operator_write_node(node); end + + # $foo ||= bar + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#646 + def visit_global_variable_or_write_node(node); end + + # $foo + # ^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#619 + def visit_global_variable_read_node(node); end + + # $foo, = bar + # ^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#652 + def visit_global_variable_target_node(node); end + + # $foo = 1 + # ^^^^^^^^ + # + # $foo, $bar = 1 + # ^^^^ ^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#628 + def visit_global_variable_write_node(node); end + + # {} + # ^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#658 + def visit_hash_node(node); end + + # foo => {} + # ^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#664 + def visit_hash_pattern_node(node); end + + # if foo then bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar if foo + # ^^^^^^^^^^ + # + # foo ? bar : baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#685 + def visit_if_node(node); end + + # 1i + # + # source://prism//lib/prism/translation/ruby_parser.rb#690 + def visit_imaginary_node(node); end + + # { foo: } + # ^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#696 + def visit_implicit_node(node); end + + # foo { |bar,| } + # ^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#701 + def visit_implicit_rest_node(node); end + + # case foo; in bar; end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#706 + def visit_in_node(node); end + + # foo[bar] &&= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#732 + def visit_index_and_write_node(node); end + + # foo[bar] += baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#719 + def visit_index_operator_write_node(node); end + + # foo[bar] ||= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#745 + def visit_index_or_write_node(node); end + + # foo[bar], = 1 + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#758 + def visit_index_target_node(node); end + + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#788 + def visit_instance_variable_and_write_node(node); end + + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#782 + def visit_instance_variable_operator_write_node(node); end + + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#794 + def visit_instance_variable_or_write_node(node); end + + # ^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#767 + def visit_instance_variable_read_node(node); end + + # @foo, = bar + # ^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#800 + def visit_instance_variable_target_node(node); end + + # ^^^^^^^^ + # + # @foo, @bar = 1 + # ^^^^ ^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#776 + def visit_instance_variable_write_node(node); end + + # 1 + # ^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#806 + def visit_integer_node(node); end + + # if /foo #{bar}/ then end + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#812 + def visit_interpolated_match_last_line_node(node); end + + # /foo #{bar}/ + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#829 + def visit_interpolated_regular_expression_node(node); end + + # "foo #{bar}" + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#844 + def visit_interpolated_string_node(node); end + + # :"foo #{bar}" + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#851 + def visit_interpolated_symbol_node(node); end + + # `foo #{bar}` + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#858 + def visit_interpolated_x_string_node(node); end + + # -> { it } + # ^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#923 + def visit_it_local_variable_read_node(node); end + + # foo(bar: baz) + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#929 + def visit_keyword_hash_node(node); end + + # def foo(**bar); end + # ^^^^^ + # + # def foo(**); end + # ^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#938 + def visit_keyword_rest_parameter_node(node); end + + # -> {} + # + # source://prism//lib/prism/translation/ruby_parser.rb#943 + def visit_lambda_node(node); end + + # foo &&= bar + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#986 + def visit_local_variable_and_write_node(node); end + + # foo += bar + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#980 + def visit_local_variable_operator_write_node(node); end + + # foo ||= bar + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#992 + def visit_local_variable_or_write_node(node); end + + # foo + # ^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#961 + def visit_local_variable_read_node(node); end + + # foo, = bar + # ^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#998 + def visit_local_variable_target_node(node); end + + # foo = 1 + # ^^^^^^^ + # + # foo, bar = 1 + # ^^^ ^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#974 + def visit_local_variable_write_node(node); end + + # if /foo/ then end + # ^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1004 + def visit_match_last_line_node(node); end + + # foo in bar + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1010 + def visit_match_predicate_node(node); end + + # foo => bar + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1016 + def visit_match_required_node(node); end + + # /(?foo)/ =~ bar + # ^^^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1022 + 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. + # + # source://prism//lib/prism/translation/ruby_parser.rb#1029 + def visit_missing_node(node); end + + # module Foo; end + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1035 + def visit_module_node(node); end + + # foo, bar = baz + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1055 + def visit_multi_target_node(node); end + + # foo, bar = baz + # ^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1065 + def visit_multi_write_node(node); end + + # next + # ^^^^ + # + # next foo + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1089 + def visit_next_node(node); end + + # nil + # ^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1102 + def visit_nil_node(node); end + + # def foo(**nil); end + # ^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1108 + def visit_no_keywords_parameter_node(node); end + + # -> { _1 + _2 } + # ^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1114 + def visit_numbered_parameters_node(node); end + + # $1 + # ^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1120 + def visit_numbered_reference_read_node(node); end + + # def foo(bar: baz); end + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1126 + def visit_optional_keyword_parameter_node(node); end + + # def foo(bar = 1); end + # ^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1132 + def visit_optional_parameter_node(node); end + + # a or b + # ^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1138 + def visit_or_node(node); end + + # def foo(bar, *baz); end + # ^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1144 + def visit_parameters_node(node); end + + # () + # ^^ + # + # (1) + # ^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1182 + def visit_parentheses_node(node); end + + # foo => ^(bar) + # ^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1192 + def visit_pinned_expression_node(node); end + + # foo = 1 and bar => ^foo + # ^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1198 + def visit_pinned_variable_node(node); end + + # END {} + # + # source://prism//lib/prism/translation/ruby_parser.rb#1207 + def visit_post_execution_node(node); end + + # BEGIN {} + # + # source://prism//lib/prism/translation/ruby_parser.rb#1212 + def visit_pre_execution_node(node); end + + # The top-level program node. + # + # source://prism//lib/prism/translation/ruby_parser.rb#1217 + def visit_program_node(node); end + + # 0..5 + # ^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1223 + def visit_range_node(node); end + + # 1r + # ^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1245 + def visit_rational_node(node); end + + # redo + # ^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1251 + def visit_redo_node(node); end + + # /foo/ + # ^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1257 + def visit_regular_expression_node(node); end + + # def foo(bar:); end + # ^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1263 + def visit_required_keyword_parameter_node(node); end + + # def foo(bar); end + # ^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1269 + def visit_required_parameter_node(node); end + + # foo rescue bar + # ^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1275 + def visit_rescue_modifier_node(node); end + + # begin; rescue; end + # ^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1281 + def visit_rescue_node(node); end + + # def foo(*bar); end + # ^^^^ + # + # def foo(*); end + # ^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1301 + def visit_rest_parameter_node(node); end + + # retry + # ^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1307 + def visit_retry_node(node); end + + # return + # ^^^^^^ + # + # return 1 + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1316 + def visit_return_node(node); end + + # self + # ^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1329 + def visit_self_node(node); end + + # A shareable constant. + # + # source://prism//lib/prism/translation/ruby_parser.rb#1334 + def visit_shareable_constant_node(node); end + + # class << self; end + # ^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1340 + def visit_singleton_class_node(node); end + + # __ENCODING__ + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1348 + def visit_source_encoding_node(node); end + + # __FILE__ + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1355 + def visit_source_file_node(node); end + + # __LINE__ + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1361 + def visit_source_line_node(node); end + + # foo(*bar) + # ^^^^ + # + # def foo((bar, *baz)); end + # ^^^^ + # + # def foo(*); bar(*); end + # ^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1373 + def visit_splat_node(node); end + + # A list of statements. + # + # source://prism//lib/prism/translation/ruby_parser.rb#1382 + def visit_statements_node(node); end + + # "foo" + # ^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1394 + def visit_string_node(node); end + + # super(foo) + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1400 + def visit_super_node(node); end + + # :foo + # ^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1414 + def visit_symbol_node(node); end + + # true + # ^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1420 + def visit_true_node(node); end + + # undef foo + # ^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1426 + def visit_undef_node(node); end + + # unless foo; bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar unless foo + # ^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1436 + def visit_unless_node(node); end + + # until foo; bar end + # ^^^^^^^^^^^^^^^^^ + # + # bar until foo + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1445 + def visit_until_node(node); end + + # case foo; when bar; end + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1451 + def visit_when_node(node); end + + # while foo; bar end + # ^^^^^^^^^^^^^^^^^^ + # + # bar while foo + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1460 + def visit_while_node(node); end + + # `foo` + # ^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1466 + def visit_x_string_node(node); end + + # yield + # ^^^^^ + # + # yield 1 + # ^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1482 + def visit_yield_node(node); end + + private + + # If a class variable is written within a method definition, it has a + # different type than everywhere else. + # + # source://prism//lib/prism/translation/ruby_parser.rb#403 + def class_variable_write_type; end + + # Create a new compiler with the given options. + # + # source://prism//lib/prism/translation/ruby_parser.rb#1489 + 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. + # + # @return [Boolean] + # + # source://prism//lib/prism/translation/ruby_parser.rb#308 + def op_asgn?(node); end + + # Call nodes with operators following them can use &. as an operator, + # which changes their type by prefixing "safe_". + # + # source://prism//lib/prism/translation/ruby_parser.rb#314 + def op_asgn_type(node, type); end + + # Create a new Sexp object from the given prism node and arguments. + # + # source://prism//lib/prism/translation/ruby_parser.rb#1494 + def s(node, *arguments); end + + # Visit a block node, which will modify the AST by wrapping the given + # visited node in an iter node. + # + # source://prism//lib/prism/translation/ruby_parser.rb#1504 + def visit_block(node, sexp, block); end + + # def foo((bar, baz)); end + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/ruby_parser.rb#1159 + def visit_destructured_parameter(node); end + + # Visit the interpolated content of the string-like node. + # + # source://prism//lib/prism/translation/ruby_parser.rb#865 + def visit_interpolated_parts(parts); end + + # Pattern constants get wrapped in another layer of :const. + # + # source://prism//lib/prism/translation/ruby_parser.rb#1525 + 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). + # + # source://prism//lib/prism/translation/ruby_parser.rb#1235 + 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. + # + # source://prism//lib/prism/translation/ruby_parser.rb#1539 + def visit_write_value(node); end +end + +# Represents the use of the literal `true` keyword. +# +# true +# ^^^^ +# +# source://prism//lib/prism/node.rb#18041 +class Prism::TrueNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [TrueNode] a new instance of TrueNode + # + # source://prism//lib/prism/node.rb#18043 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#18116 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#18049 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#18054 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#18064 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#18059 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?location: Location) -> TrueNode + # + # source://prism//lib/prism/node.rb#18069 + sig { params(location: Prism::Location).returns(Prism::TrueNode) } + def copy(location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#18054 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#18077 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#18082 + sig { override.returns(String) } + def inspect; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18100 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18110 + def type; end + end +end + +# Represents the use of the `undef` keyword. +# +# undef :foo, :bar, :baz +# ^^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#18125 +class Prism::UndefNode < ::Prism::Node + # def initialize: (Array[SymbolNode | InterpolatedSymbolNode] names, Location keyword_loc, Location location) -> void + # + # @return [UndefNode] a new instance of UndefNode + # + # source://prism//lib/prism/node.rb#18127 + sig do + params( + source: Prism::Source, + names: T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)], + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, names, keyword_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#18217 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#18135 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#18140 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#18150 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#18145 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?names: Array[SymbolNode | InterpolatedSymbolNode], ?keyword_loc: Location, ?location: Location) -> UndefNode + # + # source://prism//lib/prism/node.rb#18155 + sig do + params( + names: T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)], + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::UndefNode) + end + def copy(names: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#18140 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { names: Array[SymbolNode | InterpolatedSymbolNode], keyword_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#18163 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#18183 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#18178 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#18171 + sig { returns(Prism::Location) } + def keyword_loc; end + + # attr_reader names: Array[SymbolNode | InterpolatedSymbolNode] + # + # source://prism//lib/prism/node.rb#18168 + sig { returns(T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)]) } + def names; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18201 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18211 + 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 +# ^^^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#18232 +class Prism::UnlessNode < ::Prism::Node + # def initialize: (Location keyword_loc, Prism::node predicate, Location? then_keyword_loc, StatementsNode? statements, ElseNode? consequent, Location? end_keyword_loc, Location location) -> void + # + # @return [UnlessNode] a new instance of UnlessNode + # + # source://prism//lib/prism/node.rb#18234 + sig do + params( + source: Prism::Source, + keyword_loc: Prism::Location, + predicate: Prism::Node, + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + consequent: T.nilable(Prism::ElseNode), + end_keyword_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end + def initialize(source, keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#18399 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#18246 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#18251 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#18265 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#18256 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # The else clause of the unless expression, if present. + # + # unless cond then bar else baz end + # ^^^^^^^^ + # + # source://prism//lib/prism/node.rb#18331 + sig { returns(T.nilable(Prism::ElseNode)) } + def consequent; end + + # def copy: (?keyword_loc: Location, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?consequent: ElseNode?, ?end_keyword_loc: Location?, ?location: Location) -> UnlessNode + # + # source://prism//lib/prism/node.rb#18270 + sig do + params( + keyword_loc: Prism::Location, + predicate: Prism::Node, + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + consequent: T.nilable(Prism::ElseNode), + end_keyword_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::UnlessNode) + end + def copy(keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), consequent: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#18251 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, predicate: Prism::node, then_keyword_loc: Location?, statements: StatementsNode?, consequent: ElseNode?, end_keyword_loc: Location?, location: Location } + # + # source://prism//lib/prism/node.rb#18278 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def end_keyword: () -> String? + # + # source://prism//lib/prism/node.rb#18360 + sig { returns(T.nilable(String)) } + def end_keyword; end + + # The location of the `end` keyword, if present. + # + # unless cond then bar end + # ^^^ + # + # source://prism//lib/prism/node.rb#18337 + 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 + # + # source://prism//lib/prism/node.rb#18365 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#18350 + sig { returns(String) } + def keyword; end + + # The location of the `unless` keyword. + # + # unless cond then bar end + # ^^^^^^ + # + # bar unless cond + # ^^^^^^ + # + # source://prism//lib/prism/node.rb#18289 + sig { returns(Prism::Location) } + def keyword_loc; end + + # source://prism//lib/prism/parse_result/newlines.rb#97 + def newline!(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 + # ^^^^ + # + # source://prism//lib/prism/node.rb#18302 + sig { returns(Prism::Node) } + def predicate; 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 + # ^^^ + # + # source://prism//lib/prism/node.rb#18325 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # def then_keyword: () -> String? + # + # source://prism//lib/prism/node.rb#18355 + sig { returns(T.nilable(String)) } + def then_keyword; end + + # The location of the `then` keyword, if present. + # + # unless cond then bar end + # ^^^^ + # + # source://prism//lib/prism/node.rb#18308 + sig { returns(T.nilable(Prism::Location)) } + def then_keyword_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18383 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18393 + 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 +# ^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#18417 +class Prism::UntilNode < ::Prism::Node + # def initialize: (Integer flags, Location keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements, Location location) -> void + # + # @return [UntilNode] a new instance of UntilNode + # + # source://prism//lib/prism/node.rb#18419 + sig do + params( + source: Prism::Source, + flags: Integer, + keyword_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).void + end + def initialize(source, flags, keyword_loc, closing_loc, predicate, statements, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#18545 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#18430 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def begin_modifier?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#18496 + sig { returns(T::Boolean) } + def begin_modifier?; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#18435 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # source://prism//lib/prism/node.rb#18506 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism//lib/prism/node.rb#18477 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#18448 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#18440 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?, ?location: Location) -> UntilNode + # + # source://prism//lib/prism/node.rb#18453 + sig do + params( + flags: Integer, + keyword_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).returns(Prism::UntilNode) + end + def copy(flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#18435 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, keyword_loc: Location, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode?, location: Location } + # + # source://prism//lib/prism/node.rb#18461 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#18511 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#18501 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#18470 + sig { returns(Prism::Location) } + def keyword_loc; end + + # source://prism//lib/prism/parse_result/newlines.rb#103 + def newline!(lines); end + + # attr_reader predicate: Prism::node + # + # source://prism//lib/prism/node.rb#18490 + sig { returns(Prism::Node) } + def predicate; end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#18493 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18529 + sig { override.returns(Symbol) } + def type; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#18466 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18539 + 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 +# +# source://prism//lib/prism/visitor.rb#54 +class Prism::Visitor < ::Prism::BasicVisitor + # Visit a AliasGlobalVariableNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::AliasGlobalVariableNode).void } + def visit_alias_global_variable_node(node); end + + # Visit a AliasMethodNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::AliasMethodNode).void } + def visit_alias_method_node(node); end + + # Visit a AlternationPatternNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::AlternationPatternNode).void } + def visit_alternation_pattern_node(node); end + + # Visit a AndNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::AndNode).void } + def visit_and_node(node); end + + # Visit a ArgumentsNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ArgumentsNode).void } + def visit_arguments_node(node); end + + # Visit a ArrayNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ArrayNode).void } + def visit_array_node(node); end + + # Visit a ArrayPatternNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ArrayPatternNode).void } + def visit_array_pattern_node(node); end + + # Visit a AssocNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::AssocNode).void } + def visit_assoc_node(node); end + + # Visit a AssocSplatNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::AssocSplatNode).void } + def visit_assoc_splat_node(node); end + + # Visit a BackReferenceReadNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::BackReferenceReadNode).void } + def visit_back_reference_read_node(node); end + + # Visit a BeginNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::BeginNode).void } + def visit_begin_node(node); end + + # Visit a BlockArgumentNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::BlockArgumentNode).void } + def visit_block_argument_node(node); end + + # Visit a BlockLocalVariableNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::BlockLocalVariableNode).void } + def visit_block_local_variable_node(node); end + + # Visit a BlockNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::BlockNode).void } + def visit_block_node(node); end + + # Visit a BlockParameterNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::BlockParameterNode).void } + def visit_block_parameter_node(node); end + + # Visit a BlockParametersNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::BlockParametersNode).void } + def visit_block_parameters_node(node); end + + # Visit a BreakNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::BreakNode).void } + def visit_break_node(node); end + + # Visit a CallAndWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::CallAndWriteNode).void } + def visit_call_and_write_node(node); end + + # Visit a CallNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::CallNode).void } + def visit_call_node(node); end + + # Visit a CallOperatorWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::CallOperatorWriteNode).void } + def visit_call_operator_write_node(node); end + + # Visit a CallOrWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::CallOrWriteNode).void } + def visit_call_or_write_node(node); end + + # Visit a CallTargetNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::CallTargetNode).void } + def visit_call_target_node(node); end + + # Visit a CapturePatternNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::CapturePatternNode).void } + def visit_capture_pattern_node(node); end + + # Visit a CaseMatchNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::CaseMatchNode).void } + def visit_case_match_node(node); end + + # Visit a CaseNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::CaseNode).void } + def visit_case_node(node); end + + # Visit a ClassNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ClassNode).void } + def visit_class_node(node); end + + # Visit a ClassVariableAndWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ClassVariableAndWriteNode).void } + def visit_class_variable_and_write_node(node); end + + # Visit a ClassVariableOperatorWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ClassVariableOperatorWriteNode).void } + def visit_class_variable_operator_write_node(node); end + + # Visit a ClassVariableOrWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ClassVariableOrWriteNode).void } + def visit_class_variable_or_write_node(node); end + + # Visit a ClassVariableReadNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ClassVariableReadNode).void } + def visit_class_variable_read_node(node); end + + # Visit a ClassVariableTargetNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ClassVariableTargetNode).void } + def visit_class_variable_target_node(node); end + + # Visit a ClassVariableWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ClassVariableWriteNode).void } + def visit_class_variable_write_node(node); end + + # Visit a ConstantAndWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantAndWriteNode).void } + def visit_constant_and_write_node(node); end + + # Visit a ConstantOperatorWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantOperatorWriteNode).void } + def visit_constant_operator_write_node(node); end + + # Visit a ConstantOrWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantOrWriteNode).void } + def visit_constant_or_write_node(node); end + + # Visit a ConstantPathAndWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantPathAndWriteNode).void } + def visit_constant_path_and_write_node(node); end + + # Visit a ConstantPathNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantPathNode).void } + def visit_constant_path_node(node); end + + # Visit a ConstantPathOperatorWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantPathOperatorWriteNode).void } + def visit_constant_path_operator_write_node(node); end + + # Visit a ConstantPathOrWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantPathOrWriteNode).void } + def visit_constant_path_or_write_node(node); end + + # Visit a ConstantPathTargetNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantPathTargetNode).void } + def visit_constant_path_target_node(node); end + + # Visit a ConstantPathWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantPathWriteNode).void } + def visit_constant_path_write_node(node); end + + # Visit a ConstantReadNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantReadNode).void } + def visit_constant_read_node(node); end + + # Visit a ConstantTargetNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantTargetNode).void } + def visit_constant_target_node(node); end + + # Visit a ConstantWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantWriteNode).void } + def visit_constant_write_node(node); end + + # Visit a DefNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::DefNode).void } + def visit_def_node(node); end + + # Visit a DefinedNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::DefinedNode).void } + def visit_defined_node(node); end + + # Visit a ElseNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ElseNode).void } + def visit_else_node(node); end + + # Visit a EmbeddedStatementsNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::EmbeddedStatementsNode).void } + def visit_embedded_statements_node(node); end + + # Visit a EmbeddedVariableNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::EmbeddedVariableNode).void } + def visit_embedded_variable_node(node); end + + # Visit a EnsureNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::EnsureNode).void } + def visit_ensure_node(node); end + + # Visit a FalseNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::FalseNode).void } + def visit_false_node(node); end + + # Visit a FindPatternNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::FindPatternNode).void } + def visit_find_pattern_node(node); end + + # Visit a FlipFlopNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::FlipFlopNode).void } + def visit_flip_flop_node(node); end + + # Visit a FloatNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::FloatNode).void } + def visit_float_node(node); end + + # Visit a ForNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ForNode).void } + def visit_for_node(node); end + + # Visit a ForwardingArgumentsNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ForwardingArgumentsNode).void } + def visit_forwarding_arguments_node(node); end + + # Visit a ForwardingParameterNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ForwardingParameterNode).void } + def visit_forwarding_parameter_node(node); end + + # Visit a ForwardingSuperNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ForwardingSuperNode).void } + def visit_forwarding_super_node(node); end + + # Visit a GlobalVariableAndWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::GlobalVariableAndWriteNode).void } + def visit_global_variable_and_write_node(node); end + + # Visit a GlobalVariableOperatorWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::GlobalVariableOperatorWriteNode).void } + def visit_global_variable_operator_write_node(node); end + + # Visit a GlobalVariableOrWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::GlobalVariableOrWriteNode).void } + def visit_global_variable_or_write_node(node); end + + # Visit a GlobalVariableReadNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::GlobalVariableReadNode).void } + def visit_global_variable_read_node(node); end + + # Visit a GlobalVariableTargetNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::GlobalVariableTargetNode).void } + def visit_global_variable_target_node(node); end + + # Visit a GlobalVariableWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::GlobalVariableWriteNode).void } + def visit_global_variable_write_node(node); end + + # Visit a HashNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::HashNode).void } + def visit_hash_node(node); end + + # Visit a HashPatternNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::HashPatternNode).void } + def visit_hash_pattern_node(node); end + + # Visit a IfNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::IfNode).void } + def visit_if_node(node); end + + # Visit a ImaginaryNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ImaginaryNode).void } + def visit_imaginary_node(node); end + + # Visit a ImplicitNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ImplicitNode).void } + def visit_implicit_node(node); end + + # Visit a ImplicitRestNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ImplicitRestNode).void } + def visit_implicit_rest_node(node); end + + # Visit a InNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InNode).void } + def visit_in_node(node); end + + # Visit a IndexAndWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::IndexAndWriteNode).void } + def visit_index_and_write_node(node); end + + # Visit a IndexOperatorWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::IndexOperatorWriteNode).void } + def visit_index_operator_write_node(node); end + + # Visit a IndexOrWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::IndexOrWriteNode).void } + def visit_index_or_write_node(node); end + + # Visit a IndexTargetNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::IndexTargetNode).void } + def visit_index_target_node(node); end + + # Visit a InstanceVariableAndWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InstanceVariableAndWriteNode).void } + def visit_instance_variable_and_write_node(node); end + + # Visit a InstanceVariableOperatorWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InstanceVariableOperatorWriteNode).void } + def visit_instance_variable_operator_write_node(node); end + + # Visit a InstanceVariableOrWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InstanceVariableOrWriteNode).void } + def visit_instance_variable_or_write_node(node); end + + # Visit a InstanceVariableReadNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InstanceVariableReadNode).void } + def visit_instance_variable_read_node(node); end + + # Visit a InstanceVariableTargetNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InstanceVariableTargetNode).void } + def visit_instance_variable_target_node(node); end + + # Visit a InstanceVariableWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InstanceVariableWriteNode).void } + def visit_instance_variable_write_node(node); end + + # Visit a IntegerNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::IntegerNode).void } + def visit_integer_node(node); end + + # Visit a InterpolatedMatchLastLineNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InterpolatedMatchLastLineNode).void } + def visit_interpolated_match_last_line_node(node); end + + # Visit a InterpolatedRegularExpressionNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InterpolatedRegularExpressionNode).void } + def visit_interpolated_regular_expression_node(node); end + + # Visit a InterpolatedStringNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InterpolatedStringNode).void } + def visit_interpolated_string_node(node); end + + # Visit a InterpolatedSymbolNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InterpolatedSymbolNode).void } + def visit_interpolated_symbol_node(node); end + + # Visit a InterpolatedXStringNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InterpolatedXStringNode).void } + def visit_interpolated_x_string_node(node); end + + # Visit a ItLocalVariableReadNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ItLocalVariableReadNode).void } + def visit_it_local_variable_read_node(node); end + + # Visit a ItParametersNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ItParametersNode).void } + def visit_it_parameters_node(node); end + + # Visit a KeywordHashNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::KeywordHashNode).void } + def visit_keyword_hash_node(node); end + + # Visit a KeywordRestParameterNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::KeywordRestParameterNode).void } + def visit_keyword_rest_parameter_node(node); end + + # Visit a LambdaNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::LambdaNode).void } + def visit_lambda_node(node); end + + # Visit a LocalVariableAndWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::LocalVariableAndWriteNode).void } + def visit_local_variable_and_write_node(node); end + + # Visit a LocalVariableOperatorWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::LocalVariableOperatorWriteNode).void } + def visit_local_variable_operator_write_node(node); end + + # Visit a LocalVariableOrWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::LocalVariableOrWriteNode).void } + def visit_local_variable_or_write_node(node); end + + # Visit a LocalVariableReadNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::LocalVariableReadNode).void } + def visit_local_variable_read_node(node); end + + # Visit a LocalVariableTargetNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::LocalVariableTargetNode).void } + def visit_local_variable_target_node(node); end + + # Visit a LocalVariableWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::LocalVariableWriteNode).void } + def visit_local_variable_write_node(node); end + + # Visit a MatchLastLineNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::MatchLastLineNode).void } + def visit_match_last_line_node(node); end + + # Visit a MatchPredicateNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::MatchPredicateNode).void } + def visit_match_predicate_node(node); end + + # Visit a MatchRequiredNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::MatchRequiredNode).void } + def visit_match_required_node(node); end + + # Visit a MatchWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::MatchWriteNode).void } + def visit_match_write_node(node); end + + # Visit a MissingNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::MissingNode).void } + def visit_missing_node(node); end + + # Visit a ModuleNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ModuleNode).void } + def visit_module_node(node); end + + # Visit a MultiTargetNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::MultiTargetNode).void } + def visit_multi_target_node(node); end + + # Visit a MultiWriteNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::MultiWriteNode).void } + def visit_multi_write_node(node); end + + # Visit a NextNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::NextNode).void } + def visit_next_node(node); end + + # Visit a NilNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::NilNode).void } + def visit_nil_node(node); end + + # Visit a NoKeywordsParameterNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::NoKeywordsParameterNode).void } + def visit_no_keywords_parameter_node(node); end + + # Visit a NumberedParametersNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::NumberedParametersNode).void } + def visit_numbered_parameters_node(node); end + + # Visit a NumberedReferenceReadNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::NumberedReferenceReadNode).void } + def visit_numbered_reference_read_node(node); end + + # Visit a OptionalKeywordParameterNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::OptionalKeywordParameterNode).void } + def visit_optional_keyword_parameter_node(node); end + + # Visit a OptionalParameterNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::OptionalParameterNode).void } + def visit_optional_parameter_node(node); end + + # Visit a OrNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::OrNode).void } + def visit_or_node(node); end + + # Visit a ParametersNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ParametersNode).void } + def visit_parameters_node(node); end + + # Visit a ParenthesesNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ParenthesesNode).void } + def visit_parentheses_node(node); end + + # Visit a PinnedExpressionNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::PinnedExpressionNode).void } + def visit_pinned_expression_node(node); end + + # Visit a PinnedVariableNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::PinnedVariableNode).void } + def visit_pinned_variable_node(node); end + + # Visit a PostExecutionNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::PostExecutionNode).void } + def visit_post_execution_node(node); end + + # Visit a PreExecutionNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::PreExecutionNode).void } + def visit_pre_execution_node(node); end + + # Visit a ProgramNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ProgramNode).void } + def visit_program_node(node); end + + # Visit a RangeNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RangeNode).void } + def visit_range_node(node); end + + # Visit a RationalNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RationalNode).void } + def visit_rational_node(node); end + + # Visit a RedoNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RedoNode).void } + def visit_redo_node(node); end + + # Visit a RegularExpressionNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RegularExpressionNode).void } + def visit_regular_expression_node(node); end + + # Visit a RequiredKeywordParameterNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RequiredKeywordParameterNode).void } + def visit_required_keyword_parameter_node(node); end + + # Visit a RequiredParameterNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RequiredParameterNode).void } + def visit_required_parameter_node(node); end + + # Visit a RescueModifierNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RescueModifierNode).void } + def visit_rescue_modifier_node(node); end + + # Visit a RescueNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RescueNode).void } + def visit_rescue_node(node); end + + # Visit a RestParameterNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RestParameterNode).void } + def visit_rest_parameter_node(node); end + + # Visit a RetryNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RetryNode).void } + def visit_retry_node(node); end + + # Visit a ReturnNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ReturnNode).void } + def visit_return_node(node); end + + # Visit a SelfNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::SelfNode).void } + def visit_self_node(node); end + + # Visit a ShareableConstantNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ShareableConstantNode).void } + def visit_shareable_constant_node(node); end + + # Visit a SingletonClassNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::SingletonClassNode).void } + def visit_singleton_class_node(node); end + + # Visit a SourceEncodingNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::SourceEncodingNode).void } + def visit_source_encoding_node(node); end + + # Visit a SourceFileNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::SourceFileNode).void } + def visit_source_file_node(node); end + + # Visit a SourceLineNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::SourceLineNode).void } + def visit_source_line_node(node); end + + # Visit a SplatNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::SplatNode).void } + def visit_splat_node(node); end + + # Visit a StatementsNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::StatementsNode).void } + def visit_statements_node(node); end + + # Visit a StringNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::StringNode).void } + def visit_string_node(node); end + + # Visit a SuperNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::SuperNode).void } + def visit_super_node(node); end + + # Visit a SymbolNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::SymbolNode).void } + def visit_symbol_node(node); end + + # Visit a TrueNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::TrueNode).void } + def visit_true_node(node); end + + # Visit a UndefNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::UndefNode).void } + def visit_undef_node(node); end + + # Visit a UnlessNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::UnlessNode).void } + def visit_unless_node(node); end + + # Visit a UntilNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::UntilNode).void } + def visit_until_node(node); end + + # Visit a WhenNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::WhenNode).void } + def visit_when_node(node); end + + # Visit a WhileNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::WhileNode).void } + def visit_while_node(node); end + + # Visit a XStringNode node + # + # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::XStringNode).void } + def visit_x_string_node(node); end + + # Visit a YieldNode node + # + # source://prism//lib/prism/visitor.rb#29 + 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 +# +# source://prism//lib/prism/node.rb#18561 +class Prism::WhenNode < ::Prism::Node + # def initialize: (Location keyword_loc, Array[Prism::node] conditions, Location? then_keyword_loc, StatementsNode? statements, Location location) -> void + # + # @return [WhenNode] a new instance of WhenNode + # + # source://prism//lib/prism/node.rb#18563 + sig do + params( + source: Prism::Source, + keyword_loc: Prism::Location, + conditions: T::Array[Prism::Node], + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).void + end + def initialize(source, keyword_loc, conditions, then_keyword_loc, statements, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#18679 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#18573 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#18578 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#18591 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#18583 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # attr_reader conditions: Array[Prism::node] + # + # source://prism//lib/prism/node.rb#18616 + sig { returns(T::Array[Prism::Node]) } + def conditions; end + + # def copy: (?keyword_loc: Location, ?conditions: Array[Prism::node], ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?location: Location) -> WhenNode + # + # source://prism//lib/prism/node.rb#18596 + sig do + params( + keyword_loc: Prism::Location, + conditions: T::Array[Prism::Node], + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).returns(Prism::WhenNode) + end + def copy(keyword_loc: T.unsafe(nil), conditions: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#18578 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, conditions: Array[Prism::node], then_keyword_loc: Location?, statements: StatementsNode?, location: Location } + # + # source://prism//lib/prism/node.rb#18604 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#18645 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#18635 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#18609 + sig { returns(Prism::Location) } + def keyword_loc; end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#18632 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # def then_keyword: () -> String? + # + # source://prism//lib/prism/node.rb#18640 + sig { returns(T.nilable(String)) } + def then_keyword; end + + # attr_reader then_keyword_loc: Location? + # + # source://prism//lib/prism/node.rb#18619 + sig { returns(T.nilable(Prism::Location)) } + def then_keyword_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18663 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18673 + 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 +# ^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#18696 +class Prism::WhileNode < ::Prism::Node + # def initialize: (Integer flags, Location keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements, Location location) -> void + # + # @return [WhileNode] a new instance of WhileNode + # + # source://prism//lib/prism/node.rb#18698 + sig do + params( + source: Prism::Source, + flags: Integer, + keyword_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).void + end + def initialize(source, flags, keyword_loc, closing_loc, predicate, statements, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#18824 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#18709 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def begin_modifier?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#18775 + sig { returns(T::Boolean) } + def begin_modifier?; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#18714 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # source://prism//lib/prism/node.rb#18785 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism//lib/prism/node.rb#18756 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#18727 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#18719 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?, ?location: Location) -> WhileNode + # + # source://prism//lib/prism/node.rb#18732 + sig do + params( + flags: Integer, + keyword_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).returns(Prism::WhileNode) + end + def copy(flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#18714 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, keyword_loc: Location, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode?, location: Location } + # + # source://prism//lib/prism/node.rb#18740 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#18790 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#18780 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#18749 + sig { returns(Prism::Location) } + def keyword_loc; end + + # source://prism//lib/prism/parse_result/newlines.rb#109 + def newline!(lines); end + + # attr_reader predicate: Prism::node + # + # source://prism//lib/prism/node.rb#18769 + sig { returns(Prism::Node) } + def predicate; end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#18772 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18808 + sig { override.returns(Symbol) } + def type; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#18745 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18818 + def type; end + end +end + +# Represents an xstring literal with no interpolation. +# +# `foo` +# ^^^^^ +# +# source://prism//lib/prism/node.rb#18838 +class Prism::XStringNode < ::Prism::Node + include ::Prism::HeredocQuery + + # def initialize: (Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped, Location location) -> void + # + # @return [XStringNode] a new instance of XStringNode + # + # source://prism//lib/prism/node.rb#18840 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).void + end + def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#18971 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#18851 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#18856 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#18932 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#18902 + sig { returns(Prism::Location) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#18866 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#18861 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def content: () -> String + # + # source://prism//lib/prism/node.rb#18927 + sig { returns(String) } + def content; end + + # attr_reader content_loc: Location + # + # source://prism//lib/prism/node.rb#18895 + sig { returns(Prism::Location) } + def content_loc; end + + # def copy: (?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String, ?location: Location) -> XStringNode + # + # source://prism//lib/prism/node.rb#18871 + sig do + params( + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).returns(Prism::XStringNode) + end + def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#18856 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location } + # + # source://prism//lib/prism/node.rb#18879 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def forced_binary_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#18917 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#18912 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + sig { returns(T::Boolean) } + def heredoc?; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#18937 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#18922 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#18888 + sig { returns(Prism::Location) } + def opening_loc; 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. + # + # source://prism//lib/prism/node_ext.rb#86 + sig { returns(Prism::InterpolatedXStringNode) } + def to_interpolated; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18955 + sig { override.returns(Symbol) } + def type; end + + # attr_reader unescaped: String + # + # source://prism//lib/prism/node.rb#18909 + sig { returns(String) } + def unescaped; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#18884 + sig { returns(Integer) } + def flags; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18965 + def type; end + end +end + +# Represents the use of the `yield` keyword. +# +# yield 1 +# ^^^^^^^ +# +# source://prism//lib/prism/node.rb#18985 +class Prism::YieldNode < ::Prism::Node + # def initialize: (Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc, Location location) -> void + # + # @return [YieldNode] a new instance of YieldNode + # + # source://prism//lib/prism/node.rb#18987 + sig do + params( + source: Prism::Source, + keyword_loc: Prism::Location, + lparen_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + rparen_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end + def initialize(source, keyword_loc, lparen_loc, arguments, rparen_loc, location); end + + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#19117 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#18997 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # source://prism//lib/prism/node.rb#19052 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#19002 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#19014 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#19007 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?location: Location) -> YieldNode + # + # source://prism//lib/prism/node.rb#19019 + sig do + params( + keyword_loc: Prism::Location, + lparen_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + rparen_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::YieldNode) + end + def copy(keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#19002 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, location: Location } + # + # source://prism//lib/prism/node.rb#19027 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism//lib/prism/node.rb#19083 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#19068 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#19032 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def lparen: () -> String? + # + # source://prism//lib/prism/node.rb#19073 + sig { returns(T.nilable(String)) } + def lparen; end + + # attr_reader lparen_loc: Location? + # + # source://prism//lib/prism/node.rb#19039 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end + + # def rparen: () -> String? + # + # source://prism//lib/prism/node.rb#19078 + sig { returns(T.nilable(String)) } + def rparen; end + + # attr_reader rparen_loc: Location? + # + # source://prism//lib/prism/node.rb#19055 + sig { returns(T.nilable(Prism::Location)) } + def rparen_loc; 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. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#19101 + sig { override.returns(Symbol) } + def type; end + + class << self + # 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. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#19111 + def type; end + end +end diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/pry@0.14.2.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/pry@0.14.2.rbi new file mode 100644 index 0000000..132a7a0 --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/pry@0.14.2.rbi @@ -0,0 +1,10070 @@ +# 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`. + + +# source://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] + # + # source://pry//lib/pry/core_extensions.rb#125 + def __binding__; end +end + +# source://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] + # + # source://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. + # + # @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() + # @param object [Object] the object or binding to pry + # (__deprecated__, use `object.pry`) + # @param hash [Hash] the options hash + # @see Pry.start + # + # source://pry//lib/pry/core_extensions.rb#43 + def pry(object = T.unsafe(nil), hash = T.unsafe(nil)); end +end + +# source://pry//lib/pry/version.rb#3 +class Pry + extend ::Forwardable + extend ::Pry::Forwardable + + # Create a new {Pry} instance. + # + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param options [Hash] + # @return [Pry] a new instance of Pry + # + # source://pry//lib/pry/pry_instance.rb#81 + 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 name [Symbol] 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. + # + # source://pry//lib/pry/pry_instance.rb#212 + def add_sticky_local(name, &block); end + + # Returns the value of attribute backtrace. + # + # source://pry//lib/pry/pry_instance.rb#35 + def backtrace; end + + # Sets the attribute backtrace + # + # @param value the value to set the attribute backtrace to. + # + # source://pry//lib/pry/pry_instance.rb#35 + def backtrace=(_arg0); end + + # Returns the value of attribute binding_stack. + # + # source://pry//lib/pry/pry_instance.rb#32 + def binding_stack; end + + # Sets the attribute binding_stack + # + # @param value the value to set the attribute binding_stack to. + # + # source://pry//lib/pry/pry_instance.rb#32 + def binding_stack=(_arg0); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def color(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def color=(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def commands(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def commands=(*args, **_arg1, &block); end + + # Generate completions. + # + # @param str [String] What the user has typed so far + # @return [Array] Possible completions + # + # source://pry//lib/pry/pry_instance.rb#145 + def complete(str); end + + # Returns the value of attribute config. + # + # source://pry//lib/pry/pry_instance.rb#50 + def config; end + + # The currently active `Binding`. + # + # @return [Binding] The currently active `Binding` for the session. + # + # source://pry//lib/pry/pry_instance.rb#124 + def current_binding; end + + # The currently active `Binding`. + # support previous API + # + # @return [Binding] The currently active `Binding` for the session. + # + # source://pry//lib/pry/pry_instance.rb#124 + def current_context; end + + # Returns the value of attribute custom_completions. + # + # source://pry//lib/pry/pry_instance.rb#33 + def custom_completions; end + + # Sets the attribute custom_completions + # + # @param value the value to set the attribute custom_completions to. + # + # source://pry//lib/pry/pry_instance.rb#33 + def custom_completions=(_arg0); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def editor(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + 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. + # + # @option options + # @param line [String?] The line of input; `nil` if the user types `` + # @param options [Hash] a customizable set of options + # @raise [Exception] If the user uses the `raise-up` command, this method + # will raise that exception. + # @return [Boolean] Is Pry ready to accept more input? + # + # source://pry//lib/pry/pry_instance.rb#255 + def eval(line, options = T.unsafe(nil)); end + + # Returns the value of attribute eval_string. + # + # source://pry//lib/pry/pry_instance.rb#34 + def eval_string; end + + # Sets the attribute eval_string + # + # @param value the value to set the attribute eval_string to. + # + # source://pry//lib/pry/pry_instance.rb#34 + def eval_string=(_arg0); end + + # source://pry//lib/pry/pry_instance.rb#286 + def evaluate_ruby(code); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def exception_handler(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def exception_handler=(*args, **_arg1, &block); end + + # Execute the specified hook. + # If executing a hook raises an exception, we log that and then continue sucessfully. + # To debug such errors, use the global variable $pry_hook_error, which is set as a + # result. + # + # @param name [Symbol] The hook name to execute + # @param args [*Object] The arguments to pass to the hook + # @return [Object, Exception] The return value of the hook or the exception raised + # + # source://pry//lib/pry/pry_instance.rb#394 + def exec_hook(name, *args, &block); end + + # Returns the value of attribute exit_value. + # + # source://pry//lib/pry/pry_instance.rb#42 + def exit_value; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def extra_sticky_locals(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def extra_sticky_locals=(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def hooks(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def hooks=(*args, **_arg1, &block); end + + # Injects a local variable into the provided binding. + # + # @param name [String] The name of the local to inject. + # @param value [Object] 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. + # + # source://pry//lib/pry/pry_instance.rb#173 + def inject_local(name, value, binding); end + + # Inject all the sticky locals into the current binding. + # + # source://pry//lib/pry/pry_instance.rb#201 + def inject_sticky_locals!; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def input(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def input=(*args, **_arg1, &block); end + + # @since v0.12.0 + # + # source://pry//lib/pry/pry_instance.rb#45 + def input_ring; end + + # Returns the value of attribute last_dir. + # + # source://pry//lib/pry/pry_instance.rb#39 + def last_dir; end + + # Sets the attribute last_dir + # + # @param value the value to set the attribute last_dir to. + # + # source://pry//lib/pry/pry_instance.rb#39 + def last_dir=(_arg0); end + + # Returns the value of attribute last_exception. + # + # source://pry//lib/pry/pry_instance.rb#41 + def last_exception; end + + # Set the last exception for a session. + # + # @param exception [Exception] The last exception. + # + # source://pry//lib/pry/pry_instance.rb#418 + def last_exception=(exception); end + + # Returns the value of attribute last_file. + # + # source://pry//lib/pry/pry_instance.rb#38 + def last_file; end + + # Sets the attribute last_file + # + # @param value the value to set the attribute last_file to. + # + # source://pry//lib/pry/pry_instance.rb#38 + def last_file=(_arg0); end + + # Returns the value of attribute last_result. + # + # source://pry//lib/pry/pry_instance.rb#37 + def last_result; end + + # Sets the attribute last_result + # + # @param value the value to set the attribute last_result to. + # + # source://pry//lib/pry/pry_instance.rb#37 + 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) + # + # source://pry//lib/pry/pry_instance.rb#440 + def last_result_is_exception?; end + + # @return [Integer] The maximum amount of objects remembered by the inp and + # out arrays. Defaults to 100. + # + # source://pry//lib/pry/pry_instance.rb#190 + def memory_size; end + + # source://pry//lib/pry/pry_instance.rb#195 + def memory_size=(size); end + + # Returns an output device + # + # @example + # pry_instance.output.puts "ohai!" + # + # source://pry//lib/pry/pry_instance.rb#538 + def output; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def output=(*args, **_arg1, &block); end + + # @since v0.12.0 + # + # source://pry//lib/pry/pry_instance.rb#48 + def output_ring; end + + # Returns the currently configured pager + # + # @example + # pry_instance.pager.page text + # + # source://pry//lib/pry/pry_instance.rb#530 + def pager; end + + # source://forwardable/1.3.3/forwardable.rb#231 + 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 + # + # source://pry//lib/pry/pry_instance.rb#522 + def pop_prompt; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def print(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + 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 val [String] The line to process. + # @return [Boolean] `true` if `val` is a command, `false` otherwise + # + # source://pry//lib/pry/pry_instance.rb#325 + def process_command(val); end + + # Same as process_command, but outputs exceptions to `#output` instead of + # raising. + # + # @param val [String] The line to process. + # @return [Boolean] `true` if `val` is a command, `false` otherwise + # + # source://pry//lib/pry/pry_instance.rb#360 + def process_command_safely(val); end + + # This is the prompt at the top of the prompt stack. + # + # @return [Pry::Prompt] the current prompt + # + # source://pry//lib/pry/pry_instance.rb#101 + def prompt; end + + # Sets the Pry prompt. + # + # @param new_prompt [Pry::Prompt] + # @return [void] + # + # source://pry//lib/pry/pry_instance.rb#108 + 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. + # + # source://pry//lib/pry/pry_instance.rb#131 + 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. + # + # source://pry//lib/pry/pry_instance.rb#118 + 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 new_prompt [Pry::Prompt] + # @return [Pry::Prompt] new_prompt + # + # source://pry//lib/pry/pry_instance.rb#506 + def push_prompt(new_prompt); end + + # Convenience accessor for the `quiet` config key. + # + # @return [Boolean] + # + # source://pry//lib/pry/pry_instance.rb#592 + def quiet?; end + + # source://pry//lib/pry/pry_instance.rb#582 + def raise_up(*args); end + + # source://pry//lib/pry/pry_instance.rb#586 + 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, "unititialized constant RunThymeError") + # + # @raise [TypeError] + # + # source://pry//lib/pry/pry_instance.rb#554 + 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.) + # + # source://pry//lib/pry/pry_instance.rb#282 + 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. + # + # source://pry//lib/pry/pry_instance.rb#231 + def reset_eval_string; end + + # Run the specified command. + # + # @example + # pry_instance.run_command("ls -m") + # @param val [String] The command (and its params) to execute. + # @return [Pry::Command::VOID_VALUE] + # + # source://pry//lib/pry/pry_instance.rb#375 + def run_command(val); end + + # Returns the appropriate prompt to use. + # + # @return [String] The prompt. + # + # source://pry//lib/pry/pry_instance.rb#453 + def select_prompt; end + + # Set the last result of an eval. + # This method should not need to be invoked directly. + # + # @param result [Object] The result. + # @param code [String] The code that was run. + # + # source://pry//lib/pry/pry_instance.rb#409 + 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. + # + # source://pry//lib/pry/pry_instance.rb#447 + def should_print?; end + + # Output the result or pass to an exception handler (if result is an exception). + # + # source://pry//lib/pry/pry_instance.rb#298 + def show_result(result); end + + # source://pry//lib/pry/pry_instance.rb#216 + def sticky_locals; end + + # Returns the value of attribute suppress_output. + # + # source://pry//lib/pry/pry_instance.rb#36 + def suppress_output; end + + # Sets the attribute suppress_output + # + # @param value the value to set the attribute suppress_output to. + # + # source://pry//lib/pry/pry_instance.rb#36 + def suppress_output=(_arg0); end + + # Update Pry's internal state after evalling code. + # This method should not need to be invoked directly. + # + # @param code [String] The code we just eval'd + # + # source://pry//lib/pry/pry_instance.rb#428 + def update_input_history(code); end + + private + + # Force `eval_string` into the encoding of `val`. [Issue #284] + # + # source://pry//lib/pry/pry_instance.rb#680 + def ensure_correct_encoding!(val); end + + # source://pry//lib/pry/pry_instance.rb#688 + def generate_prompt(prompt_proc, conf); end + + # source://pry//lib/pry/pry_instance.rb#598 + def handle_line(line, options); end + + # the array that the prompt stack is stored in + # + # source://pry//lib/pry/pry_instance.rb#697 + def prompt_stack; end + + class << self + # Convert the given object into an instance of `Pry::Code`, if it isn't + # already one. + # + # @param obj [Code, Method, UnboundMethod, Proc, Pry::Method, String, Array, IO] + # + # source://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. + # + # source://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. + # + # source://pry//lib/pry/wrapped_module.rb#7 + def WrappedModule(obj); end + + # source://pry//lib/pry/pry_class.rb#294 + 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 target [Object] The object to get a `Binding` object for. + # @return [Binding] The `Binding` object. + # + # source://pry//lib/pry/pry_class.rb#347 + def binding_for(target); end + + # Returns the value of attribute cli. + # + # source://pry//lib/pry/pry_class.rb#22 + def cli; end + + # Sets the attribute cli + # + # @param value the value to set the attribute cli to. + # + # source://pry//lib/pry/pry_class.rb#22 + def cli=(_arg0); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def color(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def color=(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def commands(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def commands=(*args, **_arg1, &block); end + + # Returns the value of attribute config. + # + # source://pry//lib/pry/pry_class.rb#25 + def config; end + + # Sets the attribute config + # + # @param value the value to set the attribute config to. + # + # source://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. + # + # source://pry//lib/pry/pry_class.rb#46 + def configure; end + + # source://pry//lib/pry/pry_class.rb#380 + def critical_section; end + + # @return [Pry::Config] Returns a value store for an instance of Pry running on the current thread. + # + # source://pry//lib/pry/pry_class.rb#63 + def current; end + + # Returns the value of attribute current_line. + # + # source://pry//lib/pry/pry_class.rb#19 + def current_line; end + + # Sets the attribute current_line + # + # @param value the value to set the attribute current_line to. + # + # source://pry//lib/pry/pry_class.rb#19 + def current_line=(_arg0); end + + # Returns the value of attribute custom_completions. + # + # source://pry//lib/pry/pry_class.rb#18 + def custom_completions; end + + # Sets the attribute custom_completions + # + # @param value the value to set the attribute custom_completions to. + # + # source://pry//lib/pry/pry_class.rb#18 + def custom_completions=(_arg0); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def editor(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def editor=(*args, **_arg1, &block); end + + # Returns the value of attribute eval_path. + # + # source://pry//lib/pry/pry_class.rb#21 + def eval_path; end + + # Sets the attribute eval_path + # + # @param value the value to set the attribute eval_path to. + # + # source://pry//lib/pry/pry_class.rb#21 + def eval_path=(_arg0); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def exception_handler(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def exception_handler=(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def extra_sticky_locals(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def extra_sticky_locals=(*args, **_arg1, &block); end + + # source://pry//lib/pry/pry_class.rb#139 + def final_session_setup; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def history(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def history=(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def hooks(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def hooks=(*args, **_arg1, &block); end + + # @return [Boolean] + # + # source://pry//lib/pry/pry_class.rb#375 + def in_critical_section?; end + + # Basic initialization. + # + # source://pry//lib/pry/pry_class.rb#338 + def init; end + + # @return [Boolean] Whether this is the first time a Pry session has + # been started since loading the Pry class. + # + # source://pry//lib/pry/pry_class.rb#257 + def initial_session?; end + + # Do basic setup for initial session including: loading pryrc, plugins, + # requires, and history. + # + # source://pry//lib/pry/pry_class.rb#129 + def initial_session_setup; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def input(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def input=(*args, **_arg1, &block); end + + # Returns the value of attribute last_internal_error. + # + # source://pry//lib/pry/pry_class.rb#24 + def last_internal_error; end + + # Sets the attribute last_internal_error + # + # @param value the value to set the attribute last_internal_error to. + # + # source://pry//lib/pry/pry_class.rb#24 + def last_internal_error=(_arg0); end + + # Returns the value of attribute line_buffer. + # + # source://pry//lib/pry/pry_class.rb#20 + def line_buffer; end + + # Sets the attribute line_buffer + # + # @param value the value to set the attribute line_buffer to. + # + # source://pry//lib/pry/pry_class.rb#20 + def line_buffer=(_arg0); end + + # Load the given file in the context of `Pry.toplevel_binding` + # + # @param file [String] The unexpanded file path. + # + # source://pry//lib/pry/pry_class.rb#69 + def load_file_at_toplevel(file); end + + # Execute the file through the REPL loop, non-interactively. + # + # @param file_name [String] File name to load through the REPL. + # + # source://pry//lib/pry/pry_class.rb#202 + def load_file_through_repl(file_name); end + + # Load Readline history if required. + # + # source://pry//lib/pry/pry_class.rb#251 + def load_history; end + + # Load RC files if appropriate This method can also be used to reload the + # files if they have changed. + # + # source://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. + # + # source://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. + # + # source://pry//lib/pry/pry_class.rb#109 + def load_traps; end + + # source://pry//lib/pry/pry_class.rb#113 + def load_win32console; end + + # @return [main] returns the special instance of Object, "main". + # + # source://pry//lib/pry/pry_class.rb#55 + def main; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def memory_size(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def memory_size=(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def output(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def output=(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def pager(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def pager=(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def print(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def print=(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def prompt(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def prompt=(*args, **_arg1, &block); end + + # Returns the value of attribute quiet. + # + # source://pry//lib/pry/pry_class.rb#23 + def quiet; end + + # Sets the attribute quiet + # + # @param value the value to set the attribute quiet to. + # + # source://pry//lib/pry/pry_class.rb#23 + def quiet=(_arg0); end + + # Load the local RC file (./.pryrc) + # + # source://pry//lib/pry/pry_class.rb#86 + def rc_files_to_load; end + + # Expand a file to its canonical name (following symlinks as appropriate) + # + # source://pry//lib/pry/pry_class.rb#94 + def real_path_to(file); end + + # Set all the configurable options back to their default values + # + # source://pry//lib/pry/pry_class.rb#326 + 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). + # + # @example Run under Pry class, returning only public methods. + # Pry.run_command "ls -m", :target => Pry + # @example Run at top-level with no output. + # Pry.run_command "ls" + # @example Display command output. + # Pry.run_command "ls -av", :show_output => true + # @option options + # @option options + # @param command_string [String] The Pry command (including arguments, + # if any). + # @param options [Hash] Optional named parameters. + # @return [nil] + # + # source://pry//lib/pry/pry_class.rb#277 + 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. + # + # @example + # Pry.start(Object.new, :input => MyInput.new) + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param target [Object, Binding] The receiver of the Pry session + # @param options [Hash] + # + # source://pry//lib/pry/pry_class.rb#156 + def start(target = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://pry//lib/pry/pry_class.rb#354 + def toplevel_binding; end + + # Sets the attribute toplevel_binding + # + # @param value the value to set the attribute toplevel_binding to. + # + # source://pry//lib/pry/pry_class.rb#372 + 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. + # + # @option options + # @option options + # @param obj [Object] The object to view. + # @param options [Hash] + # @return [String] The string representation of `obj`. + # + # source://pry//lib/pry/pry_class.rb#225 + def view_clip(obj, options = T.unsafe(nil)); end + + private + + # @return [Boolean] + # + # source://pry//lib/pry/pry_class.rb#388 + 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__ +# +# source://pry//lib/pry/core_extensions.rb#9 +Pry::BINDING_METHOD_IMPL = T.let(T.unsafe(nil), Array) + +# source://pry//lib/pry/basic_object.rb#4 +class Pry::BasicObject < ::BasicObject + include ::Kernel +end + +# source://pry//lib/pry/basic_object.rb#6 +Pry::BasicObject::Dir = Dir + +# source://pry//lib/pry/basic_object.rb#6 +Pry::BasicObject::ENV = T.let(T.unsafe(nil), Object) + +# source://pry//lib/pry/basic_object.rb#6 +Pry::BasicObject::File = File + +# source://pry//lib/pry/basic_object.rb#6 +Pry::BasicObject::Kernel = Kernel + +# source://pry//lib/pry/basic_object.rb#6 +Pry::BasicObject::LoadError = LoadError + +# source://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}. +# +# source://pry//lib/pry/block_command.rb#10 +class Pry::BlockCommand < ::Pry::Command + # Call the block that was registered with this command. + # + # @param args [Array] The arguments passed + # @return [Object] The return value of the block + # + # source://pry//lib/pry/block_command.rb#14 + def call(*args); end + + # source://pry//lib/pry/block_command.rb#18 + def help; end +end + +# Manage the processing of command line options +# +# source://pry//lib/pry/cli.rb#7 +class Pry::CLI + class << self + # Add a block responsible for processing parsed options. + # + # source://pry//lib/pry/cli.rb#39 + def add_option_processor(&block); end + + # Add another set of CLI options (a Pry::Slop block) + # + # source://pry//lib/pry/cli.rb#24 + def add_options(&block); end + + # @return [Array] The input array of strings to process + # as CLI options. + # + # source://pry//lib/pry/cli.rb#21 + def input_args; end + + # @return [Array] The input array of strings to process + # as CLI options. + # + # source://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. + # + # source://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. + # + # source://pry//lib/pry/cli.rb#17 + def option_processors=(_arg0); end + + # @return [Proc] The Proc defining the valid command line options. + # + # source://pry//lib/pry/cli.rb#12 + def options; end + + # @return [Proc] The Proc defining the valid command line options. + # + # source://pry//lib/pry/cli.rb#12 + def options=(_arg0); end + + # source://pry//lib/pry/cli.rb#52 + def parse_options(args = T.unsafe(nil)); end + + # Clear `options` and `option_processors` + # + # source://pry//lib/pry/cli.rb#47 + def reset; end + + # source://pry//lib/pry/cli.rb#90 + def start(opts); end + end +end + +# source://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. +# +# source://pry//lib/pry/class_command.rb#15 +class Pry::ClassCommand < ::Pry::Command + # Returns the value of attribute args. + # + # source://pry//lib/pry/class_command.rb#64 + def args; end + + # Sets the attribute args + # + # @param value the value to set the attribute args to. + # + # source://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 args [Array] The arguments passed + # @return [Object] The return value of `process` or VOID_VALUE + # + # source://pry//lib/pry/class_command.rb#72 + def call(*args); end + + # Generate shell completions + # + # @param search [String] The line typed so far + # @return [Array] the words to complete + # + # source://pry//lib/pry/class_command.rb#105 + def complete(search); end + + # Return the help generated by Pry::Slop for this command. + # + # source://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. + # + # 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 + # @note Please don't do anything side-effecty in the main part of this + # + # source://pry//lib/pry/class_command.rb#171 + def options(opt); end + + # Returns the value of attribute opts. + # + # source://pry//lib/pry/class_command.rb#63 + def opts; end + + # Sets the attribute opts + # + # @param value the value to set the attribute opts to. + # + # source://pry//lib/pry/class_command.rb#63 + def opts=(_arg0); end + + # The actual body of your command should go here. + # + # The `opts` mehod 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 + # @raise [CommandError] + # + # source://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 + # + # source://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. + # + # source://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 invokation 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 + # + # source://pry//lib/pry/class_command.rb#156 + def subcommands(cmd); end + + class << self + # source://pry//lib/pry/class_command.rb#29 + def doc; end + + # source://pry//lib/pry/class_command.rb#37 + def file; end + + # Ensure that subclasses inherit the options, description and + # match from a ClassCommand super class. + # + # source://pry//lib/pry/class_command.rb#19 + def inherited(klass); end + + # source://pry//lib/pry/class_command.rb#42 + def line; end + + # source://pry//lib/pry/class_command.rb#25 + def source; end + + # source://pry//lib/pry/class_command.rb#37 + def source_file; end + + # source://pry//lib/pry/class_command.rb#42 + def source_line; end + + # source://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] + # + # source://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. +# +# source://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 lines [Array, String, IO] + # @param start_line [Integer?] + # @param code_type [Symbol?] + # @return [Code] a new instance of Code + # + # source://pry//lib/pry/code.rb#87 + def initialize(lines = T.unsafe(nil), start_line = T.unsafe(nil), code_type = T.unsafe(nil)); end + + # Append the given line. +lineno+ is one more than the last existing + # line, unless specified otherwise. + # + # @param line [String] + # @return [void] + # + # source://pry//lib/pry/code.rb#102 + 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 other [Code, Object] + # @return [Boolean] + # + # source://pry//lib/pry/code.rb#325 + def ==(other); end + + # Remove all lines except for the +lines+ after and excluding +lineno+. + # + # @param lineno [Integer] + # @param lines [Integer] + # @return [Code] + # + # source://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 lineno [Integer] + # @param lines [Integer] + # @return [Code] + # + # source://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 lineno [Integer] + # @param lines [Integer] + # @return [Code] + # + # source://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 start_line [Range, Integer] + # @param end_line [Integer?] + # @return [Code] + # + # source://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. + # + # source://pry//lib/pry/code.rb#77 + def code_type; end + + # @return [Symbol] The type of code stored in this wrapper. + # + # source://pry//lib/pry/code.rb#77 + def code_type=(_arg0); end + + # Get the comment that describes the expression on the given line number. + # + # @param line_number [Integer] (1-based) + # @return [String] the code. + # + # source://pry//lib/pry/code.rb#286 + def comment_describing(line_number); end + + # Get the multiline expression that starts on the given line number. + # + # @param line_number [Integer] (1-based) + # @return [String] the code. + # + # source://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 pattern [Regexp] + # @return [Code] + # + # source://pry//lib/pry/code.rb#207 + def grep(pattern); end + + # @return [String] a (possibly highlighted) copy of the source code. + # + # source://pry//lib/pry/code.rb#263 + def highlighted; end + + # Return the number of lines stored. + # + # @return [Integer] + # + # source://pry//lib/pry/code.rb#316 + def length; end + + # @return [Integer] the number of digits in the last line. + # + # source://pry//lib/pry/code.rb#252 + def max_lineno_width; end + + # Forward any missing methods to the output of `#to_s`. + # + # source://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 line_number [Integer] line number starting from 1 + # @return [Array] a list of open modules. + # + # source://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 `#<<`. + # + # source://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 line [String] + # @return [void] + # + # source://pry//lib/pry/code.rb#102 + def push(line); end + + # Return an unformatted String of the code. + # + # @return [String] + # + # source://pry//lib/pry/code.rb#309 + def raw; end + + # Filter the lines using the given block. + # + # @return [Code] + # @yield [LOC] + # + # source://pry//lib/pry/code.rb#122 + def reject(&block); end + + # Filter the lines using the given block. + # + # @return [Code] + # @yield [LOC] + # + # source://pry//lib/pry/code.rb#112 + def select(&block); end + + # Take `num_lines` from `start_line`, forward or backwards. + # + # @param start_line [Integer] + # @param num_lines [Integer] + # @return [Code] + # + # source://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). + # + # source://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 spaces [Integer?] + # @return [Code] + # + # source://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 y_n [Boolean?] + # @return [Code] + # + # source://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 lineno [Integer?] + # @return [Code] + # + # source://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. + # + # source://pry//lib/pry/code.rb#353 + def alter(&block); end + + private + + # Check whether String responds to missing methods. + # + # @return [Boolean] + # + # source://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 filename [String] The name of a file, or "(pry)". + # @param code_type [Symbol] The type of code the file contains. + # @return [Code] + # + # source://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 meth [::Method, UnboundMethod, Proc, Pry::Method] The method + # object. + # @param start_line [Integer, nil] The line number to start on, or nil to + # use the method's original line numbers. + # @return [Code] + # + # source://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 mod [Module, Class] The module (or class) of interest. + # @param candidate_rank [Integer] The module candidate (by rank) + # to use (see `Pry::WrappedModule::Candidate` for more information). + # @param start_line [Integer, nil] The line number to start on, or nil to + # use the method's original line numbers. + # @return [Code] + # + # source://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 +# +# source://pry//lib/pry/code/code_range.rb#8 +class Pry::Code::CodeRange + # @api private + # @param start_line [Integer] + # @param end_line [Integer?] + # @return [CodeRange] a new instance of CodeRange + # + # source://pry//lib/pry/code/code_range.rb#11 + def initialize(start_line, end_line = T.unsafe(nil)); end + + # @api private + # @param lines [Array] + # @return [Range] + # + # source://pry//lib/pry/code/code_range.rb#19 + def indices_range(lines); end + + private + + # @api private + # + # source://pry//lib/pry/code/code_range.rb#27 + def end_line; end + + # @api private + # @return [Integer] + # + # source://pry//lib/pry/code/code_range.rb#57 + def find_end_index(lines); end + + # @api private + # @return [Integer] + # + # source://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. + # + # @api private + # @return [void] + # + # source://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+. + # + # @api private + # @param lines [Array] + # @return [Array] + # + # source://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. + # + # @api private + # @return [void] + # + # source://pry//lib/pry/code/code_range.rb#66 + def set_end_line_from_range; end + + # @api private + # + # source://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" +# +# source://pry//lib/pry/code/loc.rb#23 +class Pry::Code::LOC + # @api private + # @param line [String] The line of code. + # @param lineno [Integer] The position of the +line+. + # @return [LOC] a new instance of LOC + # + # source://pry//lib/pry/code/loc.rb#29 + def initialize(line, lineno); end + + # @api private + # @return [Boolean] + # + # source://pry//lib/pry/code/loc.rb#34 + def ==(other); end + + # Prepends the line number `lineno` to the `line`. + # + # @api private + # @param max_width [Integer] + # @return [void] + # + # source://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+. + # + # @api private + # @param marker_lineno [Integer] If it is equal to the `lineno`, then + # prepend a hashrocket. Otherwise, an empty marker. + # @return [void] + # + # source://pry//lib/pry/code/loc.rb#81 + def add_marker(marker_lineno); end + + # Paints the `line` of code. + # + # @api private + # @param code_type [Symbol] + # @return [void] + # + # source://pry//lib/pry/code/loc.rb#56 + def colorize(code_type); end + + # @api private + # + # source://pry//lib/pry/code/loc.rb#38 + def dup; end + + # @api private + # + # source://pry//lib/pry/code/loc.rb#98 + def handle_multiline_entries_from_edit_command(line, max_width); end + + # Indents the `line` with +distance+ spaces. + # + # @api private + # @param distance [Integer] + # @return [void] + # + # source://pry//lib/pry/code/loc.rb#94 + def indent(distance); end + + # @api private + # @return [String] + # + # source://pry//lib/pry/code/loc.rb#43 + def line; end + + # @api private + # @return [Integer] + # + # source://pry//lib/pry/code/loc.rb#48 + def lineno; end + + # @api private + # @return [Array] + # + # source://pry//lib/pry/code/loc.rb#25 + def tuple; end +end + +# source://pry//lib/pry/code/code_file.rb#6 +class Pry::CodeFile + # @param filename [String] The name of a file with code to be detected + # @param code_type [Symbol] The type of code the `filename` contains + # @return [CodeFile] a new instance of CodeFile + # + # source://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`. + # + # source://pry//lib/pry/code/code_file.rb#47 + def code; end + + # @return [Symbol] The type of code stored in this wrapper. + # + # source://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`. + # + # source://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. + # + # source://pry//lib/pry/code/code_file.rb#80 + def code_path; end + + # @return [String] + # + # source://pry//lib/pry/code/code_file.rb#110 + def from_load_path; end + + # @return [String] + # + # source://pry//lib/pry/code/code_file.rb#105 + def from_pry_init_pwd; end + + # @return [String] + # + # source://pry//lib/pry/code/code_file.rb#100 + def from_pwd; end + + # @param path [String] + # @return [Boolean] if the path, with or without the default ext, + # is a readable file then `true`, otherwise `false`. + # + # source://pry//lib/pry/code/code_file.rb#73 + def readable?(path); end + + # @param filename [String] + # @param default [Symbol] (: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`. + # + # source://pry//lib/pry/code/code_file.rb#89 + def type_from_filename(filename, default = T.unsafe(nil)); end +end + +# source://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] +# +# source://pry//lib/pry/code/code_file.rb#11 +Pry::CodeFile::EXTENSIONS = T.let(T.unsafe(nil), Hash) + +# source://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] +# +# source://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 +# identifer 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. +# +# source://pry//lib/pry/code_object.rb#22 +class Pry::CodeObject + include ::Pry::Helpers::OptionsHelpers + include ::Pry::Helpers::CommandHelpers + + # @return [CodeObject] a new instance of CodeObject + # + # source://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? + # + # source://pry//lib/pry/code_object.rb#94 + def command_lookup; end + + # lookup variables and constants and `self` that are not modules + # + # source://pry//lib/pry/code_object.rb#118 + def default_lookup; end + + # when no paramter is given (i.e CodeObject.lookup(nil)), then we + # lookup the 'current object' from the binding. + # + # source://pry//lib/pry/code_object.rb#102 + def empty_lookup; end + + # source://pry//lib/pry/code_object.rb#136 + def method_or_class_lookup; end + + # Returns the value of attribute pry_instance. + # + # source://pry//lib/pry/code_object.rb#79 + def pry_instance; end + + # Sets the attribute pry_instance + # + # @param value the value to set the attribute pry_instance to. + # + # source://pry//lib/pry/code_object.rb#79 + def pry_instance=(_arg0); end + + # Returns the value of attribute str. + # + # source://pry//lib/pry/code_object.rb#77 + def str; end + + # Sets the attribute str + # + # @param value the value to set the attribute str to. + # + # source://pry//lib/pry/code_object.rb#77 + def str=(_arg0); end + + # Returns the value of attribute super_level. + # + # source://pry//lib/pry/code_object.rb#80 + def super_level; end + + # Sets the attribute super_level + # + # @param value the value to set the attribute super_level to. + # + # source://pry//lib/pry/code_object.rb#80 + def super_level=(_arg0); end + + # Returns the value of attribute target. + # + # source://pry//lib/pry/code_object.rb#78 + def target; end + + # Sets the attribute target + # + # @param value the value to set the attribute target to. + # + # source://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 str [String] + # @return [Boolean] Whether the string looks like an instance method. + # + # source://pry//lib/pry/code_object.rb#163 + def looks_like_an_instance_method?(str); end + + # grab the nth (`super_level`) super of `obj + # + # @param obj [Object] + # @param super_level [Fixnum] How far up the super chain to ascend. + # @raise [Pry::CommandError] + # + # source://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 str [String] The string to lookup + # @return [Boolean] + # + # source://pry//lib/pry/code_object.rb#173 + def safe_to_evaluate?(str); end + + # @return [Boolean] + # + # source://pry//lib/pry/code_object.rb#152 + def sourcable_object?(obj); end + + # source://pry//lib/pry/code_object.rb#181 + def target_self; end + + class << self + # source://pry//lib/pry/code_object.rb#69 + def lookup(str, pry_instance, options = T.unsafe(nil)); end + end +end + +# source://pry//lib/pry/code_object.rb#23 +module Pry::CodeObject::Helpers + # @return [Boolean] + # + # source://pry//lib/pry/code_object.rb#30 + def c_method?; end + + # @note If a module defined by C was extended with a lot of methods written + # in Ruby, this method would fail. + # @return [Boolean] `true` if this module was defined by means of the C API, + # `false` if it's a Ruby module. + # + # source://pry//lib/pry/code_object.rb#46 + def c_module?; end + + # @return [Boolean] + # + # source://pry//lib/pry/code_object.rb#38 + def command?; end + + # @return [Boolean] + # + # source://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] + # + # source://pry//lib/pry/code_object.rb#26 + def real_method_object?; end +end + +# PP subclass for streaming inspect output in color. +# +# source://pry//lib/pry/color_printer.rb#8 +class Pry::ColorPrinter < ::PP + # source://pry//lib/pry/color_printer.rb#25 + def pp(object); end + + # source://pry//lib/pry/color_printer.rb#37 + def text(str, max_width = T.unsafe(nil)); end + + private + + # source://pry//lib/pry/color_printer.rb#49 + def highlight_object_literal(object_literal); end + + # source://pry//lib/pry/color_printer.rb#55 + def inspect_object(object); end + + class << self + # source://pry//lib/pry/color_printer.rb#11 + def default(_output, value, pry_instance); end + + # source://pry//lib/pry/color_printer.rb#18 + def pp(obj, output = T.unsafe(nil), max_width = T.unsafe(nil)); end + end +end + +# N.B. using a regular expresion here so that "raise-up 'foo'" does the right thing. +# +# source://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 context [Hash] The runtime context to use with this command. + # @return [Command] a new instance of Command + # + # source://pry//lib/pry/command.rb#230 + def initialize(context = T.unsafe(nil)); end + + # source://pry//lib/pry/command.rb#292 + def _pry_; end + + # Sets the attribute pry_instance + # + # @param value the value to set the attribute pry_instance to. + # + # source://pry//lib/pry/command.rb#217 + def _pry_=(_arg0); end + + # Returns the value of attribute arg_string. + # + # source://pry//lib/pry/command.rb#213 + def arg_string; end + + # Sets the attribute arg_string + # + # @param value the value to set the attribute arg_string to. + # + # source://pry//lib/pry/command.rb#213 + def arg_string=(_arg0); end + + # source://pry//lib/pry/command.rb#253 + def block; end + + # Returns the value of attribute captures. + # + # source://pry//lib/pry/command.rb#211 + def captures; end + + # Sets the attribute captures + # + # @param value the value to set the attribute captures to. + # + # source://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. + # + # source://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 + # + # source://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 + # + # source://pry//lib/pry/command.rb#226 + def command_block=(_arg0); end + + # source://pry//lib/pry/command.rb#261 + def command_name; end + + # source://pry//lib/pry/command.rb#257 + def command_options; end + + # Returns the value of attribute command_set. + # + # source://pry//lib/pry/command.rb#215 + def command_set; end + + # Sets the attribute command_set + # + # @param value the value to set the attribute command_set to. + # + # source://pry//lib/pry/command.rb#215 + def command_set=(_arg0); end + + # source://pry//lib/pry/command.rb#284 + def commands; end + + # Generate completions for this command + # + # @param _search [String] The line typed so far + # @return [Array] Completion words + # + # source://pry//lib/pry/command.rb#411 + def complete(_search); end + + # Returns the value of attribute context. + # + # source://pry//lib/pry/command.rb#214 + def context; end + + # Sets the attribute context + # + # @param value the value to set the attribute context to. + # + # source://pry//lib/pry/command.rb#214 + def context=(_arg0); end + + # source://pry//lib/pry/command.rb#249 + def description; end + + # Returns the value of attribute eval_string. + # + # source://pry//lib/pry/command.rb#212 + def eval_string; end + + # Sets the attribute eval_string + # + # @param value the value to set the attribute eval_string to. + # + # source://pry//lib/pry/command.rb#212 + def eval_string=(_arg0); end + + # Returns the value of attribute hooks. + # + # source://pry//lib/pry/command.rb#216 + def hooks; end + + # Sets the attribute hooks + # + # @param value the value to set the attribute hooks to. + # + # source://pry//lib/pry/command.rb#216 + def hooks=(_arg0); end + + # Revaluate the string (str) and perform interpolation. + # + # @param str [String] The string to reevaluate with interpolation. + # @return [String] The reevaluated string with interpolations + # applied (if any). + # + # source://pry//lib/pry/command.rb#318 + def interpolate_string(str); end + + # source://pry//lib/pry/command.rb#245 + def match; end + + # Make those properties accessible to instances + # + # source://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` + # + # source://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` + # + # source://pry//lib/pry/command.rb#209 + def output=(_arg0); end + + # Process a line that Command.matches? this command. + # + # @param line [String] The line to process + # @return [Object, Command::VOID_VALUE] + # + # source://pry//lib/pry/command.rb#394 + def process_line(line); end + + # Returns the value of attribute pry_instance. + # + # source://pry//lib/pry/command.rb#217 + def pry_instance; end + + # Sets the attribute pry_instance + # + # @param value the value to set the attribute pry_instance to. + # + # source://pry//lib/pry/command.rb#217 + def pry_instance=(_arg0); end + + # Run a command from another command. + # + # @example + # run "show-input" + # @example + # run ".ls" + # @example + # run "amend-line", "5", 'puts "hello world"' + # @param command_string [String] The string that invokes the command + # @param args [Array] Further arguments to pass to the command + # + # source://pry//lib/pry/command.rb#278 + def run(command_string, *args); end + + # source://pry//lib/pry/command.rb#265 + def source; end + + # @example + # state.my_state = "my state" # this will not conflict with any + # # `state.my_state` used in another command. + # @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. + # + # source://pry//lib/pry/command.rb#309 + def state; end + + # Returns the value of attribute target. + # + # source://pry//lib/pry/command.rb#210 + def target; end + + # Sets the attribute target + # + # @param value the value to set the attribute target to. + # + # source://pry//lib/pry/command.rb#210 + def target=(_arg0); end + + # @return [Object] The value of `self` inside the `target` binding. + # + # source://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 val [String] The line of input + # @return [Array] + # + # source://pry//lib/pry/command.rb#356 + def tokenize(val); end + + # source://pry//lib/pry/command.rb#288 + def void; end + + private + + # source://pry//lib/pry/command.rb#485 + def after_hooks; end + + # source://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 args [Array] The arguments to pass to this command. + # @return [Object] The return value of the `#call` method, or + # {Command::VOID_VALUE}. + # + # source://pry//lib/pry/command.rb#425 + def call_safely(*args); end + + # Run the `#call` method and all the registered hooks. + # + # @param args [Array] The arguments to `#call` + # @return [Object] The return value from `#call` + # + # source://pry//lib/pry/command.rb#492 + def call_with_hooks(*args); end + + # source://pry//lib/pry/command.rb#476 + def find_hooks(event); end + + # Normalize method arguments according to its arity. + # + # @param method [Integer] + # @param args [Array] + # @return [Array] a (possibly shorter) array of the arguments to pass + # + # source://pry//lib/pry/command.rb#509 + def normalize_method_args(method, args); end + + # Pass a block argument to a command. + # + # @param arg_string [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`. + # + # source://pry//lib/pry/command.rb#451 + def pass_block(arg_string); end + + # source://pry//lib/pry/command.rb#436 + def use_unpatched_symbol; end + + class << self + # Define or get the command's banner + # + # source://pry//lib/pry/command.rb#61 + def banner(arg = T.unsafe(nil)); end + + # source://pry//lib/pry/command.rb#66 + def block; end + + # Sets the attribute block + # + # @param value the value to set the attribute block to. + # + # source://pry//lib/pry/command.rb#30 + def block=(_arg0); end + + # source://pry//lib/pry/command.rb#109 + def command_name; end + + # Define or get the command's options + # + # source://pry//lib/pry/command.rb#51 + def command_options(arg = T.unsafe(nil)); end + + # Sets the attribute command_options + # + # @param value the value to set the attribute command_options to. + # + # source://pry//lib/pry/command.rb#32 + def command_options=(_arg0); end + + # source://pry//lib/pry/command.rb#165 + def command_regex; end + + # source://pry//lib/pry/command.rb#172 + def convert_to_regex(obj); end + + # source://pry//lib/pry/command.rb#89 + def default_options(match); end + + # Define or get the command's description + # + # source://pry//lib/pry/command.rb#45 + def description(arg = T.unsafe(nil)); end + + # Sets the attribute description + # + # @param value the value to set the attribute description to. + # + # source://pry//lib/pry/command.rb#31 + def description=(_arg0); end + + # source://pry//lib/pry/command.rb#75 + def doc; end + + # source://pry//lib/pry/command.rb#79 + 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. + # + # source://pry//lib/pry/command.rb#185 + def group(name = T.unsafe(nil)); end + + # source://pry//lib/pry/command.rb#105 + def inspect; end + + # source://pry//lib/pry/command.rb#84 + def line; end + + # source://pry//lib/pry/command.rb#35 + def match(arg = T.unsafe(nil)); end + + # Sets the attribute match + # + # @param value the value to set the attribute match to. + # + # source://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 val [String] A line input at the REPL + # @return [Fixnum] + # + # source://pry//lib/pry/command.rb#153 + def match_score(val); end + + # Should this command be called for the given line? + # + # @param val [String] A line input at the REPL + # @return [Boolean] + # + # source://pry//lib/pry/command.rb#133 + def matches?(val); end + + # source://pry//lib/pry/command.rb#101 + def name; end + + # Define or get the command's options + # backward compatibility + # + # source://pry//lib/pry/command.rb#51 + def options(arg = T.unsafe(nil)); end + + # Sets the attribute command_options + # + # @param value the value to set the attribute command_options to. + # + # source://pry//lib/pry/command.rb#32 + def options=(_arg0); end + + # source://pry//lib/pry/command.rb#70 + def source; end + + # source://pry//lib/pry/command.rb#79 + def source_file; end + + # source://pry//lib/pry/command.rb#84 + def source_line; end + + # source://pry//lib/pry/command.rb#202 + def state; end + + # Create a new command with the given properties. + # + # @param match [String, Regex] The thing that triggers this command + # @param description [String] The description to appear in `help` + # @param options [Hash] Behavioral options (see {Pry::CommandSet#command}) + # @param helpers [Module] A module of helper functions to be included. + # @return [Class] (a subclass of {Pry::Command}) + # @yield optional, used for BlockCommands + # + # source://pry//lib/pry/command.rb#120 + def subclass(match, description, options, helpers, &block); end + end +end + +# source://pry//lib/pry/commands/amend_line.rb#5 +class Pry::Command::AmendLine < ::Pry::ClassCommand + # @raise [CommandError] + # + # source://pry//lib/pry/commands/amend_line.rb#22 + def process; end + + private + + # @return [String] A new string with the amendments applied to it. + # + # source://pry//lib/pry/commands/amend_line.rb#33 + def amend_input; end + + # source://pry//lib/pry/commands/amend_line.rb#47 + def delete_from_array(array, range); end + + # source://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) + # + # source://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. + # + # source://pry//lib/pry/commands/amend_line.rb#90 + def line_range; end + + # source://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] + # + # source://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 + # indentified by 1 rather than by 0 (as is the case for Ruby arrays). + # + # @param start_line_number [Fixnum] One-indexed number. + # @param end_line_number [Fixnum] One-indexed number. + # @return [Range] The zero-indexed range. + # + # source://pry//lib/pry/commands/amend_line.rb#83 + def zero_indexed_range_from_one_indexed_numbers(start_line_number, end_line_number); end +end + +# source://pry//lib/pry/commands/bang.rb#5 +class Pry::Command::Bang < ::Pry::ClassCommand + # source://pry//lib/pry/commands/bang.rb#16 + def process; end +end + +# source://pry//lib/pry/commands/bang_pry.rb#5 +class Pry::Command::BangPry < ::Pry::ClassCommand + # source://pry//lib/pry/commands/bang_pry.rb#14 + def process; end +end + +# source://pry//lib/pry/commands/cat.rb#5 +class Pry::Command::Cat < ::Pry::ClassCommand + # source://pry//lib/pry/commands/cat.rb#53 + def complete(search); end + + # source://pry//lib/pry/commands/cat.rb#57 + def load_path_completions; end + + # source://pry//lib/pry/commands/cat.rb#23 + def options(opt); end + + # source://pry//lib/pry/commands/cat.rb#38 + def process; end +end + +# source://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 + + # source://pry//lib/pry/commands/cat/abstract_formatter.rb#26 + def between_lines; end + + # source://pry//lib/pry/commands/cat/abstract_formatter.rb#18 + def code_type; end + + # source://pry//lib/pry/commands/cat/abstract_formatter.rb#12 + def decorate(content); end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/cat/abstract_formatter.rb#22 + def use_line_numbers?; end +end + +# source://pry//lib/pry/commands/cat/exception_formatter.rb#6 +class Pry::Command::Cat::ExceptionFormatter < ::Pry::Command::Cat::AbstractFormatter + include ::Pry::Helpers::Text + + # @return [ExceptionFormatter] a new instance of ExceptionFormatter + # + # source://pry//lib/pry/commands/cat/exception_formatter.rb#12 + def initialize(exception, pry_instance, opts); end + + # Returns the value of attribute ex. + # + # source://pry//lib/pry/commands/cat/exception_formatter.rb#7 + def ex; end + + # source://pry//lib/pry/commands/cat/exception_formatter.rb#18 + def format; end + + # Returns the value of attribute opts. + # + # source://pry//lib/pry/commands/cat/exception_formatter.rb#8 + def opts; end + + # Returns the value of attribute pry_instance. + # + # source://pry//lib/pry/commands/cat/exception_formatter.rb#9 + def pry_instance; end + + private + + # source://pry//lib/pry/commands/cat/exception_formatter.rb#56 + def backtrace_file; end + + # source://pry//lib/pry/commands/cat/exception_formatter.rb#37 + def backtrace_level; end + + # source://pry//lib/pry/commands/cat/exception_formatter.rb#60 + def backtrace_line; end + + # @raise [CommandError] + # + # source://pry//lib/pry/commands/cat/exception_formatter.rb#64 + def check_for_errors; end + + # source://pry//lib/pry/commands/cat/exception_formatter.rb#33 + def code_window_size; end + + # source://pry//lib/pry/commands/cat/exception_formatter.rb#78 + def header; end + + # source://pry//lib/pry/commands/cat/exception_formatter.rb#52 + def increment_backtrace_level; end + + # source://pry//lib/pry/commands/cat/exception_formatter.rb#71 + def start_and_end_line_for_code_window; end +end + +# source://pry//lib/pry/commands/cat/file_formatter.rb#6 +class Pry::Command::Cat::FileFormatter < ::Pry::Command::Cat::AbstractFormatter + # @return [FileFormatter] a new instance of FileFormatter + # + # source://pry//lib/pry/commands/cat/file_formatter.rb#11 + def initialize(file_with_embedded_line, pry_instance, opts); end + + # source://pry//lib/pry/commands/cat/file_formatter.rb#27 + def file_and_line; end + + # Returns the value of attribute file_with_embedded_line. + # + # source://pry//lib/pry/commands/cat/file_formatter.rb#7 + def file_with_embedded_line; end + + # source://pry//lib/pry/commands/cat/file_formatter.rb#22 + def format; end + + # Returns the value of attribute opts. + # + # source://pry//lib/pry/commands/cat/file_formatter.rb#8 + def opts; end + + # Returns the value of attribute pry_instance. + # + # source://pry//lib/pry/commands/cat/file_formatter.rb#9 + def pry_instance; end + + private + + # source://pry//lib/pry/commands/cat/file_formatter.rb#55 + def code_type; end + + # source://pry//lib/pry/commands/cat/file_formatter.rb#43 + def code_window_size; end + + # source://pry//lib/pry/commands/cat/file_formatter.rb#47 + def decorate(content); end + + # source://pry//lib/pry/commands/cat/file_formatter.rb#59 + def detect_code_type_from_file(file_name); end + + # source://pry//lib/pry/commands/cat/file_formatter.rb#35 + def file_name; end + + # source://pry//lib/pry/commands/cat/file_formatter.rb#39 + def line_number; end +end + +# source://pry//lib/pry/commands/cat/input_expression_formatter.rb#6 +class Pry::Command::Cat::InputExpressionFormatter < ::Pry::Command::Cat::AbstractFormatter + # @return [InputExpressionFormatter] a new instance of InputExpressionFormatter + # + # source://pry//lib/pry/commands/cat/input_expression_formatter.rb#10 + def initialize(input_expressions, opts); end + + # @raise [CommandError] + # + # source://pry//lib/pry/commands/cat/input_expression_formatter.rb#15 + def format; end + + # Returns the value of attribute input_expressions. + # + # source://pry//lib/pry/commands/cat/input_expression_formatter.rb#7 + def input_expressions; end + + # Sets the attribute input_expressions + # + # @param value the value to set the attribute input_expressions to. + # + # source://pry//lib/pry/commands/cat/input_expression_formatter.rb#7 + def input_expressions=(_arg0); end + + # Returns the value of attribute opts. + # + # source://pry//lib/pry/commands/cat/input_expression_formatter.rb#8 + def opts; end + + # Sets the attribute opts + # + # @param value the value to set the attribute opts to. + # + # source://pry//lib/pry/commands/cat/input_expression_formatter.rb#8 + def opts=(_arg0); end + + private + + # source://pry//lib/pry/commands/cat/input_expression_formatter.rb#42 + def normalized_expression_range; end + + # source://pry//lib/pry/commands/cat/input_expression_formatter.rb#37 + def numbered_input_items; end + + # source://pry//lib/pry/commands/cat/input_expression_formatter.rb#33 + def selected_input_items; end +end + +# source://pry//lib/pry/commands/cd.rb#5 +class Pry::Command::Cd < ::Pry::ClassCommand + # source://pry//lib/pry/commands/cd.rb#25 + def process; end +end + +# source://pry//lib/pry/commands/change_inspector.rb#5 +class Pry::Command::ChangeInspector < ::Pry::ClassCommand + # source://pry//lib/pry/commands/change_inspector.rb#17 + def process(inspector); end + + private + + # source://pry//lib/pry/commands/change_inspector.rb#28 + def inspector_map; end +end + +# source://pry//lib/pry/commands/change_prompt.rb#5 +class Pry::Command::ChangePrompt < ::Pry::ClassCommand + # source://pry//lib/pry/commands/change_prompt.rb#16 + def options(opt); end + + # source://pry//lib/pry/commands/change_prompt.rb#20 + def process(prompt); end + + private + + # source://pry//lib/pry/commands/change_prompt.rb#38 + def change_prompt(prompt); end + + # source://pry//lib/pry/commands/change_prompt.rb#30 + def list_prompts; end +end + +# source://pry//lib/pry/commands/clear_screen.rb#5 +class Pry::Command::ClearScreen < ::Pry::ClassCommand + # source://pry//lib/pry/commands/clear_screen.rb#10 + def process; end +end + +# source://pry//lib/pry/commands/code_collector.rb#5 +class Pry::Command::CodeCollector + include ::Pry::Helpers::OptionsHelpers + include ::Pry::Helpers::CommandHelpers + + # @return [CodeCollector] a new instance of CodeCollector + # + # source://pry//lib/pry/commands/code_collector.rb#23 + def initialize(args, opts, pry_instance); end + + # Returns the value of attribute args. + # + # source://pry//lib/pry/commands/code_collector.rb#8 + def args; end + + # The code object + # + # @return [Pry::WrappedModule, Pry::Method, Pry::Command] + # + # source://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] + # + # source://pry//lib/pry/commands/code_collector.rb#60 + def content; end + + # The name of the explicitly given file (if any). + # + # source://pry//lib/pry/commands/code_collector.rb#13 + def file; end + + # The name of the explicitly given file (if any). + # + # source://pry//lib/pry/commands/code_collector.rb#13 + def file=(_arg0); end + + # The line range passed to `--lines`, converted to a 0-indexed range. + # + # source://pry//lib/pry/commands/code_collector.rb#123 + def line_range; end + + # Name of the object argument + # + # source://pry//lib/pry/commands/code_collector.rb#128 + def obj_name; end + + # Returns the value of attribute opts. + # + # source://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] + # + # source://pry//lib/pry/commands/code_collector.rb#116 + def pry_input_content; end + + # Returns the value of attribute pry_instance. + # + # source://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] + # + # source://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 content [String] + # @param range [Range, Fixnum] + # @return [String] The string restricted to the given range + # + # source://pry//lib/pry/commands/code_collector.rb#96 + def restrict_to_lines(content, range); end + + private + + # @return [Boolean] + # + # source://pry//lib/pry/commands/code_collector.rb#134 + def bad_option_combination?; end + + # source://pry//lib/pry/commands/code_collector.rb#153 + def code_object_doc; end + + # source://pry//lib/pry/commands/code_collector.rb#157 + def code_object_source_or_file; end + + # source://pry//lib/pry/commands/code_collector.rb#175 + def convert_to_range(range); end + + # @raise [CommandError] + # + # source://pry//lib/pry/commands/code_collector.rb#171 + def could_not_locate(name); end + + # source://pry//lib/pry/commands/code_collector.rb#161 + def file_content; end + + # source://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. + # + # source://pry//lib/pry/commands/code_collector.rb#30 + def inject_options(opt); end + + # Returns the value of attribute input_expression_ranges. + # + # source://pry//lib/pry/commands/code_collector.rb#16 + def input_expression_ranges; end + + # Sets the attribute input_expression_ranges + # + # @param value the value to set the attribute input_expression_ranges to. + # + # source://pry//lib/pry/commands/code_collector.rb#16 + def input_expression_ranges=(_arg0); end + + # Returns the value of attribute output_result_ranges. + # + # source://pry//lib/pry/commands/code_collector.rb#17 + def output_result_ranges; end + + # Sets the attribute output_result_ranges + # + # @param value the value to set the attribute output_result_ranges to. + # + # source://pry//lib/pry/commands/code_collector.rb#17 + def output_result_ranges=(_arg0); end + end +end + +# source://pry//lib/pry/commands/disable_pry.rb#5 +class Pry::Command::DisablePry < ::Pry::ClassCommand + # source://pry//lib/pry/commands/disable_pry.rb#23 + def process; end +end + +# source://pry//lib/pry/commands/edit.rb#5 +class Pry::Command::Edit < ::Pry::ClassCommand + # source://pry//lib/pry/commands/edit.rb#89 + def apply_runtime_patch; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/edit.rb#172 + def bad_option_combination?; end + + # source://pry//lib/pry/commands/edit.rb#152 + def code_object; end + + # @raise [CommandError] + # + # source://pry//lib/pry/commands/edit.rb#105 + def ensure_file_name_is_valid(file_name); end + + # source://pry//lib/pry/commands/edit.rb#119 + def file_and_line; end + + # source://pry//lib/pry/commands/edit.rb#115 + def file_and_line_for_current_exception; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/edit.rb#78 + def file_based_exception?; end + + # source://pry//lib/pry/commands/edit.rb#135 + def file_edit; end + + # source://pry//lib/pry/commands/edit.rb#148 + def filename_argument; end + + # source://pry//lib/pry/commands/edit.rb#203 + def initial_temp_file_content; end + + # source://pry//lib/pry/commands/edit.rb#180 + def input_expression; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/edit.rb#195 + def never_reload?; end + + # source://pry//lib/pry/commands/edit.rb#25 + def options(opt); end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/edit.rb#168 + def patch_exception?; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/edit.rb#163 + def previously_patched?(code_object); end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/edit.rb#215 + def probably_a_file?(str); end + + # source://pry//lib/pry/commands/edit.rb#46 + def process; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/edit.rb#158 + def pry_method?(code_object); end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/edit.rb#199 + def reload?(file_name = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/edit.rb#191 + def reloadable?; end + + # source://pry//lib/pry/commands/edit.rb#69 + def repl_edit; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/edit.rb#64 + def repl_edit?; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/edit.rb#82 + def runtime_patch?; end +end + +# source://pry//lib/pry/commands/edit/exception_patcher.rb#6 +class Pry::Command::Edit::ExceptionPatcher + # @return [ExceptionPatcher] a new instance of ExceptionPatcher + # + # source://pry//lib/pry/commands/edit/exception_patcher.rb#11 + def initialize(pry_instance, state, exception_file_and_line); end + + # Returns the value of attribute file_and_line. + # + # source://pry//lib/pry/commands/edit/exception_patcher.rb#9 + def file_and_line; end + + # Sets the attribute file_and_line + # + # @param value the value to set the attribute file_and_line to. + # + # source://pry//lib/pry/commands/edit/exception_patcher.rb#9 + def file_and_line=(_arg0); end + + # perform the patch + # + # source://pry//lib/pry/commands/edit/exception_patcher.rb#18 + def perform_patch; end + + # Returns the value of attribute pry_instance. + # + # source://pry//lib/pry/commands/edit/exception_patcher.rb#7 + def pry_instance; end + + # Sets the attribute pry_instance + # + # @param value the value to set the attribute pry_instance to. + # + # source://pry//lib/pry/commands/edit/exception_patcher.rb#7 + def pry_instance=(_arg0); end + + # Returns the value of attribute state. + # + # source://pry//lib/pry/commands/edit/exception_patcher.rb#8 + def state; end + + # Sets the attribute state + # + # @param value the value to set the attribute state to. + # + # source://pry//lib/pry/commands/edit/exception_patcher.rb#8 + def state=(_arg0); end +end + +# source://pry//lib/pry/commands/edit/file_and_line_locator.rb#6 +module Pry::Command::Edit::FileAndLineLocator + class << self + # source://pry//lib/pry/commands/edit/file_and_line_locator.rb#8 + def from_binding(target); end + + # source://pry//lib/pry/commands/edit/file_and_line_locator.rb#16 + def from_code_object(code_object, filename_argument); end + + # @raise [CommandError] + # + # source://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 + # + # source://pry//lib/pry/commands/edit/file_and_line_locator.rb#38 + def from_filename_argument(filename_argument); end + end +end + +# source://pry//lib/pry/commands/exit.rb#5 +class Pry::Command::Exit < ::Pry::ClassCommand + # source://pry//lib/pry/commands/exit.rb#25 + def process; end + + # source://pry//lib/pry/commands/exit.rb#34 + def process_pop_and_return; end +end + +# source://pry//lib/pry/commands/exit_all.rb#5 +class Pry::Command::ExitAll < ::Pry::ClassCommand + # source://pry//lib/pry/commands/exit_all.rb#18 + def process; end +end + +# source://pry//lib/pry/commands/exit_program.rb#5 +class Pry::Command::ExitProgram < ::Pry::ClassCommand + # source://pry//lib/pry/commands/exit_program.rb#18 + def process; end +end + +# source://pry//lib/pry/commands/find_method.rb#5 +class Pry::Command::FindMethod < ::Pry::ClassCommand + extend ::Pry::Helpers::BaseHelpers + + # source://pry//lib/pry/commands/find_method.rb#31 + def options(opt); end + + # source://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 + # + # source://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 namespace [Module] The namespace to search + # @return [Array] + # + # source://pry//lib/pry/commands/find_method.rb#186 + def content_search(namespace); end + + # source://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 namespace [Module] The namespace to search + # @return [Array] + # + # source://pry//lib/pry/commands/find_method.rb#174 + def name_search(namespace); end + + # @return [Regexp] The pattern to search for. + # + # source://pry//lib/pry/commands/find_method.rb#48 + def pattern; end + + # pretty-print a list of matching methods. + # + # @param matches [Array] + # + # source://pry//lib/pry/commands/find_method.rb#80 + def print_matches(matches); end + + # Print matched methods for a class + # + # source://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 klass [Module] The namespace in which to start the search. + # @param done [Hash] The namespaces we've already visited (private) + # @yieldparam klass Each class/module in the namespace. + # + # source://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 namespace [Module] The namespace in which to search. + # @return [Array] + # @yieldparam method [Method] The method to test + # @yieldreturn [Boolean] + # + # source://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`. + # + # source://pry//lib/pry/commands/find_method.rb#67 + def search_class; end + + # Output the result of the search. + # + # @param matches [Array] + # + # source://pry//lib/pry/commands/find_method.rb#55 + def show_search_results(matches); end +end + +# source://pry//lib/pry/commands/fix_indent.rb#5 +class Pry::Command::FixIndent < ::Pry::ClassCommand + # source://pry//lib/pry/commands/fix_indent.rb#15 + def process; end +end + +# source://pry//lib/pry/commands/help.rb#5 +class Pry::Command::Help < ::Pry::ClassCommand + # Get a hash of available commands grouped by the "group" name. + # + # source://pry//lib/pry/commands/help.rb#29 + def command_groups; end + + # Display help for an individual command. + # + # @param command [Pry::Command] + # + # source://pry//lib/pry/commands/help.rb#125 + def display_command(command); end + + # Display help for a searched item, filtered by group + # + # @param search [String] The string to search for. + # @raise [CommandError] + # + # source://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 search [String] The string to search for. + # + # source://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 groups [Hash>] + # + # source://pry//lib/pry/commands/help.rb#44 + def display_index(groups); end + + # Display help for an individual command or group. + # + # @param search [String] The string to search for. + # + # source://pry//lib/pry/commands/help.rb#86 + def display_search(search); end + + # source://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 name [String] The group name. + # @param commands [Array] + # @return [String] The generated help string. + # + # source://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 key [String] + # @return [String] + # + # source://pry//lib/pry/commands/help.rb#155 + def normalize(key); end + + # source://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 search [String] the search term + # @param hash [Hash] the hash to search + # + # source://pry//lib/pry/commands/help.rb#137 + def search_hash(search, hash); end + + # Sort an array of commands by their `listing` name. + # + # @param commands [Array] The commands to sort + # @return [Array] commands sorted by listing name. + # + # source://pry//lib/pry/commands/help.rb#79 + def sorted_commands(commands); end + + # @param groups [Hash] + # @return [Array] An array of sorted group names. + # + # source://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. + # + # source://pry//lib/pry/commands/help.rb#20 + def visible_commands; end +end + +# source://pry//lib/pry/commands/hist.rb#5 +class Pry::Command::Hist < ::Pry::ClassCommand + # source://pry//lib/pry/commands/hist.rb#25 + def options(opt); end + + # source://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)> + # @param replay_sequence [String] The sequence of commands to be replayed + # (per saltum) + # @raise [Pry::CommandError] If +replay_sequence+ contains another + # "hist --replay" call + # @return [Boolean] `false` if +replay_sequence+ does not contain another + # "hist --replay" call + # + # source://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. + # + # source://pry//lib/pry/commands/hist.rb#168 + def find_history; end + + # source://pry//lib/pry/commands/hist.rb#105 + def process_clear; end + + # source://pry//lib/pry/commands/hist.rb#78 + def process_display; end + + # source://pry//lib/pry/commands/hist.rb#110 + def process_replay; end + + # source://pry//lib/pry/commands/hist.rb#86 + def process_save; end +end + +# source://pry//lib/pry/commands/import_set.rb#5 +class Pry::Command::ImportSet < ::Pry::ClassCommand + # TODO: resolve unused parameter. + # + # @raise [CommandError] + # + # source://pry//lib/pry/commands/import_set.rb#17 + def process(_command_set_name); end +end + +# source://pry//lib/pry/commands/jump_to.rb#5 +class Pry::Command::JumpTo < ::Pry::ClassCommand + # source://pry//lib/pry/commands/jump_to.rb#14 + def process(break_level); end +end + +# source://pry//lib/pry/commands/list_inspectors.rb#5 +class Pry::Command::ListInspectors < ::Pry::ClassCommand + # source://pry//lib/pry/commands/list_inspectors.rb#16 + def process; end + + private + + # source://pry//lib/pry/commands/list_inspectors.rb#28 + def inspector_map; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/list_inspectors.rb#36 + def selected_inspector?(inspector); end + + # source://pry//lib/pry/commands/list_inspectors.rb#32 + def selected_text; end +end + +# source://pry//lib/pry/commands/ls/jruby_hacks.rb#5 +class Pry::Command::Ls < ::Pry::ClassCommand + # Exclude -q, -v and --grep because they, + # don't specify what the user wants to see. + # + # @return [Boolean] + # + # source://pry//lib/pry/commands/ls.rb#85 + def no_user_opts?; end + + # source://pry//lib/pry/commands/ls.rb#52 + def options(opt); end + + # source://pry//lib/pry/commands/ls.rb#90 + def process; end + + private + + # source://pry//lib/pry/commands/ls.rb#106 + def error_list; end + + # source://pry//lib/pry/commands/ls.rb#126 + def raise_errors_if_arguments_are_weird; end +end + +# source://pry//lib/pry/commands/ls/constants.rb#6 +class Pry::Command::Ls::Constants < ::Pry::Command::Ls::Formatter + include ::Pry::Command::Ls::Interrogatable + + # @return [Constants] a new instance of Constants + # + # source://pry//lib/pry/commands/ls/constants.rb#14 + def initialize(interrogatee, no_user_opts, opts, pry_instance); end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/ls/constants.rb#23 + def correct_opts?; end + + # source://pry//lib/pry/commands/ls/constants.rb#27 + def output_self; end + + private + + # source://pry//lib/pry/commands/ls/constants.rb#39 + def format(mod, constants); end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/ls/constants.rb#35 + def show_deprecated_constants?; end +end + +# source://pry//lib/pry/commands/ls/constants.rb#7 +Pry::Command::Ls::Constants::DEPRECATED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# source://pry//lib/pry/commands/ls.rb#6 +Pry::Command::Ls::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://pry//lib/pry/commands/ls/formatter.rb#6 +class Pry::Command::Ls::Formatter + # @return [Formatter] a new instance of Formatter + # + # source://pry//lib/pry/commands/ls/formatter.rb#10 + def initialize(pry_instance); end + + # Sets the attribute grep + # + # @param value the value to set the attribute grep to. + # + # source://pry//lib/pry/commands/ls/formatter.rb#7 + def grep=(_arg0); end + + # Returns the value of attribute pry_instance. + # + # source://pry//lib/pry/commands/ls/formatter.rb#8 + def pry_instance; end + + # source://pry//lib/pry/commands/ls/formatter.rb#16 + def write_out; end + + private + + # source://pry//lib/pry/commands/ls/formatter.rb#24 + def color(type, str); end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/ls/formatter.rb#41 + def correct_opts?; end + + # source://pry//lib/pry/commands/ls/formatter.rb#37 + def format_value(value); end + + # source://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. + # + # source://pry//lib/pry/commands/ls/formatter.rb#30 + def output_section(heading, body); end + + # @raise [NotImplementedError] + # + # source://pry//lib/pry/commands/ls/formatter.rb#45 + def output_self; end +end + +# source://pry//lib/pry/commands/ls/globals.rb#6 +class Pry::Command::Ls::Globals < ::Pry::Command::Ls::Formatter + # @return [Globals] a new instance of Globals + # + # source://pry//lib/pry/commands/ls/globals.rb#24 + def initialize(opts, pry_instance); end + + # source://pry//lib/pry/commands/ls/globals.rb#29 + def output_self; end + + private + + # source://pry//lib/pry/commands/ls/globals.rb#36 + def format(globals); end +end + +# Taken from "puts global_variables.inspect". +# +# source://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. +# +# source://pry//lib/pry/commands/ls/globals.rb#19 +Pry::Command::Ls::Globals::PSEUDO_GLOBALS = T.let(T.unsafe(nil), Array) + +# source://pry//lib/pry/commands/ls/grep.rb#6 +class Pry::Command::Ls::Grep + # @return [Grep] a new instance of Grep + # + # source://pry//lib/pry/commands/ls/grep.rb#7 + def initialize(grep_regexp); end + + # source://pry//lib/pry/commands/ls/grep.rb#11 + def regexp; end +end + +# source://pry//lib/pry/commands/ls/instance_vars.rb#6 +class Pry::Command::Ls::InstanceVars < ::Pry::Command::Ls::Formatter + include ::Pry::Command::Ls::Interrogatable + + # @return [InstanceVars] a new instance of InstanceVars + # + # source://pry//lib/pry/commands/ls/instance_vars.rb#9 + def initialize(interrogatee, no_user_opts, opts, pry_instance); end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/ls/instance_vars.rb#16 + def correct_opts?; end + + # source://pry//lib/pry/commands/ls/instance_vars.rb#20 + def output_self; end + + private + + # source://pry//lib/pry/commands/ls/instance_vars.rb#34 + def format(type, vars); end +end + +# source://pry//lib/pry/commands/ls/interrogatable.rb#6 +module Pry::Command::Ls::Interrogatable + private + + # source://pry//lib/pry/commands/ls/interrogatable.rb#13 + def interrogatee_mod; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/ls/interrogatable.rb#9 + def interrogating_a_module?; end +end + +# source://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. + # + # source://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. + # + # source://pry//lib/pry/commands/ls/jruby_hacks.rb#21 + def trim_jruby_aliases(methods); end +end + +# source://pry//lib/pry/commands/ls/local_names.rb#6 +class Pry::Command::Ls::LocalNames < ::Pry::Command::Ls::Formatter + # @return [LocalNames] a new instance of LocalNames + # + # source://pry//lib/pry/commands/ls/local_names.rb#7 + def initialize(no_user_opts, args, pry_instance); end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/ls/local_names.rb#14 + def correct_opts?; end + + # source://pry//lib/pry/commands/ls/local_names.rb#18 + def output_self; end + + private + + # source://pry//lib/pry/commands/ls/local_names.rb#25 + def format(locals); end +end + +# source://pry//lib/pry/commands/ls/local_vars.rb#6 +class Pry::Command::Ls::LocalVars < ::Pry::Command::Ls::Formatter + # @return [LocalVars] a new instance of LocalVars + # + # source://pry//lib/pry/commands/ls/local_vars.rb#7 + def initialize(opts, pry_instance); end + + # source://pry//lib/pry/commands/ls/local_vars.rb#13 + def output_self; end + + private + + # source://pry//lib/pry/commands/ls/local_vars.rb#34 + def colorized_assignment_style(lhs, rhs, desired_width = T.unsafe(nil)); end + + # source://pry//lib/pry/commands/ls/local_vars.rb#25 + def format(name_value_pairs); end +end + +# source://pry//lib/pry/commands/ls/ls_entity.rb#6 +class Pry::Command::Ls::LsEntity + # @return [LsEntity] a new instance of LsEntity + # + # source://pry//lib/pry/commands/ls/ls_entity.rb#9 + def initialize(opts); end + + # source://pry//lib/pry/commands/ls/ls_entity.rb#18 + def entities_table; end + + # Returns the value of attribute pry_instance. + # + # source://pry//lib/pry/commands/ls/ls_entity.rb#7 + def pry_instance; end + + private + + # source://pry//lib/pry/commands/ls/ls_entity.rb#32 + def constants; end + + # source://pry//lib/pry/commands/ls/ls_entity.rb#56 + def entities; end + + # source://pry//lib/pry/commands/ls/ls_entity.rb#28 + def globals; end + + # source://pry//lib/pry/commands/ls/ls_entity.rb#24 + def grep(entity); end + + # source://pry//lib/pry/commands/ls/ls_entity.rb#44 + def instance_vars; end + + # source://pry//lib/pry/commands/ls/ls_entity.rb#48 + def local_names; end + + # source://pry//lib/pry/commands/ls/ls_entity.rb#52 + def local_vars; end + + # source://pry//lib/pry/commands/ls/ls_entity.rb#36 + def methods; end + + # source://pry//lib/pry/commands/ls/ls_entity.rb#40 + def self_methods; end +end + +# source://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 + + # @return [Methods] a new instance of Methods + # + # source://pry//lib/pry/commands/ls/methods.rb#10 + def initialize(interrogatee, no_user_opts, opts, pry_instance); end + + # source://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. + # + # source://pry//lib/pry/commands/ls/methods.rb#41 + def below_ceiling; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/ls/methods.rb#35 + def correct_opts?; end +end + +# source://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. + # + # source://pry//lib/pry/commands/ls/methods_helper.rb#12 + def all_methods(instance_methods = T.unsafe(nil)); end + + # source://pry//lib/pry/commands/ls/methods_helper.rb#34 + def format(methods); end + + # source://pry//lib/pry/commands/ls/methods_helper.rb#26 + def resolution_order; end +end + +# source://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 + + # @return [SelfMethods] a new instance of SelfMethods + # + # source://pry//lib/pry/commands/ls/self_methods.rb#10 + def initialize(interrogatee, no_user_opts, opts, pry_instance); end + + # source://pry//lib/pry/commands/ls/self_methods.rb#18 + def output_self; end + + private + + # @return [Boolean] + # + # source://pry//lib/pry/commands/ls/self_methods.rb#28 + def correct_opts?; end +end + +# source://pry//lib/pry/commands/nesting.rb#5 +class Pry::Command::Nesting < ::Pry::ClassCommand + # source://pry//lib/pry/commands/nesting.rb#14 + def process; end +end + +# source://pry//lib/pry/commands/play.rb#5 +class Pry::Command::Play < ::Pry::ClassCommand + # source://pry//lib/pry/commands/play.rb#74 + def code_object; end + + # source://pry//lib/pry/commands/play.rb#82 + def content; end + + # source://pry//lib/pry/commands/play.rb#60 + def content_after_options; end + + # source://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` + # + # source://pry//lib/pry/commands/play.rb#92 + def default_file; end + + # source://pry//lib/pry/commands/play.rb#102 + def file_content; end + + # source://pry//lib/pry/commands/play.rb#29 + def options(opt); end + + # source://pry//lib/pry/commands/play.rb#48 + def perform_play; end + + # source://pry//lib/pry/commands/play.rb#41 + def process; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/play.rb#78 + def should_use_default_file?; end + + # source://pry//lib/pry/commands/play.rb#53 + def show_input; end +end + +# source://pry//lib/pry/commands/pry_backtrace.rb#5 +class Pry::Command::PryBacktrace < ::Pry::ClassCommand + # source://pry//lib/pry/commands/pry_backtrace.rb#22 + def process; end +end + +# source://pry//lib/pry/commands/raise_up.rb#6 +class Pry::Command::RaiseUp < ::Pry::ClassCommand + # source://pry//lib/pry/commands/raise_up.rb#27 + def process; end +end + +# source://pry//lib/pry/commands/reload_code.rb#5 +class Pry::Command::ReloadCode < ::Pry::ClassCommand + # source://pry//lib/pry/commands/reload_code.rb#20 + def process; end + + private + + # @raise [CommandError] + # + # source://pry//lib/pry/commands/reload_code.rb#58 + def check_for_reloadability(code_object, identifier); end + + # source://pry//lib/pry/commands/reload_code.rb#32 + def current_file; end + + # source://pry//lib/pry/commands/reload_code.rb#42 + def reload_current_file; end + + # source://pry//lib/pry/commands/reload_code.rb#51 + def reload_object(identifier); end +end + +# source://pry//lib/pry/commands/reset.rb#5 +class Pry::Command::Reset < ::Pry::ClassCommand + # source://pry//lib/pry/commands/reset.rb#14 + def process; end +end + +# source://pry//lib/pry/commands/ri.rb#7 +class Pry::Command::Ri < ::Pry::ClassCommand + # source://pry//lib/pry/commands/ri.rb#21 + def process(spec); end +end + +# source://pry//lib/pry/commands/save_file.rb#5 +class Pry::Command::SaveFile < ::Pry::ClassCommand + # source://pry//lib/pry/commands/save_file.rb#50 + def display_content; end + + # source://pry//lib/pry/commands/save_file.rb#39 + def file_name; end + + # source://pry//lib/pry/commands/save_file.rb#56 + def mode; end + + # source://pry//lib/pry/commands/save_file.rb#21 + def options(opt); end + + # @raise [CommandError] + # + # source://pry//lib/pry/commands/save_file.rb#28 + def process; end + + # source://pry//lib/pry/commands/save_file.rb#43 + def save_file; end +end + +# source://pry//lib/pry/commands/shell_command.rb#5 +class Pry::Command::ShellCommand < ::Pry::ClassCommand + # source://pry//lib/pry/commands/shell_command.rb#21 + def process(cmd); end + + private + + # source://pry//lib/pry/commands/shell_command.rb#50 + def cd_path_env; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/shell_command.rb#54 + def cd_path_exists?; end + + # source://pry//lib/pry/commands/shell_command.rb#36 + def parse_destination(dest); end + + # source://pry//lib/pry/commands/shell_command.rb#58 + def path_from_cd_path(dest); end + + # source://pry//lib/pry/commands/shell_command.rb#43 + def process_cd(dest); end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/shell_command.rb#68 + def special_case_path?(dest); end +end + +# source://pry//lib/pry/commands/shell_mode.rb#5 +class Pry::Command::ShellMode < ::Pry::ClassCommand + # source://pry//lib/pry/commands/shell_mode.rb#14 + def process; end +end + +# source://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. + # + # source://pry//lib/pry/commands/show_doc.rb#35 + 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) + # + # source://pry//lib/pry/commands/show_doc.rb#64 + def docs_for(code_object); end + + # Which sections to include in the 'header', can toggle: :owner, + # :signature and visibility. + # + # source://pry//lib/pry/commands/show_doc.rb#76 + def header_options; end + + # source://pry//lib/pry/commands/show_doc.rb#24 + def process; end + + # process the markup (if necessary) and apply colors + # + # source://pry//lib/pry/commands/show_doc.rb#44 + 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 + # + # source://pry//lib/pry/commands/show_doc.rb#83 + def start_line_for(code_object); end +end + +# source://pry//lib/pry/commands/show_info.rb#5 +class Pry::Command::ShowInfo < ::Pry::ClassCommand + extend ::Pry::Helpers::BaseHelpers + + # @return [ShowInfo] a new instance of ShowInfo + # + # source://pry//lib/pry/commands/show_info.rb#10 + def initialize(*_arg0); end + + # source://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. + # + # @raise [CommandError] + # @return [Pry::WrappedModule, Pry::Method, Pry::Command] + # + # source://pry//lib/pry/commands/show_info.rb#61 + def code_object_with_accessible_source(code_object); end + + # source://pry//lib/pry/commands/show_info.rb#213 + def complete(input); end + + # source://pry//lib/pry/commands/show_info.rb#77 + def content_and_header_for_code_object(code_object); end + + # source://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 + # + # source://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... + # + # source://pry//lib/pry/commands/show_info.rb#106 + def header(code_object); end + + # source://pry//lib/pry/commands/show_info.rb#173 + def header_options; end + + # source://pry//lib/pry/commands/show_info.rb#142 + def method_header(code_object, line_num); end + + # source://pry//lib/pry/commands/show_info.rb#165 + def method_sections(code_object); end + + # source://pry//lib/pry/commands/show_info.rb#151 + def module_header(code_object, line_num); end + + # source://pry//lib/pry/commands/show_info.rb#100 + def no_definition_message; end + + # source://pry//lib/pry/commands/show_info.rb#185 + def obj_name; end + + # source://pry//lib/pry/commands/show_info.rb#16 + def options(opt); end + + # @raise [CommandError] + # + # source://pry//lib/pry/commands/show_info.rb#26 + def process; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/show_info.rb#181 + def show_all_modules?(code_object); end + + # source://pry//lib/pry/commands/show_info.rb#193 + def start_line_for(code_object); end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/show_info.rb#189 + def use_line_numbers?; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/show_info.rb#73 + def valid_superclass?(code_object); end +end + +# source://pry//lib/pry/commands/show_input.rb#5 +class Pry::Command::ShowInput < ::Pry::ClassCommand + # source://pry//lib/pry/commands/show_input.rb#15 + def process; end +end + +# source://pry//lib/pry/commands/show_source.rb#5 +class Pry::Command::ShowSource < ::Pry::Command::ShowInfo + include ::Pry::Helpers::DocumentationHelpers + + # The source for code_object prepared for display. + # + # source://pry//lib/pry/commands/show_source.rb#48 + 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) + # + # source://pry//lib/pry/commands/show_source.rb#86 + def docs_for(code_object); end + + # Which sections to include in the 'header', can toggle: :owner, + # :signature and visibility. + # + # source://pry//lib/pry/commands/show_source.rb#98 + def header_options; end + + # source://pry//lib/pry/commands/show_source.rb#31 + def options(opt); end + + # source://pry//lib/pry/commands/show_source.rb#38 + def process; end + + # process the markup (if necessary) and apply colors + # + # source://pry//lib/pry/commands/show_source.rb#66 + 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 + # + # source://pry//lib/pry/commands/show_source.rb#105 + def start_line_for(code_object); end +end + +# source://pry//lib/pry/commands/stat.rb#5 +class Pry::Command::Stat < ::Pry::ClassCommand + # source://pry//lib/pry/commands/stat.rb#19 + def options(opt); end + + # source://pry//lib/pry/commands/stat.rb#23 + def process; end +end + +# source://pry//lib/pry/commands/switch_to.rb#5 +class Pry::Command::SwitchTo < ::Pry::ClassCommand + # source://pry//lib/pry/commands/switch_to.rb#14 + def process(selection); end +end + +# source://pry//lib/pry/commands/toggle_color.rb#5 +class Pry::Command::ToggleColor < ::Pry::ClassCommand + # source://pry//lib/pry/commands/toggle_color.rb#21 + def color_toggle; end + + # source://pry//lib/pry/commands/toggle_color.rb#16 + def process; end +end + +# represents a void return value for a command +# +# source://pry//lib/pry/command.rb#20 +Pry::Command::VOID_VALUE = T.let(T.unsafe(nil), Object) + +# source://pry//lib/pry/commands/pry_version.rb#5 +class Pry::Command::Version < ::Pry::ClassCommand + # source://pry//lib/pry/commands/pry_version.rb#14 + def process; end +end + +# source://pry//lib/pry/commands/watch_expression.rb#5 +class Pry::Command::WatchExpression < ::Pry::ClassCommand + # source://pry//lib/pry/commands/watch_expression.rb#31 + def options(opt); end + + # source://pry//lib/pry/commands/watch_expression.rb#42 + def process; end + + private + + # TODO: fix arguments. + # https://github.com/pry/pry/commit/b031df2f2f5850ee6e9018f33d35f3485a9b0423 + # + # source://pry//lib/pry/commands/watch_expression.rb#93 + def add_expression(_arguments); end + + # source://pry//lib/pry/commands/watch_expression.rb#98 + def add_hook; end + + # source://pry//lib/pry/commands/watch_expression.rb#59 + def delete(index); end + + # source://pry//lib/pry/commands/watch_expression.rb#84 + def eval_and_print_changed(output); end + + # source://pry//lib/pry/commands/watch_expression.rb#55 + def expressions; end + + # source://pry//lib/pry/commands/watch_expression.rb#69 + def list; end +end + +# source://pry//lib/pry/commands/watch_expression/expression.rb#6 +class Pry::Command::WatchExpression::Expression + # @return [Expression] a new instance of Expression + # + # source://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 represenation to detect differences + # as this avoids problems with dup (causes too many differences) and == + # (causes too few) + # + # @return [Boolean] + # + # source://pry//lib/pry/commands/watch_expression/expression.rb#29 + def changed?; end + + # source://pry//lib/pry/commands/watch_expression/expression.rb#15 + def eval!; end + + # Returns the value of attribute previous_value. + # + # source://pry//lib/pry/commands/watch_expression/expression.rb#7 + def previous_value; end + + # Returns the value of attribute pry_instance. + # + # source://pry//lib/pry/commands/watch_expression/expression.rb#7 + def pry_instance; end + + # Returns the value of attribute source. + # + # source://pry//lib/pry/commands/watch_expression/expression.rb#7 + def source; end + + # Returns the value of attribute target. + # + # source://pry//lib/pry/commands/watch_expression/expression.rb#7 + def target; end + + # source://pry//lib/pry/commands/watch_expression/expression.rb#20 + def to_s; end + + # Returns the value of attribute value. + # + # source://pry//lib/pry/commands/watch_expression/expression.rb#7 + def value; end + + private + + # source://pry//lib/pry/commands/watch_expression/expression.rb#35 + def target_eval(target, source); end +end + +# source://pry//lib/pry/commands/whereami.rb#7 +class Pry::Command::Whereami < ::Pry::ClassCommand + # @return [Whereami] a new instance of Whereami + # + # source://pry//lib/pry/commands/whereami.rb#8 + def initialize(*_arg0); end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/whereami.rb#83 + def bad_option_combination?; end + + # source://pry//lib/pry/commands/whereami.rb#63 + def code; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/whereami.rb#77 + def code?; end + + # source://pry//lib/pry/commands/whereami.rb#88 + def location; end + + # source://pry//lib/pry/commands/whereami.rb#55 + def options(opt); end + + # source://pry//lib/pry/commands/whereami.rb#92 + def process; end + + # source://pry//lib/pry/commands/whereami.rb#44 + def setup; end + + private + + # source://pry//lib/pry/commands/whereami.rb#171 + def class_code; end + + # source://pry//lib/pry/commands/whereami.rb#152 + def code_window; end + + # source://pry//lib/pry/commands/whereami.rb#144 + def default_code; end + + # source://pry//lib/pry/commands/whereami.rb#185 + def expand_path(filename); end + + # source://pry//lib/pry/commands/whereami.rb#132 + def handle_internal_binding; end + + # source://pry//lib/pry/commands/whereami.rb#124 + def marker; end + + # source://pry//lib/pry/commands/whereami.rb#156 + def method_code; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/whereami.rb#116 + def nothing_to_do?; end + + # @return [Boolean] + # + # source://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] + # + # source://pry//lib/pry/commands/whereami.rb#165 + def target_class; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/whereami.rb#128 + def top_level?; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/whereami.rb#120 + def use_line_numbers?; end + + # @return [Boolean] + # + # source://pry//lib/pry/commands/whereami.rb#180 + def valid_method?; end + + # source://pry//lib/pry/commands/whereami.rb#192 + def window_size; end + + class << self + # Returns the value of attribute method_size_cutoff. + # + # source://pry//lib/pry/commands/whereami.rb#15 + def method_size_cutoff; end + + # Sets the attribute method_size_cutoff + # + # @param value the value to set the attribute method_size_cutoff to. + # + # source://pry//lib/pry/commands/whereami.rb#15 + def method_size_cutoff=(_arg0); end + end +end + +# source://pry//lib/pry/commands/wtf.rb#5 +class Pry::Command::Wtf < ::Pry::ClassCommand + # source://pry//lib/pry/commands/wtf.rb#27 + def options(opt); end + + # source://pry//lib/pry/commands/wtf.rb#32 + def process; end + + private + + # source://pry//lib/pry/commands/wtf.rb#64 + def format_backtrace(backtrace); end + + # source://pry//lib/pry/commands/wtf.rb#60 + def format_header(title, exception); end + + # source://pry//lib/pry/commands/wtf.rb#83 + def read_line(file, line); end + + # source://pry//lib/pry/commands/wtf.rb#76 + def trim_backtrace(backtrace); end + + # source://pry//lib/pry/commands/wtf.rb#48 + def unwind_exceptions; end +end + +# source://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. +# +# source://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. +# +# source://pry//lib/pry/command_set.rb#12 +class Pry::CommandSet + include ::Enumerable + include ::Pry::Helpers::BaseHelpers + + # @param imported_sets [Array] Sets which will be imported automatically + # @return [CommandSet] a new instance of CommandSet + # @yield Optional block run to define commands + # + # source://pry//lib/pry/command_set.rb#20 + def initialize(*imported_sets, &block); end + + # Find a command that matches the given line + # + # @param pattern [String] The line that might be a command invocation + # @return [Pry::Command, nil] + # + # source://pry//lib/pry/command_set.rb#275 + def [](pattern); end + + # Re-assign the command found at _pattern_ with _command_. + # + # @example + # Pry.config.commands["help"] = MyHelpCommand + # @param pattern [Regexp, String] The command to add or replace(found at _pattern_). + # @param command [Pry::Command] The command to add. + # @return [Pry::Command] Returns the new command (matched with "pattern".) + # + # source://pry//lib/pry/command_set.rb#298 + def []=(pattern, command); end + + # Add a command to set. + # + # @param command [Command] a subclass of Pry::Command. + # + # source://pry//lib/pry/command_set.rb#324 + def add_command(command); end + + # Aliases a command + # + # @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" + # @param match [String, Regex] The match of the alias (can be a regex). + # @param action [String] The action to be performed (typically + # another command). + # @param options [Hash] 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` + # + # source://pry//lib/pry/command_set.rb#190 + def alias_command(match, action, options = T.unsafe(nil)); end + + # Defines a new Pry command. + # + # @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 + # @option options + # @option options + # @option options + # @option options + # @option options + # @param match [String, Regexp] The start of invocations of this command. + # @param description [String] A description of the command. + # @param options [Hash] The optional configuration parameters. + # @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. + # + # source://pry//lib/pry/command_set.rb#78 + def block_command(match, description = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Defines a new Pry command. + # + # @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 + # @option options + # @option options + # @option options + # @option options + # @option options + # @param match [String, Regexp] The start of invocations of this command. + # @param description [String] A description of the command. + # @param options [Hash] The optional configuration parameters. + # @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. + # + # source://pry//lib/pry/command_set.rb#78 + def command(match, description = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Generate completions for the user's search. + # + # @param search [String] The line to search for + # @param context [Hash] The context to create the command with + # @return [Array] + # + # source://pry//lib/pry/command_set.rb#365 + def complete(search, context = T.unsafe(nil)); end + + # Defines a new Pry command class. + # + # @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 + # @param match [String, Regexp] The start of invocations of this command. + # @param description [String] A description of the command. + # @param options [Hash] The optional configuration parameters, see {#command} + # @yield The class body's definition. + # + # source://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 searches [Array] the matches or listings of the commands + # to remove + # + # source://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. + # + # @example Setting + # MyCommands = Pry::CommandSet.new do + # desc "help", "help description" + # end + # @example Getting + # Pry.config.commands.desc "amend-line" + # @param search [String, Regexp] The command match. + # @param description [String?] (nil) The command description. + # + # source://pry//lib/pry/command_set.rb#253 + def desc(search, description = T.unsafe(nil)); end + + # source://pry//lib/pry/command_set.rb#131 + def each(&block); end + + # Find a command that matches the given line + # + # @param pattern [String] The line that might be a command invocation + # @return [Pry::Command, nil] + # + # source://pry//lib/pry/command_set.rb#275 + def find_command(pattern); end + + # @param match_or_listing [String, Regexp] The match or listing of a command. + # of the command to retrieve. + # @return [Command] The command object matched. + # + # source://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 search [String] The user's search. + # @return [Pry::Command?] + # + # source://pry//lib/pry/command_set.rb#331 + def find_command_for_help(search); end + + # Returns the value of attribute helper_module. + # + # source://pry//lib/pry/command_set.rb#15 + def helper_module; end + + # Imports all the commands from one or more sets. + # + # @param sets [Array] Command sets, all of the commands of which + # will be imported. + # @return [Pry::CommandSet] Returns the reciever (a command set). + # + # source://pry//lib/pry/command_set.rb#149 + def import(*sets); end + + # Imports some commands from a set + # + # @param set [CommandSet] Set to import commands from + # @param matches [Array] Commands to import + # @return [Pry::CommandSet] Returns the reciever (a command set). + # + # source://pry//lib/pry/command_set.rb#161 + def import_from(set, *matches); end + + # @return [Array] The list of commands provided by the command set. + # + # source://pry//lib/pry/command_set.rb#262 + def keys; end + + # @return [Array] The list of commands provided by the command set. + # + # source://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 val [String] The line to execute + # @param context [Hash] The context to execute the commands with + # @return [CommandSet::Result] + # + # source://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. + # + # @example Renaming the `ls` command and changing its description. + # Pry.config.commands.rename "dir", "ls", :description => "DOS friendly ls" + # @param new_match [String, Regexp] The new match for the command. + # @param search [String, Regexp] The command's current match or listing. + # @param options [Hash] The optional configuration parameters, + # accepts the same as the `command` method, but also allows the + # command description to be passed this way too. + # + # source://pry//lib/pry/command_set.rb#227 + def rename_command(new_match, search, options = T.unsafe(nil)); end + + # source://pry//lib/pry/command_set.rb#267 + def to_h; end + + # source://pry//lib/pry/command_set.rb#267 + def to_hash; end + + # Is the given line a command invocation? + # + # @param val [String] + # @return [Boolean] + # + # source://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. + # + # @example + # helpers do + # def hello + # puts "Hello!" + # end + # + # include OtherModule + # end + # @yield A block defining helper methods + # + # source://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. +# +# @api private +# @since v0.13.0 +# +# source://pry//lib/pry/command_state.rb#14 +class Pry::CommandState + # @api private + # @return [CommandState] a new instance of CommandState + # @since v0.13.0 + # + # source://pry//lib/pry/command_state.rb#19 + def initialize; end + + # @api private + # @since v0.13.0 + # + # source://pry//lib/pry/command_state.rb#27 + def reset(command_name); end + + # @api private + # @since v0.13.0 + # + # source://pry//lib/pry/command_state.rb#23 + def state_for(command_name); end + + class << self + # @api private + # @since v0.13.0 + # + # source://pry//lib/pry/command_state.rb#15 + def default; end + end +end + +# source://pry//lib/pry.rb#35 +Pry::Commands = T.let(T.unsafe(nil), Pry::CommandSet) + +# @api private +# +# source://pry//lib/pry/config/attributable.rb#4 +class Pry::Config + extend ::Pry::Config::Attributable + + # @api private + # @return [Config] a new instance of Config + # + # source://pry//lib/pry/config.rb#154 + def initialize; end + + # @api private + # + # source://pry//lib/pry/config.rb#234 + def [](attr); end + + # @api private + # + # source://pry//lib/pry/config.rb#230 + def []=(attr, value); end + + # @api private + # @return [Boolean] + # + # source://pry//lib/pry/config/attributable.rb#13 + def auto_indent; end + + # source://pry//lib/pry/config/attributable.rb#18 + def auto_indent=(_arg0); end + + # @api private + # @return [Boolean] whether or not display a warning when a command name + # collides with a method/local in the current context. + # + # source://pry//lib/pry/config/attributable.rb#13 + def collision_warning; end + + # source://pry//lib/pry/config/attributable.rb#18 + def collision_warning=(_arg0); end + + # @api private + # @return [Boolean] + # + # source://pry//lib/pry/config/attributable.rb#13 + def color; end + + # source://pry//lib/pry/config/attributable.rb#18 + def color=(_arg0); end + + # @api private + # @return [Proc] + # + # source://pry//lib/pry/config/attributable.rb#13 + def command_completions; end + + # source://pry//lib/pry/config/attributable.rb#18 + def command_completions=(_arg0); end + + # A string that must precede all commands. For example, if is is + # set to "%", the "cd" command must be invoked as "%cd"). + # + # @api private + # @return [String] + # + # source://pry//lib/pry/config/attributable.rb#13 + def command_prefix; end + + # source://pry//lib/pry/config/attributable.rb#18 + def command_prefix=(_arg0); end + + # @api private + # @return [Pry::CommandSet] + # + # source://pry//lib/pry/config/attributable.rb#13 + def commands; end + + # source://pry//lib/pry/config/attributable.rb#18 + def commands=(_arg0); end + + # @api private + # @return [#build_completion_proc] a completer to use + # + # source://pry//lib/pry/config/attributable.rb#13 + def completer; end + + # source://pry//lib/pry/config/attributable.rb#18 + def completer=(_arg0); end + + # @api private + # + # source://pry//lib/pry/config.rb#259 + def control_d_handler; end + + # @api private + # + # source://pry//lib/pry/config.rb#260 + def control_d_handler=(value); end + + # @api private + # @return [Boolean] + # + # source://pry//lib/pry/config/attributable.rb#13 + def correct_indent; end + + # source://pry//lib/pry/config/attributable.rb#18 + def correct_indent=(_arg0); end + + # @api private + # @return [Integer] The number of lines of context to show before and after + # exceptions + # + # source://pry//lib/pry/config/attributable.rb#13 + def default_window_size; end + + # source://pry//lib/pry/config/attributable.rb#18 + def default_window_size=(_arg0); end + + # @api private + # @return [Boolean] whether to disable edit-method's auto-reloading behavior + # + # source://pry//lib/pry/config/attributable.rb#13 + def disable_auto_reload; end + + # source://pry//lib/pry/config/attributable.rb#18 + def disable_auto_reload=(_arg0); end + + # If it is a String, then that String is used as the shell + # command to invoke the editor. + # + # If it responds to #call is callable then `file`, `line`, and `reloading` + # are passed to it. `reloading` indicates whether Pry will be reloading code + # after the shell command returns. All parameters are optional. + # + # @api private + # @return [String, #call] + # + # source://pry//lib/pry/config/attributable.rb#13 + def editor; end + + # source://pry//lib/pry/config/attributable.rb#18 + def editor=(_arg0); end + + # @api private + # @return [Proc] the printer for exceptions + # + # source://pry//lib/pry/config/attributable.rb#13 + def exception_handler; end + + # source://pry//lib/pry/config/attributable.rb#18 + def exception_handler=(_arg0); end + + # @api private + # @deprecated + # @return [Array] Exception that Pry shouldn't rescue + # + # source://pry//lib/pry/config/attributable.rb#13 + def exception_whitelist; end + + # source://pry//lib/pry/config/attributable.rb#18 + def exception_whitelist=(_arg0); end + + # @api private + # @return [String] a line of code to execute in context before the session + # starts + # + # source://pry//lib/pry/config/attributable.rb#13 + def exec_string; end + + # source://pry//lib/pry/config/attributable.rb#18 + def exec_string=(_arg0); end + + # @api private + # @return [Hash{Symbol=>Proc}] + # + # source://pry//lib/pry/config/attributable.rb#13 + def extra_sticky_locals; end + + # source://pry//lib/pry/config/attributable.rb#18 + def extra_sticky_locals=(_arg0); end + + # @api private + # @return [Proc] + # + # source://pry//lib/pry/config/attributable.rb#13 + def file_completions; end + + # source://pry//lib/pry/config/attributable.rb#18 + def file_completions=(_arg0); end + + # @api private + # @return [Pry::History] + # + # source://pry//lib/pry/config/attributable.rb#13 + def history; end + + # source://pry//lib/pry/config/attributable.rb#18 + def history=(_arg0); end + + # @api private + # @return [String] + # + # source://pry//lib/pry/config/attributable.rb#13 + def history_file; end + + # source://pry//lib/pry/config/attributable.rb#18 + def history_file=(_arg0); end + + # @api private + # @return [Array] + # + # source://pry//lib/pry/config/attributable.rb#13 + def history_ignorelist; end + + # source://pry//lib/pry/config/attributable.rb#18 + def history_ignorelist=(_arg0); end + + # @api private + # @return [Boolean] + # + # source://pry//lib/pry/config/attributable.rb#13 + def history_load; end + + # source://pry//lib/pry/config/attributable.rb#18 + def history_load=(_arg0); end + + # @api private + # @return [Boolean] + # + # source://pry//lib/pry/config/attributable.rb#13 + def history_save; end + + # source://pry//lib/pry/config/attributable.rb#18 + def history_save=(_arg0); end + + # @api private + # @return [Pry::Hooks] + # + # source://pry//lib/pry/config/attributable.rb#13 + def hooks; end + + # source://pry//lib/pry/config/attributable.rb#18 + def hooks=(_arg0); end + + # @api private + # @return [IO, #readline] he object from which Pry retrieves its lines of + # input + # + # source://pry//lib/pry/config/attributable.rb#13 + def input; end + + # source://pry//lib/pry/config/attributable.rb#18 + def input=(_arg0); end + + # @api private + # @return [Hash] + # + # source://pry//lib/pry/config/attributable.rb#13 + def ls; end + + # source://pry//lib/pry/config/attributable.rb#18 + def ls=(_arg0); end + + # @api private + # @return [Integer] how many input/output lines to keep in memory + # + # source://pry//lib/pry/config/attributable.rb#13 + def memory_size; end + + # source://pry//lib/pry/config/attributable.rb#18 + def memory_size=(_arg0); end + + # @api private + # + # source://pry//lib/pry/config.rb#226 + def merge(config_hash); end + + # @api private + # + # source://pry//lib/pry/config.rb#221 + def merge!(config_hash); end + + # @api private + # + # source://pry//lib/pry/config.rb#239 + def method_missing(method_name, *args, &_block); end + + # @api private + # @return [IO, #puts] where Pry should output results provided by {input} + # + # source://pry//lib/pry/config/attributable.rb#13 + def output; end + + # source://pry//lib/pry/config/attributable.rb#18 + def output=(_arg0); end + + # @api private + # @return [String] + # + # source://pry//lib/pry/config/attributable.rb#13 + def output_prefix; end + + # source://pry//lib/pry/config/attributable.rb#18 + def output_prefix=(_arg0); end + + # @api private + # @return [Boolean] + # + # source://pry//lib/pry/config/attributable.rb#13 + def pager; end + + # source://pry//lib/pry/config/attributable.rb#18 + def pager=(_arg0); end + + # @api private + # @return [Proc] the printer for Ruby expressions (not commands) + # + # source://pry//lib/pry/config/attributable.rb#13 + def print; end + + # source://pry//lib/pry/config/attributable.rb#18 + def print=(_arg0); end + + # @api private + # @return [Pry::Prompt] + # + # source://pry//lib/pry/config/attributable.rb#13 + def prompt; end + + # source://pry//lib/pry/config/attributable.rb#18 + def prompt=(_arg0); end + + # @api private + # @return [String] The display name that is part of the prompt + # + # source://pry//lib/pry/config/attributable.rb#13 + def prompt_name; end + + # source://pry//lib/pry/config/attributable.rb#18 + def prompt_name=(_arg0); end + + # @api private + # @return [Array] the list of objects that are known to have a + # 1-line #inspect output suitable for prompt + # + # source://pry//lib/pry/config/attributable.rb#13 + def prompt_safe_contexts; end + + # source://pry//lib/pry/config/attributable.rb#18 + def prompt_safe_contexts=(_arg0); end + + # @api private + # @return [Boolean] suppresses whereami output on `binding.pry` + # + # source://pry//lib/pry/config/attributable.rb#13 + def quiet; end + + # source://pry//lib/pry/config/attributable.rb#18 + def quiet=(_arg0); end + + # @api private + # @return [String] + # @since v0.13.0 + # + # source://pry//lib/pry/config/attributable.rb#13 + def rc_file; end + + # source://pry//lib/pry/config/attributable.rb#18 + def rc_file=(_arg0); end + + # @api private + # @return [Array] Ruby files to be required + # + # source://pry//lib/pry/config/attributable.rb#13 + def requires; end + + # source://pry//lib/pry/config/attributable.rb#18 + def requires=(_arg0); end + + # @api private + # @return [Boolean] whether the local ./.pryrc should be loaded + # + # source://pry//lib/pry/config/attributable.rb#13 + def should_load_local_rc; end + + # source://pry//lib/pry/config/attributable.rb#18 + def should_load_local_rc=(_arg0); end + + # @api private + # @return [Boolean] whether the global ~/.pryrc should be loaded + # + # source://pry//lib/pry/config/attributable.rb#13 + def should_load_rc; end + + # source://pry//lib/pry/config/attributable.rb#18 + def should_load_rc=(_arg0); end + + # @api private + # @return [Boolean] whether to load files specified with the -r flag + # + # source://pry//lib/pry/config/attributable.rb#13 + def should_load_requires; end + + # source://pry//lib/pry/config/attributable.rb#18 + def should_load_requires=(_arg0); end + + # Whether Pry should trap SIGINT and cause it to raise an Interrupt + # exception. This is only useful on JRuby, MRI does this for us. + # + # @api private + # @return [Boolean] + # + # source://pry//lib/pry/config/attributable.rb#13 + def should_trap_interrupts; end + + # source://pry//lib/pry/config/attributable.rb#18 + def should_trap_interrupts=(_arg0); end + + # @api private + # @return [Proc] The proc that runs system commands + # + # source://pry//lib/pry/config/attributable.rb#13 + def system; end + + # source://pry//lib/pry/config/attributable.rb#18 + def system=(_arg0); end + + # @api private + # @return [Array] Exception that Pry shouldn't rescue + # + # source://pry//lib/pry/config/attributable.rb#13 + def unrescued_exceptions; end + + # source://pry//lib/pry/config/attributable.rb#18 + def unrescued_exceptions=(_arg0); end + + # @api private + # @return [Boolean] displays a warning about experience improvement on + # Windows + # + # source://pry//lib/pry/config/attributable.rb#13 + def windows_console_warning; end + + # source://pry//lib/pry/config/attributable.rb#18 + def windows_console_warning=(_arg0); end + + private + + # @api private + # + # source://pry//lib/pry/config.rb#303 + def default_rc_file; end + + # @api private + # + # source://pry//lib/pry/config.rb#254 + def initialize_dup(other); end + + # @api private + # + # source://pry//lib/pry/config.rb#289 + def lazy_readline; end + + # @api private + # @return [Boolean] + # + # source://pry//lib/pry/config.rb#250 + 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). +# +# @api private +# @since v0.13.0 +# +# source://pry//lib/pry/config/attributable.rb#11 +module Pry::Config::Attributable + # @api private + # @since v0.13.0 + # + # source://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. +# +# @api private +# @example +# num = 19 +# value = Pry::Config::LazyValue.new { num += 1 } +# value.foo # => 20 +# value.foo # => 21 +# value.foo # => 22 +# @see Pry::Config::MemoizedValue +# @since v0.13.0 +# +# source://pry//lib/pry/config/lazy_value.rb#19 +class Pry::Config::LazyValue + # @api private + # @return [LazyValue] a new instance of LazyValue + # @since v0.13.0 + # + # source://pry//lib/pry/config/lazy_value.rb#20 + def initialize(&block); end + + # @api private + # @since v0.13.0 + # + # source://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. +# +# @api private +# @example +# num = 19 +# value = Pry::Config::MemoizedValue.new { num += 1 } +# value.call # => 20 +# value.call # => 20 +# value.call # => 20 +# @see Pry::Config::LazyValue +# @since v0.13.0 +# +# source://pry//lib/pry/config/memoized_value.rb#19 +class Pry::Config::MemoizedValue + # @api private + # @return [MemoizedValue] a new instance of MemoizedValue + # @since v0.13.0 + # + # source://pry//lib/pry/config/memoized_value.rb#20 + def initialize(&block); end + + # @api private + # @since v0.13.0 + # + # source://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. +# +# @api private +# @since v0.13.0 +# +# source://pry//lib/pry/config/value.rb#10 +class Pry::Config::Value + # @api private + # @return [Value] a new instance of Value + # @since v0.13.0 + # + # source://pry//lib/pry/config/value.rb#11 + def initialize(value); end + + # @api private + # @since v0.13.0 + # + # source://pry//lib/pry/config/value.rb#15 + def call; end +end + +# @api private +# @since v0.13.0 +# +# source://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 ..`. + # + # @api private + # @since v0.13.0 + # + # source://pry//lib/pry/control_d_handler.rb#12 + def default(pry_instance); end + end +end + +# source://pry//lib/pry/pry_instance.rb#59 +Pry::EMPTY_COMPLETIONS = T.let(T.unsafe(nil), Array) + +# source://pry//lib/pry/editor.rb#6 +class Pry::Editor + include ::Pry::Helpers::OptionsHelpers + include ::Pry::Helpers::CommandHelpers + + # @return [Editor] a new instance of Editor + # + # source://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. + # + # source://pry//lib/pry/editor.rb#60 + def build_editor_invocation_string(file, line, blocking); end + + # source://pry//lib/pry/editor.rb#31 + def edit_tempfile_with_content(initial_content, line = T.unsafe(nil)); end + + # source://pry//lib/pry/editor.rb#41 + def invoke_editor(file, line, blocking = T.unsafe(nil)); end + + # Returns the value of attribute pry_instance. + # + # source://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. + # + # source://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 + # + # source://pry//lib/pry/editor.rb#153 + def editor_name; end + + # Start the editor running, using the calculated invocation string + # + # source://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 :/ + # + # source://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 + # + # source://pry//lib/pry/editor.rb#115 + def start_line_syntax_for_editor(file_name, line_number); end + + class << self + # source://pry//lib/pry/editor.rb#7 + def default; end + end +end + +# Env is a helper module to work with environment variables. +# +# @api private +# @since v0.13.0 +# +# source://pry//lib/pry/env.rb#8 +module Pry::Env + class << self + # @api private + # @since v0.13.0 + # + # source://pry//lib/pry/env.rb#9 + def [](key); end + end +end + +# @api private +# @since v0.13.0 +# +# source://pry//lib/pry/exception_handler.rb#6 +module Pry::ExceptionHandler + class << self + # Will only show the first line of the backtrace. + # + # @api private + # @since v0.13.0 + # + # source://pry//lib/pry/exception_handler.rb#9 + def handle_exception(output, exception, _pry_instance); end + + private + + # @api private + # @since v0.13.0 + # + # source://pry//lib/pry/exception_handler.rb#37 + def cause_text(cause); end + + # @api private + # @since v0.13.0 + # + # source://pry//lib/pry/exception_handler.rb#32 + def exception_text(exception); end + + # @api private + # @since v0.13.0 + # + # source://pry//lib/pry/exception_handler.rb#19 + def standard_error_text_for(exception); end + end +end + +# source://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. + # + # source://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. +# +# source://pry//lib/pry/exceptions.rb#56 +module Pry::FrozenObjectException + class << self + # source://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 +# +# source://pry//lib/pry/pry_class.rb#11 +Pry::HAS_SAFE_LEVEL = T.let(T.unsafe(nil), FalseClass) + +# source://pry//lib/pry/helpers/base_helpers.rb#4 +module Pry::Helpers + class << self + # source://pry//lib/pry/helpers/table.rb#27 + def tablify(things, line_length, pry_instance = T.unsafe(nil)); end + + # source://pry//lib/pry/helpers/table.rb#5 + def tablify_or_one_line(heading, things, pry_instance = T.unsafe(nil)); end + + # source://pry//lib/pry/helpers/table.rb#16 + def tablify_to_screen_width(things, options, pry_instance = T.unsafe(nil)); end + end +end + +# source://pry//lib/pry/helpers/base_helpers.rb#5 +module Pry::Helpers::BaseHelpers + extend ::Pry::Helpers::BaseHelpers + + # source://pry//lib/pry/helpers/base_helpers.rb#43 + def colorize_code(code); end + + # source://pry//lib/pry/helpers/base_helpers.rb#27 + def find_command(name, set = T.unsafe(nil)); end + + # formatting + # + # source://pry//lib/pry/helpers/base_helpers.rb#54 + def heading(text); end + + # source://pry//lib/pry/helpers/base_helpers.rb#47 + def highlight(string, regexp, highlight_color = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://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. + # + # source://pry//lib/pry/helpers/base_helpers.rb#22 + def safe_send(obj, method, *args, &block); end + + # source://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. + # + # source://pry//lib/pry/helpers/base_helpers.rb#62 + def stagger_output(text, _out = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://pry//lib/pry/helpers/base_helpers.rb#38 + def use_ansi_codes?; end +end + +# source://pry//lib/pry/helpers/command_helpers.rb#7 +module Pry::Helpers::CommandHelpers + include ::Pry::Helpers::OptionsHelpers + extend ::Pry::Helpers::OptionsHelpers + extend ::Pry::Helpers::CommandHelpers + + # source://pry//lib/pry/helpers/command_helpers.rb#115 + def absolute_index_number(line_number, array_length); end + + # source://pry//lib/pry/helpers/command_helpers.rb#123 + def absolute_index_range(range_or_number, array_length); end + + # source://pry//lib/pry/helpers/command_helpers.rb#31 + def get_method_or_raise(method_name, context, opts = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://pry//lib/pry/helpers/command_helpers.rb#21 + def internal_binding?(context); end + + # source://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 + # + # source://pry//lib/pry/helpers/command_helpers.rb#102 + def one_index_range(range); end + + # source://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 content [String] The string. + # @param lines [Range, Integer] The line(s) to restrict it to. + # @return [String] The resulting string. + # + # source://pry//lib/pry/helpers/command_helpers.rb#92 + def restrict_to_lines(content, lines); end + + # source://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 + # + # source://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 dirty_text [String] The text from which to remove indentation + # @return [String] the text with indentation stripped + # + # source://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. +# +# source://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 comment [String] + # @return [String] + # + # source://pry//lib/pry/helpers/documentation_helpers.rb#67 + def get_comment_content(comment); end + + # source://pry//lib/pry/helpers/documentation_helpers.rb#51 + def process_comment_markup(comment); end + + # source://pry//lib/pry/helpers/documentation_helpers.rb#15 + def process_rdoc(comment); end + + # source://pry//lib/pry/helpers/documentation_helpers.rb#45 + def process_yardoc(comment); end + + # source://pry//lib/pry/helpers/documentation_helpers.rb#30 + def process_yardoc_tag(comment, tag); end + + # @param code [String] + # @return [String] + # + # source://pry//lib/pry/helpers/documentation_helpers.rb#57 + def strip_comments_from_c_code(code); end + + # @param text [String] + # @return [String] + # + # source://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 comment [String] + # @return [String] + # + # source://pry//lib/pry/helpers/documentation_helpers.rb#67 + def get_comment_content(comment); end + + # source://pry//lib/pry/helpers/documentation_helpers.rb#51 + def process_comment_markup(comment); end + + # source://pry//lib/pry/helpers/documentation_helpers.rb#15 + def process_rdoc(comment); end + + # source://pry//lib/pry/helpers/documentation_helpers.rb#45 + def process_yardoc(comment); end + + # source://pry//lib/pry/helpers/documentation_helpers.rb#30 + def process_yardoc_tag(comment, tag); end + + # @param code [String] + # @return [String] + # + # source://pry//lib/pry/helpers/documentation_helpers.rb#57 + def strip_comments_from_c_code(code); end + + # @param text [String] + # @return [String] + # + # source://pry//lib/pry/helpers/documentation_helpers.rb#79 + def strip_leading_whitespace(text); end + end +end + +# source://pry//lib/pry/helpers/documentation_helpers.rb#8 +Pry::Helpers::DocumentationHelpers::YARD_TAGS = T.let(T.unsafe(nil), Array) + +# source://pry//lib/pry/helpers/options_helpers.rb#5 +module Pry::Helpers::OptionsHelpers + private + + # Get the method object parsed by the slop instance + # + # source://pry//lib/pry/helpers/options_helpers.rb#23 + def method_object; end + + # Add method options to the Pry::Slop instance + # + # source://pry//lib/pry/helpers/options_helpers.rb#9 + def method_options(opt); end + + class << self + # Get the method object parsed by the slop instance + # + # source://pry//lib/pry/helpers/options_helpers.rb#23 + def method_object; end + + # Add method options to the Pry::Slop instance + # + # source://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 +# +# source://pry//lib/pry/helpers/platform.rb#10 +module Pry::Helpers::Platform + class << self + # @api public + # @return [Boolean] + # @since v0.12.0 + # + # source://pry//lib/pry/helpers/platform.rb#35 + def jruby?; end + + # @api public + # @return [Boolean] + # @since v0.12.0 + # + # source://pry//lib/pry/helpers/platform.rb#40 + def jruby_19?; end + + # @api public + # @return [Boolean] + # @since v0.12.0 + # + # source://pry//lib/pry/helpers/platform.rb#17 + def linux?; end + + # @api public + # @return [Boolean] + # @since v0.12.0 + # + # source://pry//lib/pry/helpers/platform.rb#12 + def mac_osx?; end + + # @api public + # @return [Boolean] + # @since v0.12.0 + # + # source://pry//lib/pry/helpers/platform.rb#45 + def mri?; end + + # @api public + # @return [Boolean] + # @since v0.12.0 + # + # source://pry//lib/pry/helpers/platform.rb#50 + def mri_2?; end + + # @api public + # @return [Boolean] true when Pry is running on Windows with ANSI support, + # false otherwise + # @since v0.12.0 + # + # source://pry//lib/pry/helpers/platform.rb#23 + def windows?; end + + # @api public + # @return [Boolean] + # @since v0.12.0 + # + # source://pry//lib/pry/helpers/platform.rb#28 + def windows_ansi?; end + end +end + +# source://pry//lib/pry/helpers/table.rb#35 +class Pry::Helpers::Table + # @return [Table] a new instance of Table + # + # source://pry//lib/pry/helpers/table.rb#37 + def initialize(items, args, pry_instance = T.unsafe(nil)); end + + # source://pry//lib/pry/helpers/table.rb#81 + def ==(other); end + + # Returns the value of attribute column_count. + # + # source://pry//lib/pry/helpers/table.rb#36 + def column_count; end + + # source://pry//lib/pry/helpers/table.rb#68 + def column_count=(count); end + + # source://pry//lib/pry/helpers/table.rb#77 + def columns; end + + # @return [Boolean] + # + # source://pry//lib/pry/helpers/table.rb#73 + def fits_on_line?(line_length); end + + # Returns the value of attribute items. + # + # source://pry//lib/pry/helpers/table.rb#36 + def items; end + + # source://pry//lib/pry/helpers/table.rb#62 + def items=(items); end + + # source://pry//lib/pry/helpers/table.rb#47 + def rows_to_s(style = T.unsafe(nil)); end + + # source://pry//lib/pry/helpers/table.rb#85 + def to_a; end + + # source://pry//lib/pry/helpers/table.rb#43 + def to_s; end + + private + + # source://pry//lib/pry/helpers/table.rb#91 + def _max_width(things); end + + # source://pry//lib/pry/helpers/table.rb#95 + def _rebuild_colorless_cache; end + + # source://pry//lib/pry/helpers/table.rb#116 + def _recall_color_for(thing); end + + # source://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}. +# +# source://pry//lib/pry/helpers/text.rb#7 +module Pry::Helpers::Text + extend ::Pry::Helpers::Text + + # source://pry//lib/pry/helpers/text.rb#23 + def black(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def black_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def black_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def black_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def black_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def black_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def black_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def black_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def black_on_white(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def black_on_yellow(text); end + + # source://pry//lib/pry/helpers/text.rb#23 + def blue(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def blue_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def blue_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def blue_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def blue_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def blue_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def blue_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def blue_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def blue_on_white(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def blue_on_yellow(text); end + + # Returns _text_ as bold text for use on a terminal. + # + # @param text [String, #to_s] + # @return [String] _text_ + # + # source://pry//lib/pry/helpers/text.rb#54 + def bold(text); end + + # source://pry//lib/pry/helpers/text.rb#27 + def bright_black(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_black_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_black_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_black_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_black_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_black_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_black_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_black_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_black_on_white(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_black_on_yellow(text); end + + # source://pry//lib/pry/helpers/text.rb#27 + def bright_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_blue_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_blue_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_blue_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_blue_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_blue_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_blue_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_blue_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_blue_on_white(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_blue_on_yellow(text); end + + # source://pry//lib/pry/helpers/text.rb#27 + def bright_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_cyan_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_cyan_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_cyan_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_cyan_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_cyan_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_cyan_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_cyan_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_cyan_on_white(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_cyan_on_yellow(text); end + + # source://pry//lib/pry/helpers/text.rb#27 + def bright_green(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_green_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_green_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_green_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_green_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_green_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_green_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_green_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_green_on_white(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_green_on_yellow(text); end + + # source://pry//lib/pry/helpers/text.rb#27 + def bright_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_magenta_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_magenta_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_magenta_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_magenta_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_magenta_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_magenta_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_magenta_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_magenta_on_white(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_magenta_on_yellow(text); end + + # source://pry//lib/pry/helpers/text.rb#27 + def bright_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_purple_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_purple_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_purple_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_purple_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_purple_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_purple_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_purple_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_purple_on_white(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_purple_on_yellow(text); end + + # source://pry//lib/pry/helpers/text.rb#27 + def bright_red(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_red_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_red_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_red_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_red_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_red_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_red_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_red_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_red_on_white(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_red_on_yellow(text); end + + # source://pry//lib/pry/helpers/text.rb#27 + def bright_white(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_white_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_white_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_white_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_white_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_white_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_white_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_white_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_white_on_white(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_white_on_yellow(text); end + + # source://pry//lib/pry/helpers/text.rb#27 + def bright_yellow(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_yellow_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_yellow_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_yellow_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_yellow_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_yellow_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_yellow_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_yellow_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_yellow_on_white(text); end + + # source://pry//lib/pry/helpers/text.rb#36 + def bright_yellow_on_yellow(text); end + + # source://pry//lib/pry/helpers/text.rb#23 + def cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def cyan_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def cyan_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def cyan_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def cyan_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def cyan_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def cyan_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def cyan_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def cyan_on_white(text); end + + # source://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 text [String, #to_s] + # @return [String] + # + # source://pry//lib/pry/helpers/text.rb#63 + def default(text); end + + # source://pry//lib/pry/helpers/text.rb#23 + def green(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def green_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def green_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def green_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def green_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def green_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def green_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def green_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def green_on_white(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def green_on_yellow(text); end + + # Returns _text_ indented by _chars_ spaces. + # + # @param text [String] + # @param chars [Fixnum] + # + # source://pry//lib/pry/helpers/text.rb#113 + def indent(text, chars); end + + # source://pry//lib/pry/helpers/text.rb#23 + def magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def magenta_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def magenta_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def magenta_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def magenta_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def magenta_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def magenta_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def magenta_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def magenta_on_white(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def magenta_on_yellow(text); end + + # @return [void] + # @yield Yields a block with color turned off. + # + # source://pry//lib/pry/helpers/text.rb#73 + def no_color; end + + # @return [void] + # @yield Yields a block with paging turned off. + # + # source://pry//lib/pry/helpers/text.rb#87 + def no_pager; end + + # source://pry//lib/pry/helpers/text.rb#23 + def purple(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def purple_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def purple_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def purple_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def purple_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def purple_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def purple_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def purple_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def purple_on_white(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def purple_on_yellow(text); end + + # source://pry//lib/pry/helpers/text.rb#23 + def red(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def red_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def red_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def red_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def red_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def red_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def red_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def red_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def red_on_white(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def red_on_yellow(text); end + + # Remove any color codes from _text_. + # + # @param text [String, #to_s] + # @return [String] _text_ stripped of any color codes. + # + # source://pry//lib/pry/helpers/text.rb#46 + def strip_color(text); end + + # source://pry//lib/pry/helpers/text.rb#23 + def white(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def white_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def white_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def white_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def white_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def white_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def white_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def white_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def white_on_white(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def white_on_yellow(text); end + + # Returns _text_ in a numbered list, beginning at _offset_. + # + # @param text [#each_line] + # @param offset [Fixnum] + # @return [String] + # + # source://pry//lib/pry/helpers/text.rb#100 + def with_line_numbers(text, offset, color = T.unsafe(nil)); end + + # source://pry//lib/pry/helpers/text.rb#23 + def yellow(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def yellow_on_black(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def yellow_on_blue(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def yellow_on_cyan(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def yellow_on_green(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def yellow_on_magenta(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def yellow_on_purple(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def yellow_on_red(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def yellow_on_white(text); end + + # source://pry//lib/pry/helpers/text.rb#32 + def yellow_on_yellow(text); end +end + +# source://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. +# +# source://pry//lib/pry/history.rb#6 +class Pry::History + # @return [History] a new instance of History + # + # source://pry//lib/pry/history.rb#29 + def initialize(options = T.unsafe(nil)); end + + # Add a line to the input history, ignoring blank and duplicate lines. + # + # @param line [String] + # @return [String] The same line that was passed in + # + # source://pry//lib/pry/history.rb#53 + def <<(line); end + + # Clear this session's history. This won't affect the contents of the + # history file. + # + # source://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. + # + # source://pry//lib/pry/history.rb#95 + def filter(history); end + + # @return [Integer] total number of lines, including original lines + # + # source://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 + # + # source://pry//lib/pry/history.rb#40 + def load; end + + # Returns the value of attribute loader. + # + # source://pry//lib/pry/history.rb#21 + def loader; end + + # Sets the attribute loader + # + # @param value the value to set the attribute loader to. + # + # source://pry//lib/pry/history.rb#21 + def loader=(_arg0); end + + # @return [Fixnum] Number of lines in history when Pry first loaded. + # + # source://pry//lib/pry/history.rb#24 + def original_lines; end + + # Add a line to the input history, ignoring blank and duplicate lines. + # + # @param line [String] + # @return [String] The same line that was passed in + # + # source://pry//lib/pry/history.rb#53 + def push(line); end + + # Returns the value of attribute saver. + # + # source://pry//lib/pry/history.rb#21 + def saver; end + + # Sets the attribute saver + # + # @param value the value to set the attribute saver to. + # + # source://pry//lib/pry/history.rb#21 + def saver=(_arg0); end + + # @return [Fixnum] The number of lines in history from just this session. + # + # source://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. + # + # source://pry//lib/pry/history.rb#88 + def to_a; end + + private + + # The history file, opened for appending. + # + # source://pry//lib/pry/history.rb#127 + def history_file; end + + # source://pry//lib/pry/history.rb#143 + def history_file_path; end + + # @return [Boolean] + # + # source://pry//lib/pry/history.rb#147 + def invalid_readline_line?(line); end + + # The default loader. Yields lines from `Pry.config.history_file`. + # + # source://pry//lib/pry/history.rb#113 + def read_from_file; end + + # The default saver. Appends the given line to `Pry.config.history_file`. + # + # source://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. + # + # source://pry//lib/pry/history.rb#105 + def should_ignore?(line); end + + class << self + # source://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 +# +# source://pry//lib/pry/hooks.rb#14 +class Pry::Hooks + # @return [Hooks] a new instance of Hooks + # + # source://pry//lib/pry/hooks.rb#25 + def initialize; end + + # Add a new hook to be executed for the `event_name` event. + # + # @param event_name [Symbol] The name of the event. + # @param hook_name [Symbol] The name of the hook. + # @param callable [#call] The callable. + # @raise [ArgumentError] + # @return [Pry:Hooks] The receiver. + # @yield The block to use as the callable (if no `callable` provided). + # + # source://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 event_name [String] The name of the event. + # @return [void] + # + # source://pry//lib/pry/hooks.rb#165 + def clear_event_hooks(event_name); end + + # @param event_name [Symbol] The name of the event. + # @param hook_name [Symbol] The name of the hook. + # to delete. + # @return [#call] The deleted hook. + # + # source://pry//lib/pry/hooks.rb#147 + def delete_hook(event_name, hook_name); end + + # source://pry//lib/pry/hooks.rb#39 + def errors; end + + # Execute the list of hooks for the `event_name` event. + # + # @param event_name [Symbol] The name of the event. + # @param args [Array] The arguments to pass to each hook function. + # @return [Object] The return value of the last executed hook. + # + # source://pry//lib/pry/hooks.rb#108 + def exec_hook(event_name, *args, &block); end + + # @param event_name [Symbol] The name of the event. + # @param hook_name [Symbol] The name of the hook + # @return [#call] a specific hook for a given event. + # + # source://pry//lib/pry/hooks.rb#128 + def get_hook(event_name, hook_name); end + + # `add_hook`/`delete_hook` for that. + # + # @note Modifying the returned hash does not alter the hooks, use + # @param event_name [Symbol] The name of the event. + # @return [Hash] The hash of hook names / hook functions. + # + # source://pry//lib/pry/hooks.rb#139 + def get_hooks(event_name); end + + # @param event_name [Symbol] The name of the event. + # @return [Fixnum] The number of hook functions for `event_name`. + # + # source://pry//lib/pry/hooks.rb#121 + def hook_count(event_name); end + + # @param event_name [Symbol] Name of the event. + # @param hook_name [Symbol] Name of the hook. + # @return [Boolean] Whether the hook by the name `hook_name`. + # + # source://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 other [Pry::Hooks] 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. + # + # source://pry//lib/pry/hooks.rb#69 + def merge(other); end + + # Destructively merge the contents of two `Pry:Hooks` instances. + # + # @param other [Pry::Hooks] The `Pry::Hooks` instance to merge + # @return [Pry:Hooks] The receiver. + # @see #merge + # + # source://pry//lib/pry/hooks.rb#48 + def merge!(other); end + + protected + + # Returns the value of attribute hooks. + # + # source://pry//lib/pry/hooks.rb#178 + def hooks; end + + private + + # Ensure that duplicates have their @hooks object. + # + # source://pry//lib/pry/hooks.rb#30 + def initialize_copy(_orig); end + + class << self + # source://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. +# +# source://pry//lib/pry/indent.rb#11 +class Pry::Indent + include ::Pry::Helpers::BaseHelpers + + # @return [Indent] a new instance of Indent + # + # source://pry//lib/pry/indent.rb#104 + 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 prompt [String] The user's prompt + # @param code [String] The code the user just typed in + # @param overhang [Integer] 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 + # + # source://pry//lib/pry/indent.rb#393 + 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 + # + # source://pry//lib/pry/indent.rb#181 + 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. + # + # @return [Boolean] + # + # source://pry//lib/pry/indent.rb#264 + 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] Boolean + # + # source://pry//lib/pry/indent.rb#275 + def in_string?; end + + # Indents a string and returns it. This string can either be a single line + # or multiple ones. + # + # @example + # str = <] + # + # source://pry//lib/pry/indent.rb#376 + def module_nesting; end + + # All the open delimiters, in the order that they first appeared. + # + # @return [String] + # + # source://pry//lib/pry/indent.rb#312 + def open_delimiters; end + + # Return a string which restores the CodeRay string status to the correct value by + # opening HEREDOCs and strings. + # + # @return String + # + # source://pry//lib/pry/indent.rb#320 + def open_delimiters_line; end + + # reset internal state + # + # source://pry//lib/pry/indent.rb#110 + def reset; end + + # @return [Array] The stack of open tokens. + # + # source://pry//lib/pry/indent.rb#21 + 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] + # + # source://pry//lib/pry/indent.rb#283 + 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 token [String] The token (of type :delimiter) + # + # source://pry//lib/pry/indent.rb#297 + 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 token [String] a token from Coderay + # @param kind [Symbol] the kind of that token + # + # source://pry//lib/pry/indent.rb#341 + 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 token [String] a token from Coderay + # @param kind [Symbol] the kind of that token + # + # source://pry//lib/pry/indent.rb#366 + def track_module_nesting_end(token, kind = T.unsafe(nil)); end + + class << self + # Clean the indentation of a fragment of ruby. + # + # @param str [String] + # @return [String] + # + # source://pry//lib/pry/indent.rb#82 + 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 str [String] The ruby code to analyze + # @param line_number [Fixnum] The line number (starting from 1) + # @return [Array] + # + # source://pry//lib/pry/indent.rb#95 + 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". +# +# source://pry//lib/pry/indent.rb#60 +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. +# +# source://pry//lib/pry/indent.rb#76 +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. +# +# source://pry//lib/pry/indent.rb#30 +Pry::Indent::OPEN_TOKENS = T.let(T.unsafe(nil), Hash) + +# Which tokens can be followed by an optional "do" keyword. +# +# source://pry//lib/pry/indent.rb#52 +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. +# +# source://pry//lib/pry/indent.rb#49 +Pry::Indent::SINGLELINE_TOKENS = T.let(T.unsafe(nil), Array) + +# The amount of spaces to insert for each indent level. +# +# source://pry//lib/pry/indent.rb#24 +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. +# +# source://pry//lib/pry/indent.rb#69 +Pry::Indent::STATEMENT_END_TOKENS = T.let(T.unsafe(nil), Array) + +# Raised if {#module_nesting} would not work. +# +# source://pry//lib/pry/indent.rb#15 +class Pry::Indent::UnparseableNestingError < ::StandardError; end + +# source://pry//lib/pry/input_completer.rb#6 +class Pry::InputCompleter + # @return [InputCompleter] a new instance of InputCompleter + # + # source://pry//lib/pry/input_completer.rb#42 + def initialize(input, pry = T.unsafe(nil)); end + + # build_path seperates 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. + # + # source://pry//lib/pry/input_completer.rb#240 + def build_path(input); end + + # Return a new completion proc for use by Readline. + # + # source://pry//lib/pry/input_completer.rb#56 + def call(str, options = T.unsafe(nil)); end + + # source://pry//lib/pry/input_completer.rb#255 + def ignored_modules; end + + # source://pry//lib/pry/input_completer.rb#229 + def select_message(path, receiver, message, candidates); end +end + +# source://pry//lib/pry/input_completer.rb#8 +Pry::InputCompleter::ARRAY_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://pry//lib/pry/input_completer.rb#15 +Pry::InputCompleter::CONSTANT_OR_METHOD_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://pry//lib/pry/input_completer.rb#14 +Pry::InputCompleter::CONSTANT_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://pry//lib/pry/input_completer.rb#17 +Pry::InputCompleter::GLOBALVARIABLE_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://pry//lib/pry/input_completer.rb#16 +Pry::InputCompleter::HEX_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://pry//lib/pry/input_completer.rb#7 +Pry::InputCompleter::NUMERIC_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://pry//lib/pry/input_completer.rb#12 +Pry::InputCompleter::PROC_OR_HASH_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://pry//lib/pry/input_completer.rb#11 +Pry::InputCompleter::REGEX_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://pry//lib/pry/input_completer.rb#20 +Pry::InputCompleter::RESERVED_WORDS = T.let(T.unsafe(nil), Array) + +# source://pry//lib/pry/input_completer.rb#10 +Pry::InputCompleter::SYMBOL_METHOD_CALL_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://pry//lib/pry/input_completer.rb#9 +Pry::InputCompleter::SYMBOL_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://pry//lib/pry/input_completer.rb#13 +Pry::InputCompleter::TOPLEVEL_LOOKUP_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://pry//lib/pry/input_completer.rb#18 +Pry::InputCompleter::VARIABLE_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://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. +# +# source://pry//lib/pry/input_lock.rb#8 +class Pry::InputLock + # @return [InputLock] a new instance of InputLock + # + # source://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(). + # + # source://pry//lib/pry/input_lock.rb#38 + def __with_ownership; end + + # source://pry//lib/pry/input_lock.rb#81 + def enter_interruptible_region; end + + # source://pry//lib/pry/input_lock.rb#108 + def interruptible_region; end + + # source://pry//lib/pry/input_lock.rb#95 + def leave_interruptible_region; end + + # source://pry//lib/pry/input_lock.rb#75 + def with_ownership(&block); end + + class << self + # source://pry//lib/pry/input_lock.rb#19 + def for(input); end + + # Returns the value of attribute global_lock. + # + # source://pry//lib/pry/input_lock.rb#13 + def global_lock; end + + # Sets the attribute global_lock + # + # @param value the value to set the attribute global_lock to. + # + # source://pry//lib/pry/input_lock.rb#13 + def global_lock=(_arg0); end + + # Returns the value of attribute input_locks. + # + # source://pry//lib/pry/input_lock.rb#12 + def input_locks; end + + # Sets the attribute input_locks + # + # @param value the value to set the attribute input_locks to. + # + # source://pry//lib/pry/input_lock.rb#12 + def input_locks=(_arg0); end + end +end + +# source://pry//lib/pry/input_lock.rb#9 +class Pry::InputLock::Interrupt < ::Exception; end + +# source://pry//lib/pry/inspector.rb#4 +class Pry::Inspector; end + +# source://pry//lib/pry/inspector.rb#5 +Pry::Inspector::MAP = T.let(T.unsafe(nil), Hash) + +# source://pry//lib/pry/pry_class.rb#7 +Pry::LOCAL_RC_FILE = T.let(T.unsafe(nil), String) + +# source://pry//lib/pry/last_exception.rb#12 +class Pry::LastException < ::BasicObject + # @return [LastException] a new instance of LastException + # + # source://pry//lib/pry/last_exception.rb#15 + def initialize(exception); end + + # Returns the value of attribute bt_index. + # + # source://pry//lib/pry/last_exception.rb#13 + def bt_index; end + + # Sets the attribute bt_index + # + # @param value the value to set the attribute bt_index to. + # + # source://pry//lib/pry/last_exception.rb#13 + def bt_index=(_arg0); end + + # source://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}. + # + # source://pry//lib/pry/last_exception.rb#37 + def file; end + + # source://pry//lib/pry/last_exception.rb#57 + def inc_bt_index; end + + # @return [Fixnum] returns the line for the current backtrace. see {#bt_index}. + # + # source://pry//lib/pry/last_exception.rb#43 + def line; end + + # source://pry//lib/pry/last_exception.rb#21 + def method_missing(name, *args, &block); end + + # @return [Exception] returns the wrapped exception + # + # source://pry//lib/pry/last_exception.rb#48 + def wrapped_exception; end + + private + + # @return [Boolean] + # + # source://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. +# +# source://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 [::Method, UnboundMethod, Proc] + # @param known_info [Hash] Can be used to pre-cache expensive to compute stuff. + # @return [Pry::Method] + # + # source://pry//lib/pry/method.rb#263 + def initialize(method, known_info = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://pry//lib/pry/method.rb#483 + def ==(other); end + + # @return [Boolean] Is the method definitely an alias? + # + # source://pry//lib/pry/method.rb#478 + def alias?; end + + # @return [Array] All known aliases for the method. + # + # source://pry//lib/pry/method.rb#461 + def aliases; end + + # @return [Boolean] Whether the method is bound. + # + # source://pry//lib/pry/method.rb#446 + def bound_method?; end + + # source://pry//lib/pry/method.rb#515 + def comment; end + + # @return [String, nil] The documentation for the method, or `nil` if it's + # unavailable. + # + # source://pry//lib/pry/method.rb#329 + def doc; end + + # @return [Boolean] Was the method defined outside a source file? + # + # source://pry//lib/pry/method.rb#436 + def dynamically_defined?; end + + # @param klass [Class] + # @return [Boolean] + # + # source://pry//lib/pry/method.rb#491 + def is_a?(klass); end + + # @param klass [Class] + # @return [Boolean] + # + # source://pry//lib/pry/method.rb#491 + def kind_of?(klass); end + + # Delegate any unknown calls to the wrapped method. + # + # source://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] + # + # source://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] + # + # source://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. + # + # source://pry//lib/pry/method.rb#429 + def original_name; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def owner(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def parameters(*args, **_arg1, &block); end + + # @return [Boolean] Was the method defined within the Pry REPL? + # + # source://pry//lib/pry/method.rb#456 + def pry_method?; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def receiver(*args, **_arg1, &block); end + + # Update the live copy of the method's source. + # + # source://pry//lib/pry/method.rb#314 + def redefine(source); end + + # @param method_name [String, Symbol] + # @return [Boolean] + # + # source://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. + # + # source://pry//lib/pry/method.rb#391 + def signature; end + + # @return [Boolean] Whether the method is a singleton method. + # + # source://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. + # + # source://pry//lib/pry/method.rb#304 + def source; end + + # Can we get the source code for this method? + # + # @return [Boolean] + # + # source://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. + # + # source://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. + # + # source://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. + # + # source://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. + # + # source://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. + # + # source://pry//lib/pry/method.rb#417 + def super(times = T.unsafe(nil)); end + + # @return [Boolean] Whether the method is unbound. + # + # source://pry//lib/pry/method.rb#441 + def unbound_method?; end + + # Is the method undefined? (aka `Disowned`) + # + # @return [Boolean] false + # + # source://pry//lib/pry/method.rb#290 + def undefined?; end + + # @return [Symbol] The visibility of the method. May be `:public`, + # `:protected`, or `:private`. + # + # source://pry//lib/pry/method.rb#373 + def visibility; end + + # Get underlying object wrapped by this Pry::Method instance + # + # @return [Method, UnboundMethod, Proc] + # + # source://pry//lib/pry/method.rb#284 + def wrapped; end + + # Get the owner of the method as a Pry::Module + # + # @return [Pry::Module] + # + # source://pry//lib/pry/method.rb#278 + def wrapped_owner; end + + private + + # source://pry//lib/pry/method.rb#578 + def c_source; end + + # @param first_ln [String] The first line of a method definition. + # @return [String, nil] + # + # source://pry//lib/pry/method.rb#564 + def method_name_from_first_line(first_ln); end + + # @raise [CommandError] when the method can't be found or `pry-doc` isn't installed. + # @return [YARD::CodeObjects::MethodObject] + # + # source://pry//lib/pry/method.rb#523 + def pry_doc_info; end + + # @return [Boolean] + # + # source://pry//lib/pry/method.rb#511 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end + + # source://pry//lib/pry/method.rb#583 + def ruby_source; end + + # @param ancestors [Class, Module] The ancestors to investigate + # @return [Method] The unwrapped super-method + # + # source://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 klass [Class, Module] + # @param include_super [Boolean] Whether to include methods from ancestors. + # @return [Array[Pry::Method]] + # + # source://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 obj [Object] + # @param include_super [Boolean] indicates whether or not to include methods from ancestors. + # @return [Array[Pry::Method]] + # + # source://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] + # + # source://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 klass [Class, Module] + # @param name [String] + # @param target [Binding] The binding where the method is looked up. + # @return [Pry::Method, nil] + # + # source://pry//lib/pry/method.rb#136 + def from_class(klass, name, target = T.unsafe(nil)); 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 klass [Class, Module] + # @param name [String] + # @param target [Binding] The binding where the method is looked up. + # @return [Pry::Method, nil] + # + # source://pry//lib/pry/method.rb#136 + 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 obj [Object] + # @param name [String] + # @param target [Binding] The binding where the method is looked up. + # @return [Pry::Method, nil] + # + # source://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. + # + # @option options + # @option options + # @param name [String] The name of the method to retrieve. + # @param target [Binding] The context in which to search for the method. + # @param options [Hash] + # @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. + # + # source://pry//lib/pry/method.rb#43 + def from_str(name, target = T.unsafe(nil), options = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://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 klass [Class, Module] + # @return [Array[Class, Module]] + # + # source://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 obj [Object] The owner/receiver of the method. + # @param method_name [Symbol] The name of the method. + # @param method_type [Symbol] The type of method: :method or :instance_method + # @param target [Binding] The binding where the method is looked up. + # @return [Method, UnboundMethod] The 'refined' method object. + # + # source://pry//lib/pry/method.rb#114 + def lookup_method_via_binding(obj, method_name, method_type, target = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://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 obj [Object] + # @return [Array[Class, Module]] + # + # source://pry//lib/pry/method.rb#192 + def resolution_order(obj); end + + # source://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. + # + # source://pry//lib/pry/method.rb#238 + def singleton_class_resolution_order(klass); end + + # @return [Boolean] + # + # source://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. +# +# source://pry//lib/pry/method/disowned.rb#18 +class Pry::Method::Disowned < ::Pry::Method + # Create a new Disowned method. + # + # @param receiver [Object] + # @param method_name [String] + # @return [Disowned] a new instance of Disowned + # + # source://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. + # + # source://pry//lib/pry/method/disowned.rb#52 + def method_missing(method_name, *args, &block); end + + # Returns the value of attribute name. + # + # source://pry//lib/pry/method/disowned.rb#19 + def name; end + + # Get the hypothesized owner of the method. + # + # @return [Object] + # + # source://pry//lib/pry/method/disowned.rb#46 + def owner; end + + # Returns the value of attribute receiver. + # + # source://pry//lib/pry/method/disowned.rb#19 + def receiver; end + + # Can we get the source for this method? + # + # @return [Boolean] false + # + # source://pry//lib/pry/method/disowned.rb#39 + def source?; end + + # Is the method undefined? (aka `Disowned`) + # + # @return [Boolean] true + # + # source://pry//lib/pry/method/disowned.rb#33 + def undefined?; end + + private + + # @return [Boolean] + # + # source://pry//lib/pry/method/disowned.rb#62 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end +end + +# source://pry//lib/pry/method/patcher.rb#5 +class Pry::Method::Patcher + # @return [Patcher] a new instance of Patcher + # + # source://pry//lib/pry/method/patcher.rb#12 + def initialize(method); end + + # Returns the value of attribute method. + # + # source://pry//lib/pry/method/patcher.rb#6 + def method; end + + # Sets the attribute method + # + # @param value the value to set the attribute method to. + # + # source://pry//lib/pry/method/patcher.rb#6 + def method=(_arg0); end + + # perform the patch + # + # source://pry//lib/pry/method/patcher.rb#21 + def patch_in_ram(source); end + + private + + # source://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 line [String] 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) + # + # source://pry//lib/pry/method/patcher.rb#78 + def definition_for_owner(line); end + + # source://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 + # transation we make that not happen, which means that alias_method_chains, etc. + # continue to work. + # + # source://pry//lib/pry/method/patcher.rb#49 + def with_method_transaction; end + + # Apply wrap_for_owner and wrap_for_nesting successively to `source` + # + # @param source [String] + # @return [String] The wrapped source. + # + # source://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 source [String] The source to wrap. + # @return [String] + # + # source://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 stil be defined in + # the correct place. + # + # @param source [String] The source to wrap + # @return [String] + # + # source://pry//lib/pry/method/patcher.rb#103 + def wrap_for_owner(source); end + + class << self + # source://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. +# +# source://pry//lib/pry/method/weird_method_locator.rb#19 +class Pry::Method::WeirdMethodLocator + # @param method [Pry::Method] The seed method. + # @param target [Binding] The Binding that captures the method + # we want to locate. + # @return [WeirdMethodLocator] a new instance of WeirdMethodLocator + # + # source://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. + # + # source://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. + # + # source://pry//lib/pry/method/weird_method_locator.rb#69 + def lost_method?; end + + # Returns the value of attribute method. + # + # source://pry//lib/pry/method/weird_method_locator.rb#49 + def method; end + + # Sets the attribute method + # + # @param value the value to set the attribute method to. + # + # source://pry//lib/pry/method/weird_method_locator.rb#49 + def method=(_arg0); end + + # Returns the value of attribute target. + # + # source://pry//lib/pry/method/weird_method_locator.rb#50 + def target; end + + # Sets the attribute target + # + # @param value the value to set the attribute target to. + # + # source://pry//lib/pry/method/weird_method_locator.rb#50 + def target=(_arg0); end + + private + + # source://pry//lib/pry/method/weird_method_locator.rb#215 + def all_methods_for(obj); end + + # source://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 unavaiable for some reason, + # or if both methods have the same __FILE__ and __LINE__. + # + # @return [Pry::Method, nil] The Pry::Method representing the + # superclass method. + # + # source://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 + # + # source://pry//lib/pry/method/weird_method_locator.rb#156 + def find_renamed_method; end + + # source://pry//lib/pry/method/weird_method_locator.rb#197 + def index_to_line_number(index); end + + # source://pry//lib/pry/method/weird_method_locator.rb#206 + def lines_for_file(file); end + + # @return [Boolean] + # + # source://pry//lib/pry/method/weird_method_locator.rb#80 + def normal_method?(method); end + + # @return [Boolean] + # + # source://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 + # + # source://pry//lib/pry/method/weird_method_locator.rb#184 + def renamed_method_source_location; end + + # @return [Boolean] + # + # source://pry//lib/pry/method/weird_method_locator.rb#75 + def skip_superclass_search?; end + + # source://pry//lib/pry/method/weird_method_locator.rb#88 + def target_file; end + + # source://pry//lib/pry/method/weird_method_locator.rb#98 + def target_line; end + + # source://pry//lib/pry/method/weird_method_locator.rb#84 + def target_self; end + + # @return [Boolean] + # + # source://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 method [Pry::Method] + # @param binding [Binding] + # @return [Boolean] + # + # source://pry//lib/pry/method/weird_method_locator.rb#29 + def normal_method?(method, binding); end + + # @return [Boolean] + # + # source://pry//lib/pry/method/weird_method_locator.rb#44 + def weird_method?(method, binding); end + end +end + +# source://pry//lib/pry/exceptions.rb#69 +class Pry::MethodNotFound < ::Pry::CommandError; end + +# source://pry//lib/pry/command_set.rb#4 +class Pry::NoCommandError < ::StandardError + # @return [NoCommandError] a new instance of NoCommandError + # + # source://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 +# +# source://pry//lib/pry/object_path.rb#17 +class Pry::ObjectPath + # @param path_string [String] The object path expressed as a string. + # @param current_stack [Array] The current state of the binding + # stack. + # @return [ObjectPath] a new instance of ObjectPath + # + # source://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. + # + # source://pry//lib/pry/object_path.rb#30 + def resolve; end + + private + + # @return [Boolean] + # + # source://pry//lib/pry/object_path.rb#74 + def complete?(segment); end + + # source://pry//lib/pry/object_path.rb#78 + def handle_failure(context, err); end +end + +# source://pry//lib/pry/object_path.rb#18 +Pry::ObjectPath::SPECIAL_TERMS = T.let(T.unsafe(nil), Array) + +# indicates obsolete API +# +# source://pry//lib/pry/exceptions.rb#72 +class Pry::ObsoleteError < ::StandardError; end + +# source://pry//lib/pry/output.rb#4 +class Pry::Output + # @return [Output] a new instance of Output + # + # source://pry//lib/pry/output.rb#10 + def initialize(pry_instance); end + + # source://pry//lib/pry/output.rb#28 + def <<(*objs); end + + # source://pry//lib/pry/output.rb#53 + def decolorize_maybe(str); end + + # Return a screen height or the default if that fails. + # + # source://pry//lib/pry/output.rb#74 + def height; end + + # source://pry//lib/pry/output.rb#41 + def method_missing(method_name, *args, &block); end + + # source://pry//lib/pry/output.rb#28 + def print(*objs); end + + # Returns the value of attribute pry_instance. + # + # source://pry//lib/pry/output.rb#8 + def pry_instance; end + + # source://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. + # + # source://pry//lib/pry/output.rb#61 + def size; end + + # @return [Boolean] + # + # source://pry//lib/pry/output.rb#37 + def tty?; end + + # Return a screen width or the default if that fails. + # + # source://pry//lib/pry/output.rb#69 + def width; end + + # source://pry//lib/pry/output.rb#28 + def write(*objs); end + + private + + # source://pry//lib/pry/output.rb#80 + def actual_screen_size; end + + # source://pry//lib/pry/output.rb#125 + def ansicon_env_size; end + + # source://pry//lib/pry/output.rb#109 + def env_size; end + + # source://pry//lib/pry/output.rb#92 + def io_console_size; end + + # @return [Boolean] + # + # source://pry//lib/pry/output.rb#132 + def nonzero_column?(size); end + + # source://pry//lib/pry/output.rb#114 + def readline_size; end + + # @return [Boolean] + # + # source://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] +# +# source://pry//lib/pry/output.rb#6 +Pry::Output::DEFAULT_SIZE = T.let(T.unsafe(nil), Array) + +# source://pry//lib/pry/pager.rb#7 +class Pry::Pager + # @return [Pager] a new instance of Pager + # + # source://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 `#<<`. + # + # source://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 text [String] Text to run through a pager. + # + # source://pry//lib/pry/pager.rb#25 + def page(text); end + + # Returns the value of attribute pry_instance. + # + # source://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. + # + # source://pry//lib/pry/pager.rb#56 + def best_available; end + + # @return [Boolean] + # + # source://pry//lib/pry/pager.rb#43 + def enabled?; end + + # Returns the value of attribute output. + # + # source://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. +# +# source://pry//lib/pry/pager.rb#68 +class Pry::Pager::NullPager + # @return [NullPager] a new instance of NullPager + # + # source://pry//lib/pry/pager.rb#69 + def initialize(out); end + + # source://pry//lib/pry/pager.rb#77 + def <<(str); end + + # source://pry//lib/pry/pager.rb#86 + def close; end + + # source://pry//lib/pry/pager.rb#77 + def print(str); end + + # source://pry//lib/pry/pager.rb#73 + def puts(str); end + + # source://pry//lib/pry/pager.rb#82 + def write(str); end + + private + + # source://pry//lib/pry/pager.rb#90 + def height; end + + # source://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. +# +# source://pry//lib/pry/pager.rb#213 +class Pry::Pager::PageTracker + # @return [PageTracker] a new instance of PageTracker + # + # source://pry//lib/pry/pager.rb#214 + def initialize(rows, cols); end + + # @return [Boolean] + # + # source://pry//lib/pry/pager.rb#231 + def page?; end + + # source://pry//lib/pry/pager.rb#220 + def record(str); end + + # source://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. + # + # source://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. +# +# source://pry//lib/pry/pager.rb#101 +class Pry::Pager::SimplePager < ::Pry::Pager::NullPager + # @return [SimplePager] a new instance of SimplePager + # + # source://pry//lib/pry/pager.rb#102 + def initialize(*_arg0); end + + # source://pry//lib/pry/pager.rb#107 + def write(str); end +end + +# source://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. +# +# source://pry//lib/pry/pager.rb#129 +class Pry::Pager::SystemPager < ::Pry::Pager::NullPager + # @return [SystemPager] a new instance of SystemPager + # + # source://pry//lib/pry/pager.rb#161 + def initialize(*_arg0); end + + # source://pry//lib/pry/pager.rb#181 + def close; end + + # source://pry//lib/pry/pager.rb#168 + def write(str); end + + private + + # @return [Boolean] + # + # source://pry//lib/pry/pager.rb#195 + def invoked_pager?; end + + # source://pry//lib/pry/pager.rb#199 + def pager; end + + # source://pry//lib/pry/pager.rb#191 + def write_to_pager(text); end + + class << self + # @return [Boolean] + # + # source://pry//lib/pry/pager.rb#142 + def available?; end + + # source://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. +# +# @api public +# @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 +# +# source://pry//lib/pry/prompt.rb#38 +class Pry::Prompt + # @api public + # @param name [String] + # @param description [String] + # @param prompt_procs [Array] + # @return [Prompt] a new instance of Prompt + # @since v0.11.0 + # + # source://pry//lib/pry/prompt.rb#117 + def initialize(name, description, prompt_procs); end + + # @api public + # @deprecated Use a `Pry::Prompt` instance directly + # @since v0.11.0 + # + # source://pry//lib/pry/prompt.rb#135 + def [](key); end + + # @api public + # @return [String] + # @since v0.11.0 + # + # source://pry//lib/pry/prompt.rb#108 + def description; end + + # @api public + # @return [Proc] the proc which builds the prompt when in the middle of an + # expression such as open method, etc. (`*`) + # @since v0.11.0 + # + # source://pry//lib/pry/prompt.rb#130 + def incomplete_proc; end + + # @api public + # @return [String] + # @since v0.11.0 + # + # source://pry//lib/pry/prompt.rb#105 + def name; end + + # @api public + # @return [Array] the array of procs that hold + # `[wait_proc, incomplete_proc]` + # @since v0.11.0 + # + # source://pry//lib/pry/prompt.rb#112 + def prompt_procs; end + + # @api public + # @return [Proc] the proc which builds the wait prompt (`>`) + # @since v0.11.0 + # + # source://pry//lib/pry/prompt.rb#124 + def wait_proc; end + + class << self + # Retrieves a prompt. + # + # @api public + # @example + # Prompt[:my_prompt] + # @param name [Symbol] The name of the prompt you want to access + # @return [Hash{Symbol=>Object}] + # @since v0.12.0 + # + # source://pry//lib/pry/prompt.rb#52 + def [](name); end + + # Adds a new prompt to the prompt hash. + # + # @api public + # @param name [Symbol] + # @param description [String] + # @param separators [Array] The separators to differentiate + # between prompt modes (default mode and class/method definition mode). + # The Array *must* have a size of 2. + # @raise [ArgumentError] if the size of `separators` is not 2 + # @raise [ArgumentError] if `prompt_name` is already occupied + # @return [nil] + # @since v0.12.0 + # @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 + # + # source://pry//lib/pry/prompt.rb#79 + def add(name, description = T.unsafe(nil), separators = T.unsafe(nil)); end + + # @api public + # @note Use this for read-only operations + # @return [Hash{Symbol=>Hash}] the duplicate of the internal prompts hash + # @since v0.12.0 + # + # source://pry//lib/pry/prompt.rb#59 + def all; end + end +end + +# source://pry//lib/pry/repl.rb#4 +class Pry::REPL + extend ::Forwardable + extend ::Pry::Forwardable + + # Create an instance of {REPL} wrapping the given {Pry}. + # + # @option options + # @param pry [Pry] The instance of {Pry} that this {REPL} will control. + # @param options [Hash] Options for this {REPL} instance. + # @return [REPL] a new instance of REPL + # + # source://pry//lib/pry/repl.rb#22 + def initialize(pry, options = T.unsafe(nil)); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def input(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def output(*args, **_arg1, &block); end + + # @return [Pry] The instance of {Pry} that the user is controlling. + # + # source://pry//lib/pry/repl.rb#9 + def pry; end + + # @return [Pry] The instance of {Pry} that the user is controlling. + # + # source://pry//lib/pry/repl.rb#9 + def pry=(_arg0); end + + # Start the read-eval-print loop. + # + # @raise [Exception] If the session throws `:raise_up`, raise the exception + # thrown with it. + # @return [Object?] If the session throws `:breakout`, return the value + # thrown with it. + # + # source://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)". + # + # @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. + # @return [Integer] + # + # source://pry//lib/pry/repl.rb#237 + def calculate_overhang(current_prompt, original_val, indented_val); end + + # @return [Boolean] + # + # source://pry//lib/pry/repl.rb#205 + def coolline_available?; end + + # Clean up after the repl session. + # + # @return [void] + # + # source://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. + # + # source://pry//lib/pry/repl.rb#127 + def handle_read_errors; end + + # source://pry//lib/pry/repl.rb#195 + def input_readline(*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 + # @return [Boolean] + # + # source://pry//lib/pry/repl.rb#217 + def piping?; end + + # Set up the repl session. + # + # @return [void] + # + # source://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. + # + # source://pry//lib/pry/repl.rb#93 + def read; end + + # Returns the next line of input to be sent to the {Pry} instance. + # + # @param current_prompt [String] The prompt to use for input. + # @return [String?] The next line of input, or `nil` on . + # + # source://pry//lib/pry/repl.rb#169 + def read_line(current_prompt); end + + # @return [Boolean] + # + # source://pry//lib/pry/repl.rb#201 + def readline_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. + # + # @raise [Exception] If the session throws `:raise_up`, raise the exception + # thrown with it. + # @return [Object?] If the session throws `:breakout`, return the value + # thrown with it. + # + # source://pry//lib/pry/repl.rb#66 + def repl; end + + # @return [void] + # + # source://pry//lib/pry/repl.rb#224 + 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 + # @param options [Hash] a customizable set of options + # + # source://pry//lib/pry/repl.rb#14 + def start(options); end + end +end + +# 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. +# +# source://pry//lib/pry/repl_file_loader.rb#14 +class Pry::REPLFileLoader + # @return [REPLFileLoader] a new instance of REPLFileLoader + # + # source://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 + # + # source://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_instance [Pry] the Pry instance to make interactive. + # + # source://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. + # + # source://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_instance [Pry] the Pry instance to make non-interactive. + # + # source://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. +# +# source://pry//lib/pry/exceptions.rb#7 +module Pry::RescuableException + class << self + # source://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) +# +# source://pry//lib/pry/command_set.rb#397 +class Pry::Result + # @return [Result] a new instance of Result + # + # source://pry//lib/pry/command_set.rb#400 + def initialize(is_command, retval = T.unsafe(nil)); end + + # Is the result a command? + # + # @return [Boolean] + # + # source://pry//lib/pry/command_set.rb#407 + def command?; end + + # Returns the value of attribute retval. + # + # source://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] + # + # source://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` elemens. +# +# @api public +# @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 +# @since v0.12.0 +# +# source://pry//lib/pry/ring.rb#22 +class Pry::Ring + # @api public + # @param max_size [Integer] Maximum buffer size. The buffer will start + # overwriting elements once its reaches its maximum capacity + # @return [Ring] a new instance of Ring + # @since v0.12.0 + # + # source://pry//lib/pry/ring.rb#33 + def initialize(max_size); end + + # Push `value` to the current index. + # + # @api public + # @param value [Object] + # @return [self] + # @since v0.12.0 + # + # source://pry//lib/pry/ring.rb#43 + def <<(value); end + + # Read the value stored at `index`. + # + # @api public + # @param index [Integer, Range] The element (if Integer) or elements + # (if Range) associated with `index` + # @return [Object, Array, nil] element(s) at `index`, `nil` if none + # exist + # @since v0.12.0 + # + # source://pry//lib/pry/ring.rb#57 + def [](index); end + + # Clear the buffer and reset count. + # + # @api public + # @return [void] + # @since v0.12.0 + # + # source://pry//lib/pry/ring.rb#75 + def clear; end + + # @api public + # @return [Integer] how many objects were added during the lifetime of the + # ring + # @since v0.12.0 + # + # source://pry//lib/pry/ring.rb#28 + def count; end + + # @api public + # @return [Integer] maximum buffer size + # @since v0.12.0 + # + # source://pry//lib/pry/ring.rb#24 + def max_size; end + + # @api public + # @return [Integer] how many objects were added during the lifetime of the + # ring + # @since v0.12.0 + # + # source://pry//lib/pry/ring.rb#28 + def size; end + + # @api public + # @return [Array] the buffer as unwinded array + # @since v0.12.0 + # + # source://pry//lib/pry/ring.rb#67 + def to_a; end + + private + + # @api public + # @since v0.12.0 + # + # source://pry//lib/pry/ring.rb#84 + def transpose_buffer_tail; end +end + +# source://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. + # + # @return [Slop] a new instance of Slop + # + # source://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. + # + # source://pry//lib/pry/slop.rb#278 + def [](key); end + + # Add a callback. + # + # label - The Symbol identifier to attach this callback. + # + # Returns nothing. + # + # source://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. + # + # source://pry//lib/pry/slop.rb#168 + def banner(banner = T.unsafe(nil)); end + + # Set the banner. + # + # banner - The String to set the banner. + # + # source://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. + # + # source://pry//lib/pry/slop.rb#196 + def command(command, options = T.unsafe(nil), &block); end + + # The Hash of configuration options for this Slop instance. + # + # source://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. + # + # source://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. + # + # source://pry//lib/pry/slop.rb#176 + def description=(desc); end + + # Enumerable interface. Yields each Slop::Option. + # + # source://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 + # + # source://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. + # + # source://pry//lib/pry/slop.rb#373 + def fetch_option(key); 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. + # + # source://pry//lib/pry/slop.rb#278 + def get(key); end + + # Print a handy Slop help string. + # + # Returns the banner followed by available option help strings. + # + # source://pry//lib/pry/slop.rb#416 + 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. + # + # source://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. + # + # source://pry//lib/pry/slop.rb#265 + def on(*objects, &block); 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. + # + # source://pry//lib/pry/slop.rb#265 + def opt(*objects, &block); 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. + # + # source://pry//lib/pry/slop.rb#265 + def option(*objects, &block); end + + # The Array of Slop::Option objects tied to this Slop instance. + # + # source://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. + # + # source://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. + # + # source://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. + # + # @return [Boolean] + # + # source://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 + # + # @raise [ArgumentError] + # + # source://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. + # + # source://pry//lib/pry/slop.rb#405 + def separator(text); end + + # Is strict mode enabled? + # + # Returns true if strict mode is enabled, false otherwise. + # + # @return [Boolean] + # + # source://pry//lib/pry/slop.rb#152 + def strict?; 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. + # + # source://pry//lib/pry/slop.rb#287 + 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. + # + # source://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. + # + # source://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. + # + # source://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. + # + # source://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. + # + # source://pry//lib/pry/slop.rb#659 + def clean(object); end + + # source://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. + # + # source://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. + # + # source://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. + # + # source://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]. + # + # source://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. + # + # source://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(). + # + # source://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. + # + # source://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. + # + # @return [Boolean] + # + # source://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 programatically. 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. + # + # source://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. + # + # source://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. + # + # source://pry//lib/pry/slop.rb#63 + def parse!(items = T.unsafe(nil), config = T.unsafe(nil), &block); end + end +end + +# source://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 + # + # @return [Commands] a new instance of Commands + # + # source://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. + # + # source://pry//lib/pry/slop/commands.rb#100 + def [](key); end + + # Returns the value of attribute arguments. + # + # source://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. + # + # source://pry//lib/pry/slop/commands.rb#59 + def banner(banner = T.unsafe(nil)); end + + # Sets the attribute banner + # + # @param value the value to set the attribute banner to. + # + # source://pry//lib/pry/slop/commands.rb#9 + def banner=(_arg0); end + + # Returns the value of attribute commands. + # + # source://pry//lib/pry/slop/commands.rb#8 + def commands; end + + # Returns the value of attribute config. + # + # source://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. + # + # source://pry//lib/pry/slop/commands.rb#81 + def default(config = T.unsafe(nil), &block); end + + # Enumerable interface. + # + # source://pry//lib/pry/slop/commands.rb#119 + def each(&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. + # + # source://pry//lib/pry/slop/commands.rb#100 + 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. + # + # source://pry//lib/pry/slop/commands.rb#91 + def global(config = T.unsafe(nil), &block); end + + # Returns the help String. + # + # source://pry//lib/pry/slop/commands.rb#158 + def help; end + + # Returns the inspection String. + # + # source://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. + # + # source://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. + # + # source://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. + # + # source://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. + # + # @return [Boolean] + # + # source://pry//lib/pry/slop/commands.rb#114 + def present?(key); end + + # Returns a nested Hash with Slop options and values. See Slop#to_hash. + # + # source://pry//lib/pry/slop/commands.rb#153 + def to_hash; end + + # Returns the help String. + # + # source://pry//lib/pry/slop/commands.rb#158 + def to_s; end + + private + + # Returns nothing. + # + # source://pry//lib/pry/slop/commands.rb#177 + def execute_arguments!(items); end + + # Returns nothing. + # + # source://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. +# +# source://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. +# +# source://pry//lib/pry/slop.rb#12 +class Pry::Slop::Error < ::StandardError; end + +# Raised when an argument does not match its intended match constraint. +# +# source://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. +# +# source://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. +# +# source://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. +# +# source://pry//lib/pry/slop.rb#15 +class Pry::Slop::MissingArgumentError < ::Pry::Slop::Error; end + +# Raised when an option is expected/required but not present. +# +# source://pry//lib/pry/slop.rb#18 +class Pry::Slop::MissingOptionError < ::Pry::Slop::Error; end + +# source://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. + # + # @return [Option] a new instance of Option + # + # source://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. + # + # @return [Boolean] + # + # source://pry//lib/pry/slop/option.rb#72 + def accepts_optional_argument?; end + + # Returns the value of attribute argument_in_value. + # + # source://pry//lib/pry/slop/option.rb#23 + def argument_in_value; end + + # Sets the attribute argument_in_value + # + # @param value the value to set the attribute argument_in_value to. + # + # source://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. + # + # source://pry//lib/pry/slop/option.rb#84 + def call(*objects); end + + # Returns the value of attribute config. + # + # source://pry//lib/pry/slop/option.rb#22 + def config; end + + # Returns the value of attribute count. + # + # source://pry//lib/pry/slop/option.rb#23 + def count; end + + # Sets the attribute count + # + # @param value the value to set the attribute count to. + # + # source://pry//lib/pry/slop/option.rb#23 + def count=(_arg0); end + + # Returns the value of attribute description. + # + # source://pry//lib/pry/slop/option.rb#22 + def description; end + + # Returns true if this option expects an argument. + # + # @return [Boolean] + # + # source://pry//lib/pry/slop/option.rb#67 + def expects_argument?; end + + # Returns the help String for this option. + # + # source://pry//lib/pry/slop/option.rb#124 + def help; end + + # Returns the String inspection text. + # + # source://pry//lib/pry/slop/option.rb#143 + def inspect; end + + # Returns the String flag of this option. Preferring the long flag. + # + # source://pry//lib/pry/slop/option.rb#77 + def key; end + + # Returns the value of attribute long. + # + # source://pry//lib/pry/slop/option.rb#22 + def long; end + + # Returns the value of attribute short. + # + # source://pry//lib/pry/slop/option.rb#22 + def short; end + + # Returns the help String for this option. + # + # source://pry//lib/pry/slop/option.rb#124 + def to_s; end + + # Returns the value of attribute types. + # + # source://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. + # + # source://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. + # + # source://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. + # + # source://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. + # + # source://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. + # + # source://pry//lib/pry/slop/option.rb#190 + def value_to_range(value); end +end + +# The default Hash of configuration options this class uses. +# +# source://pry//lib/pry/slop/option.rb#7 +Pry::Slop::Option::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://pry//lib/pry/slop.rb#9 +Pry::Slop::VERSION = T.let(T.unsafe(nil), String) + +# @api private +# @since v0.13.0 +# +# source://pry//lib/pry/syntax_highlighter.rb#8 +class Pry::SyntaxHighlighter + class << self + # @api private + # @since v0.13.0 + # + # source://pry//lib/pry/syntax_highlighter.rb#9 + def highlight(code, language = T.unsafe(nil)); end + + # @api private + # @since v0.13.0 + # + # source://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. + # + # @api private + # @since v0.13.0 + # + # source://pry//lib/pry/syntax_highlighter.rb#22 + def overwrite_coderay_comment_token!; end + + # @api private + # @since v0.13.0 + # + # source://pry//lib/pry/syntax_highlighter.rb#13 + def tokenize(code, language = T.unsafe(nil)); end + end +end + +# @api private +# @since v0.13.0 +# +# source://pry//lib/pry/system_command_handler.rb#6 +module Pry::SystemCommandHandler + class << self + # @api private + # @since v0.13.0 + # + # source://pry//lib/pry/system_command_handler.rb#8 + def default(output, command, _pry_instance); end + end +end + +# Catches SecurityErrors if $SAFE is set +# +# source://pry//lib/pry/exceptions.rb#28 +module Pry::TooSafeException + class << self + # source://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' +# +# source://pry//lib/pry/exceptions.rb#51 +module Pry::UserError; end + +# source://pry//lib/pry/version.rb#4 +Pry::VERSION = T.let(T.unsafe(nil), String) + +# @api private +# @since v0.13.0 +# +# source://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. + # + # @api private + # @param message [String] + # @return [void] + # @since v0.13.0 + # + # source://pry//lib/pry/warning.rb#12 + def warn(message); end + end +end + +# source://pry//lib/pry/wrapped_module.rb#16 +class Pry::WrappedModule + include ::Pry::Helpers::BaseHelpers + include ::Pry::CodeObject::Helpers + + # @param mod [Module] + # @raise [ArgumentError] if the argument is not a `Module` + # @return [WrappedModule] a new instance of WrappedModule + # + # source://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. + # + # @param rank [Fixnum] + # @raise [Pry::CommandError] If the `rank` is out of range. That + # is greater than `number_of_candidates - 1`. + # @return [Pry::WrappedModule::Candidate] + # + # source://pry//lib/pry/wrapped_module.rb#239 + def candidate(rank); end + + # @return [Array] + # + # source://pry//lib/pry/wrapped_module.rb#250 + def candidates; end + + # Is this strictly a class? + # + # @return [Boolean] + # + # source://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 inherit [Boolean] Include the names of constants from included + # modules? + # + # source://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. + # + # source://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). + # + # source://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). + # + # source://pry//lib/pry/wrapped_module.rb#183 + def line; end + + # Forward method invocations to the wrapped module + # + # source://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 + # + # source://pry//lib/pry/wrapped_module.rb#85 + def method_prefix; end + + # Is this strictly a module? (does not match classes) + # + # @return [Boolean] + # + # source://pry//lib/pry/wrapped_module.rb#120 + def module?; end + + # The name of the Module if it has one, otherwise #. + # + # @return [String] + # + # source://pry//lib/pry/wrapped_module.rb#100 + def nonblank_name; end + + # @return [Fixnum] The number of candidate definitions for the + # current module. + # + # source://pry//lib/pry/wrapped_module.rb#245 + def number_of_candidates; end + + # Is this a singleton class? + # + # @return [Boolean] + # + # source://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] + # + # source://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. + # + # source://pry//lib/pry/wrapped_module.rb#206 + def source; end + + # @return [String, nil] The associated file for the module (i.e + # the primary candidate: highest ranked monkeypatch). + # + # source://pry//lib/pry/wrapped_module.rb#176 + def source_file; end + + # @return [Fixnum, nil] The associated line for the module (i.e + # the primary candidate: highest ranked monkeypatch). + # + # source://pry//lib/pry/wrapped_module.rb#183 + 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. + # + # source://pry//lib/pry/wrapped_module.rb#168 + def source_location; end + + # @param times [Fixnum] 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. + # + # source://pry//lib/pry/wrapped_module.rb#270 + def super(times = T.unsafe(nil)); end + + # Returns the value of attribute wrapped. + # + # source://pry//lib/pry/wrapped_module.rb#20 + def wrapped; end + + # @return [String] Return the YARD docs for this module. + # + # source://pry//lib/pry/wrapped_module.rb#223 + def yard_doc; end + + # @return [Boolean] Whether YARD docs are available for this module. + # + # source://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. + # + # source://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. + # + # source://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] + # + # source://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] + # + # source://pry//lib/pry/wrapped_module.rb#329 + def all_relevant_methods_for(mod); end + + # A helper method. + # + # source://pry//lib/pry/wrapped_module.rb#310 + def all_source_locations_by_popularity; end + + # memoized lines for file + # + # source://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. + # + # source://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. + # + # @return [Boolean] + # + # source://pry//lib/pry/wrapped_module.rb#366 + def method_defined_by_forwardable_module?(method); end + + # @return [Boolean] + # + # source://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 absense of a suitable candidate, the + # candidate of rank 0 will be returned, or a CommandError raised if + # there are no candidates at all. + # + # source://pry//lib/pry/wrapped_module.rb#292 + def primary_candidate; end + + # @return [Boolean] + # + # source://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. + # + # @example + # Pry::WrappedModule.from_str("Pry::Code") + # @param mod_name [String] + # @param target [Binding] The binding where the lookup takes place. + # @return [Module, nil] The module or `nil` (if conversion failed). + # + # source://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 str [String] The string to lookup. + # @param target [Binding] Where the lookup takes place. + # @return [Boolean] + # + # source://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. +# +# source://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 + + # @param wrapper [Pry::WrappedModule] The associated + # `Pry::WrappedModule` instance that owns the candidates. + # @param rank [Fixnum] 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` + # @raise [Pry::CommandError] If `rank` is out of bounds. + # @return [Candidate] a new instance of Candidate + # + # source://pry//lib/pry/wrapped_module/candidate.rb#38 + def initialize(wrapper, rank); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def class?(*args, **_arg1, &block); end + + # @raise [Pry::CommandError] If documentation cannot be found. + # @return [String] The documentation for the candidate. + # + # source://pry//lib/pry/wrapped_module/candidate.rb#70 + def doc; end + + # @return [String] The file where the module definition is located. + # + # source://pry//lib/pry/wrapped_module/candidate.rb#14 + def file; end + + # @return [Fixnum] The line where the module definition is located. + # + # source://pry//lib/pry/wrapped_module/candidate.rb#18 + def line; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def module?(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def nonblank_name(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + 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. + # + # source://pry//lib/pry/wrapped_module/candidate.rb#59 + def source; end + + # @return [String] The file where the module definition is located. + # + # source://pry//lib/pry/wrapped_module/candidate.rb#14 + def source_file; end + + # @return [Fixnum] The line where the module definition is located. + # + # source://pry//lib/pry/wrapped_module/candidate.rb#18 + 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. + # + # source://pry//lib/pry/wrapped_module/candidate.rb#79 + def source_location; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def wrapped(*args, **_arg1, &block); end + + private + + # Locate the first line of the module definition. + # + # @param file [String] The file that contains the module + # definition (somewhere). + # @param line [Fixnum] 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. + # + # source://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. + # + # source://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. + # + # source://pry//lib/pry/wrapped_module/candidate.rb#122 + def last_method_source_location; end + + # source://pry//lib/pry/forwardable.rb#18 + def lines_for_file(*a, &b); end + + # source://pry//lib/pry/forwardable.rb#18 + def method_candidates(*a, &b); end + + # @return [Boolean] + # + # source://pry//lib/pry/wrapped_module/candidate.rb#104 + def module_definition_first_line?(line); end + + # source://pry//lib/pry/forwardable.rb#18 + 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. + # + # source://pry//lib/pry/wrapped_module/candidate.rb#132 + def number_of_lines_in_first_chunk; end + + # source://pry//lib/pry/forwardable.rb#18 + def yard_docs?(*a, &b); end +end diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/rack-protection@3.2.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rack-protection@3.2.0.rbi new file mode 100644 index 0000000..0832cf2 --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rack-protection@3.2.0.rbi @@ -0,0 +1,905 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rack-protection` gem. +# Please instead update this file by running `bin/tapioca gem rack-protection`. + + +# source://rack-protection//lib/rack/protection/version.rb#3 +module Rack + class << self + # source://rack/2.2.9/lib/rack/version.rb#26 + def release; end + + # source://rack/2.2.9/lib/rack/version.rb#19 + def version; end + end +end + +# source://rack-protection//lib/rack/protection/version.rb#4 +module Rack::Protection + class << self + # source://rack-protection//lib/rack/protection.rb#28 + def new(app, options = T.unsafe(nil)); end + end +end + +# Prevented attack:: CSRF +# Supported browsers:: all +# More infos:: http://en.wikipedia.org/wiki/Cross-site_request_forgery +# +# This middleware only accepts requests other than GET, +# HEAD, OPTIONS, TRACE if their given access +# token matches the token included in the session. +# +# It checks the X-CSRF-Token header and the POST form +# data. +# +# It is not OOTB-compatible with the {rack-csrf}[https://rubygems.org/gems/rack_csrf] gem. +# For that, the following patch needs to be applied: +# +# Rack::Protection::AuthenticityToken.default_options(key: "csrf.token", authenticity_param: "_csrf") +# +# == Options +# +# [:authenticity_param] the name of the param that should contain +# the token on a request. Default value: +# "authenticity_token" +# +# [:key] the name of the param that should contain +# the token in the session. Default value: +# :csrf +# +# [:allow_if] a proc for custom allow/deny logic. Default value: +# nil +# +# == Example: Forms application +# +# To show what the AuthenticityToken does, this section includes a sample +# program which shows two forms. One with, and one without a CSRF token +# The one without CSRF token field will get a 403 Forbidden response. +# +# Install the gem, then run the program: +# +# gem install 'rack-protection' +# ruby server.rb +# +# Here is server.rb: +# +# require 'rack/protection' +# +# app = Rack::Builder.app do +# use Rack::Session::Cookie, secret: 'secret' +# use Rack::Protection::AuthenticityToken +# +# run -> (env) do +# [200, {}, [ +# <<~EOS +# +# +# +# +# rack-protection minimal example +# +# +#

Without Authenticity Token

+#

This takes you to Forbidden

+#
+# +# +#
+# +#

With Authenticity Token

+#

This successfully takes you to back to this form.

+#
+# +# +# +#
+# +# +# EOS +# ]] +# end +# end +# +# Rack::Handler::WEBrick.run app +# +# == Example: Customize which POST parameter holds the token +# +# To customize the authenticity parameter for form data, use the +# :authenticity_param option: +# use Rack::Protection::AuthenticityToken, authenticity_param: 'your_token_param_name' +# +# source://rack-protection//lib/rack/protection/authenticity_token.rb#97 +class Rack::Protection::AuthenticityToken < ::Rack::Protection::Base + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/authenticity_token.rb#112 + def accepts?(env); end + + # source://rack-protection//lib/rack/protection/base.rb#24 + def default_options; end + + # source://rack-protection//lib/rack/protection/authenticity_token.rb#124 + def mask_authenticity_token(session, path: T.unsafe(nil), method: T.unsafe(nil)); end + + private + + # source://rack-protection//lib/rack/protection/authenticity_token.rb#206 + def compare_with_global_token(token, session); end + + # source://rack-protection//lib/rack/protection/authenticity_token.rb#210 + def compare_with_per_form_token(token, session, request); end + + # source://rack-protection//lib/rack/protection/authenticity_token.rb#202 + def compare_with_real_token(token, session); end + + # source://rack-protection//lib/rack/protection/authenticity_token.rb#231 + def decode_token(token); end + + # source://rack-protection//lib/rack/protection/authenticity_token.rb#227 + def encode_token(token); end + + # source://rack-protection//lib/rack/protection/authenticity_token.rb#219 + def global_token(session); end + + # Creates a masked version of the authenticity token that varies + # on each request. The masking is used to mitigate SSL attacks + # like BREACH. + # + # source://rack-protection//lib/rack/protection/authenticity_token.rb#177 + def mask_token(token); end + + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/authenticity_token.rb#198 + def masked_token?(token); end + + # source://rack-protection//lib/rack/protection/authenticity_token.rb#223 + def per_form_token(session, path, method); end + + # source://rack-protection//lib/rack/protection/authenticity_token.rb#215 + def real_token(session); end + + # source://rack-protection//lib/rack/protection/authenticity_token.rb#141 + def set_token(session); end + + # source://rack-protection//lib/rack/protection/authenticity_token.rb#235 + def token_hmac(session, identifier); end + + # Essentially the inverse of +mask_token+. + # + # source://rack-protection//lib/rack/protection/authenticity_token.rb#185 + def unmask_token(masked_token); end + + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/authenticity_token.rb#194 + def unmasked_token?(token); end + + # Checks the client's masked token to see if it matches the + # session token. + # + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/authenticity_token.rb#147 + def valid_token?(env, token); end + + # source://rack-protection//lib/rack/protection/authenticity_token.rb#243 + def xor_byte_strings(s1, s2); end + + class << self + # source://rack-protection//lib/rack/protection/authenticity_token.rb#108 + def random_token; end + + # source://rack-protection//lib/rack/protection/authenticity_token.rb#104 + def token(session, path: T.unsafe(nil), method: T.unsafe(nil)); end + end +end + +# source://rack-protection//lib/rack/protection/authenticity_token.rb#136 +Rack::Protection::AuthenticityToken::GLOBAL_TOKEN_IDENTIFIER = T.let(T.unsafe(nil), String) + +# source://rack-protection//lib/rack/protection/authenticity_token.rb#98 +Rack::Protection::AuthenticityToken::TOKEN_LENGTH = T.let(T.unsafe(nil), Integer) + +# source://rack-protection//lib/rack/protection/base.rb#11 +class Rack::Protection::Base + # @return [Base] a new instance of Base + # + # source://rack-protection//lib/rack/protection/base.rb#35 + def initialize(app, options = T.unsafe(nil)); end + + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/base.rb#44 + def accepts?(env); end + + # Returns the value of attribute app. + # + # source://rack-protection//lib/rack/protection/base.rb#21 + def app; end + + # source://rack-protection//lib/rack/protection/base.rb#48 + def call(env); end + + # source://rack-protection//lib/rack/protection/base.rb#31 + def default_options; end + + # source://rack-protection//lib/rack/protection/base.rb#75 + def default_reaction(env); end + + # source://rack-protection//lib/rack/protection/base.rb#75 + def deny(env); end + + # source://rack-protection//lib/rack/protection/base.rb#95 + def drop_session(env); end + + # source://rack-protection//lib/rack/protection/base.rb#123 + def encrypt(value); end + + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/base.rb#133 + def html?(headers); end + + # source://rack-protection//lib/rack/protection/base.rb#68 + def instrument(env); end + + # Returns the value of attribute options. + # + # source://rack-protection//lib/rack/protection/base.rb#21 + def options; end + + # source://rack-protection//lib/rack/protection/base.rb#113 + def origin(env); end + + # source://rack-protection//lib/rack/protection/base.rb#117 + def random_string(secure = T.unsafe(nil)); end + + # source://rack-protection//lib/rack/protection/base.rb#56 + def react(env); end + + # source://rack-protection//lib/rack/protection/base.rb#105 + def referrer(env); end + + # source://rack-protection//lib/rack/protection/base.rb#80 + def report(env); end + + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/base.rb#40 + def safe?(env); end + + # source://rack-protection//lib/rack/protection/base.rb#127 + def secure_compare(a, b); end + + # source://rack-protection//lib/rack/protection/base.rb#89 + def session(env); end + + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/base.rb#85 + def session?(env); end + + # source://rack-protection//lib/rack/protection/base.rb#61 + def warn(env, message); end + + class << self + # source://rack-protection//lib/rack/protection/base.rb#23 + def default_options(options); end + + # source://rack-protection//lib/rack/protection/base.rb#27 + def default_reaction(reaction); end + end +end + +# source://rack-protection//lib/rack/protection/base.rb#12 +Rack::Protection::Base::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# Prevented attack:: XSS and others +# Supported browsers:: Firefox 23+, Safari 7+, Chrome 25+, Opera 15+ +# +# Description:: Content Security Policy, a mechanism web applications +# can use to mitigate a broad class of content injection +# vulnerabilities, such as cross-site scripting (XSS). +# Content Security Policy is a declarative policy that lets +# the authors (or server administrators) of a web application +# inform the client about the sources from which the +# application expects to load resources. +# +# More info:: W3C CSP Level 1 : https://www.w3.org/TR/CSP1/ (deprecated) +# W3C CSP Level 2 : https://www.w3.org/TR/CSP2/ (current) +# W3C CSP Level 3 : https://www.w3.org/TR/CSP3/ (draft) +# https://developer.mozilla.org/en-US/docs/Web/Security/CSP +# http://caniuse.com/#search=ContentSecurityPolicy +# http://content-security-policy.com/ +# https://securityheaders.io +# https://scotthelme.co.uk/csp-cheat-sheet/ +# http://www.html5rocks.com/en/tutorials/security/content-security-policy/ +# +# Sets the 'Content-Security-Policy[-Report-Only]' header. +# +# Options: ContentSecurityPolicy configuration is a complex topic with +# several levels of support that has evolved over time. +# See the W3C documentation and the links in the more info +# section for CSP usage examples and best practices. The +# CSP3 directives in the 'NO_ARG_DIRECTIVES' constant need to be +# presented in the options hash with a boolean 'true' in order +# to be used in a policy. +# +# source://rack-protection//lib/rack/protection/content_security_policy.rb#39 +class Rack::Protection::ContentSecurityPolicy < ::Rack::Protection::Base + # source://rack-protection//lib/rack/protection/content_security_policy.rb#72 + def call(env); end + + # source://rack-protection//lib/rack/protection/content_security_policy.rb#53 + def csp_policy; end + + # source://rack-protection//lib/rack/protection/base.rb#24 + def default_options; end +end + +# source://rack-protection//lib/rack/protection/content_security_policy.rb#42 +Rack::Protection::ContentSecurityPolicy::DIRECTIVES = T.let(T.unsafe(nil), Array) + +# source://rack-protection//lib/rack/protection/content_security_policy.rb#50 +Rack::Protection::ContentSecurityPolicy::NO_ARG_DIRECTIVES = T.let(T.unsafe(nil), Array) + +# Prevented attack:: Cookie Tossing +# Supported browsers:: all +# More infos:: https://github.com/blog/1466-yummy-cookies-across-domains +# +# Does not accept HTTP requests if the HTTP_COOKIE header contains more than one +# session cookie. This does not protect against a cookie overflow attack. +# +# Options: +# +# session_key:: The name of the session cookie (default: 'rack.session') +# +# source://rack-protection//lib/rack/protection/cookie_tossing.rb#19 +class Rack::Protection::CookieTossing < ::Rack::Protection::Base + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/cookie_tossing.rb#30 + def accepts?(env); end + + # source://rack-protection//lib/rack/protection/cookie_tossing.rb#57 + def bad_cookies; end + + # source://rack-protection//lib/rack/protection/cookie_tossing.rb#22 + def call(env); end + + # source://rack-protection//lib/rack/protection/cookie_tossing.rb#61 + def cookie_paths(path); end + + # source://rack-protection//lib/rack/protection/base.rb#75 + def default_reaction(env); end + + # source://rack-protection//lib/rack/protection/cookie_tossing.rb#68 + def empty_cookie(host, path); end + + # source://rack-protection//lib/rack/protection/cookie_tossing.rb#51 + def redirect(env); end + + # source://rack-protection//lib/rack/protection/cookie_tossing.rb#42 + def remove_bad_cookies(request, response); end + + # source://rack-protection//lib/rack/protection/cookie_tossing.rb#72 + def session_key; end +end + +# Rack::Protection::EncryptedCookie provides simple cookie based session management. +# By default, the session is a Ruby Hash stored as base64 encoded marshalled +# data set to :key (default: rack.session). The object that encodes the +# session data is configurable and must respond to +encode+ and +decode+. +# Both methods must take a string and return a string. +# +# When the secret key is set, cookie data is checked for data integrity. +# The old_secret key is also accepted and allows graceful secret rotation. +# A legacy_hmac_secret is also accepted and is used to upgrade existing +# sessions to the new encryption scheme. +# +# There is also a legacy_hmac_coder option which can be set if a non-default +# coder was used for legacy session cookies. +# +# Example: +# +# use Rack::Protection::EncryptedCookie, +# :key => 'rack.session', +# :domain => 'foo.com', +# :path => '/', +# :expire_after => 2592000, +# :secret => 'change_me', +# :old_secret => 'old_secret' +# +# All parameters are optional. +# +# Example using legacy HMAC options +# +# Rack::Protection:EncryptedCookie.new(application, { +# # The secret used for legacy HMAC cookies +# legacy_hmac_secret: 'legacy secret', +# # legacy_hmac_coder will default to Rack::Protection::EncryptedCookie::Base64::Marshal +# legacy_hmac_coder: Rack::Protection::EncryptedCookie::Identity.new, +# # legacy_hmac will default to OpenSSL::Digest::SHA1 +# legacy_hmac: OpenSSL::Digest::SHA256 +# }) +# +# +# Rack::Protection::EncryptedCookie.new(application, { +# :coder => Rack::Protection::EncryptedCookie::Identity.new +# }) +# +# +# Rack::Protection::EncryptedCookie.new(application, { +# :coder => Class.new { +# def encode(str); str.reverse; end +# def decode(str); str.reverse; end +# }.new +# }) +# +# source://rack-protection//lib/rack/protection/encrypted_cookie.rb#64 +class Rack::Protection::EncryptedCookie < ::Rack::Session::Abstract::Persisted + # @return [EncryptedCookie] a new instance of EncryptedCookie + # + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#143 + def initialize(app, options = T.unsafe(nil)); end + + # Returns the value of attribute coder. + # + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#141 + def coder; end + + private + + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#252 + def delete_session(_req, _session_id, options); end + + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#257 + def digest_match?(data, digest); end + + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#200 + def extract_session_id(request); end + + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#194 + def find_session(req, _sid); end + + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#263 + def generate_hmac(data); end + + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#230 + def persistent_session_id!(data, sid = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#267 + def secure?(options); end + + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#204 + def unpacked_cookie_data(request); end + + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#236 + def write_session(req, session_id, session, _options); end +end + +# Encode session cookies as Base64 +# +# source://rack-protection//lib/rack/protection/encrypted_cookie.rb#66 +class Rack::Protection::EncryptedCookie::Base64 + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#71 + def decode(str); end + + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#67 + def encode(str); end +end + +# N.B. Unlike other encoding methods, the contained objects must be a +# valid JSON composite type, either a Hash or an Array. +# +# source://rack-protection//lib/rack/protection/encrypted_cookie.rb#94 +class Rack::Protection::EncryptedCookie::Base64::JSON < ::Rack::Protection::EncryptedCookie::Base64 + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#99 + def decode(str); end + + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#95 + def encode(obj); end +end + +# Encode session cookies as Marshaled Base64 data +# +# source://rack-protection//lib/rack/protection/encrypted_cookie.rb#76 +class Rack::Protection::EncryptedCookie::Base64::Marshal < ::Rack::Protection::EncryptedCookie::Base64 + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#81 + def decode(str); end + + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#77 + def encode(str); end +end + +# source://rack-protection//lib/rack/protection/encrypted_cookie.rb#110 +class Rack::Protection::EncryptedCookie::Base64::ZipJSON < ::Rack::Protection::EncryptedCookie::Base64 + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#115 + def decode(str); end + + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#111 + def encode(obj); end +end + +# Use no encoding for session cookies +# +# source://rack-protection//lib/rack/protection/encrypted_cookie.rb#126 +class Rack::Protection::EncryptedCookie::Identity + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#128 + def decode(str); end + + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#127 + def encode(str); end +end + +# source://rack-protection//lib/rack/protection/encrypted_cookie.rb#131 +class Rack::Protection::EncryptedCookie::Marshal + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#136 + def decode(str); end + + # source://rack-protection//lib/rack/protection/encrypted_cookie.rb#132 + def encode(str); end +end + +# source://rack-protection//lib/rack/protection/encryptor.rb#7 +module Rack::Protection::Encryptor + class << self + # source://rack-protection//lib/rack/protection/encryptor.rb#15 + def base64_decode(str); end + + # source://rack-protection//lib/rack/protection/encryptor.rb#11 + def base64_encode(str); end + + # source://rack-protection//lib/rack/protection/encryptor.rb#38 + def decrypt_message(data, secret); end + + # @raise [ArgumentError] + # + # source://rack-protection//lib/rack/protection/encryptor.rb#19 + def encrypt_message(data, secret, auth_data = T.unsafe(nil)); end + end +end + +# source://rack-protection//lib/rack/protection/encryptor.rb#8 +Rack::Protection::Encryptor::CIPHER = T.let(T.unsafe(nil), String) + +# source://rack-protection//lib/rack/protection/encryptor.rb#9 +Rack::Protection::Encryptor::DELIMITER = T.let(T.unsafe(nil), String) + +# Prevented attack:: XSS +# Supported browsers:: all +# More infos:: http://en.wikipedia.org/wiki/Cross-site_scripting +# +# Automatically escapes Rack::Request#params so they can be embedded in HTML +# or JavaScript without any further issues. +# +# Options: +# escape:: What escaping modes to use, should be Symbol or Array of Symbols. +# Available: :html (default), :javascript, :url +# +# source://rack-protection//lib/rack/protection/escaped_params.rb#25 +class Rack::Protection::EscapedParams < ::Rack::Protection::Base + extend ::Rack::Utils + + # @return [EscapedParams] a new instance of EscapedParams + # + # source://rack-protection//lib/rack/protection/escaped_params.rb#36 + def initialize(*_arg0); end + + # source://rack-protection//lib/rack/protection/escaped_params.rb#50 + def call(env); end + + # source://rack-protection//lib/rack/protection/base.rb#24 + def default_options; end + + # source://rack-protection//lib/rack/protection/escaped_params.rb#70 + def escape(object); end + + # source://rack-protection//lib/rack/protection/escaped_params.rb#79 + def escape_hash(hash); end + + # source://rack-protection//lib/rack/protection/escaped_params.rb#85 + def escape_string(str); end + + # source://rack-protection//lib/rack/protection/escaped_params.rb#64 + def handle(hash); end + + class << self + # source://rack/2.2.9/lib/rack/utils.rb#184 + def escape_html(string); end + + private + + # source://rack/2.2.9/lib/rack/utils.rb#38 + def escape_url(s); end + end +end + +# Prevented attack:: CSRF +# Supported browsers:: all +# More infos:: http://en.wikipedia.org/wiki/Cross-site_request_forgery +# +# Only accepts submitted forms if a given access token matches the token +# included in the session. Does not expect such a token from Ajax request. +# +# This middleware is not used when using the Rack::Protection collection, +# since it might be a security issue, depending on your application +# +# Compatible with rack-csrf. +# +# source://rack-protection//lib/rack/protection/form_token.rb#19 +class Rack::Protection::FormToken < ::Rack::Protection::AuthenticityToken + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/form_token.rb#20 + def accepts?(env); end +end + +# Prevented attack:: Clickjacking +# Supported browsers:: Internet Explorer 8, Firefox 3.6.9, Opera 10.50, +# Safari 4.0, Chrome 4.1.249.1042 and later +# More infos:: https://developer.mozilla.org/en/The_X-FRAME-OPTIONS_response_header +# +# Sets X-Frame-Options header to tell the browser avoid embedding the page +# in a frame. +# +# Options: +# +# frame_options:: Defines who should be allowed to embed the page in a +# frame. Use :deny to forbid any embedding, :sameorigin +# to allow embedding from the same origin (default). +# +# source://rack-protection//lib/rack/protection/frame_options.rb#21 +class Rack::Protection::FrameOptions < ::Rack::Protection::Base + # source://rack-protection//lib/rack/protection/frame_options.rb#32 + def call(env); end + + # source://rack-protection//lib/rack/protection/base.rb#24 + def default_options; end + + # source://rack-protection//lib/rack/protection/frame_options.rb#24 + def frame_options; end +end + +# Prevented attack:: CSRF +# Supported browsers:: Google Chrome 2, Safari 4 and later +# More infos:: http://en.wikipedia.org/wiki/Cross-site_request_forgery +# http://tools.ietf.org/html/draft-abarth-origin +# +# Does not accept unsafe HTTP requests when value of Origin HTTP request header +# does not match default or permitted URIs. +# +# If you want to permit a specific domain, you can pass in as the `:permitted_origins` option: +# +# use Rack::Protection, permitted_origins: ["http://localhost:3000", "http://127.0.01:3000"] +# +# The `:allow_if` option can also be set to a proc to use custom allow/deny logic. +# +# source://rack-protection//lib/rack/protection/http_origin.rb#21 +class Rack::Protection::HttpOrigin < ::Rack::Protection::Base + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/http_origin.rb#32 + def accepts?(env); end + + # source://rack-protection//lib/rack/protection/http_origin.rb#26 + def base_url(env); end + + # source://rack-protection//lib/rack/protection/base.rb#24 + def default_options; end + + # source://rack-protection//lib/rack/protection/base.rb#75 + def default_reaction(env); end +end + +# source://rack-protection//lib/rack/protection/http_origin.rb#22 +Rack::Protection::HttpOrigin::DEFAULT_PORTS = T.let(T.unsafe(nil), Hash) + +# Prevented attack:: IP spoofing +# Supported browsers:: all +# More infos:: http://blog.c22.cc/2011/04/22/surveymonkey-ip-spoofing/ +# +# Detect (some) IP spoofing attacks. +# +# source://rack-protection//lib/rack/protection/ip_spoofing.rb#13 +class Rack::Protection::IPSpoofing < ::Rack::Protection::Base + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/ip_spoofing.rb#16 + def accepts?(env); end + + # source://rack-protection//lib/rack/protection/base.rb#75 + def default_reaction(env); end +end + +# Prevented attack:: CSRF +# Supported browsers:: all +# More infos:: http://flask.pocoo.org/docs/0.10/security/#json-security +# http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx +# +# JSON GET APIs are vulnerable to being embedded as JavaScript when the +# Array prototype has been patched to track data. Checks the referrer +# even on GET requests if the content type is JSON. +# +# If request includes Origin HTTP header, defers to HttpOrigin to determine +# if the request is safe. Please refer to the documentation for more info. +# +# The `:allow_if` option can be set to a proc to use custom allow/deny logic. +# +# source://rack-protection//lib/rack/protection/json_csrf.rb#21 +class Rack::Protection::JsonCsrf < ::Rack::Protection::Base + # source://rack-protection//lib/rack/protection/json_csrf.rb#26 + def call(env); end + + # source://rack-protection//lib/rack/protection/json_csrf.rb#55 + def close_body(body); end + + # source://rack-protection//lib/rack/protection/base.rb#24 + def default_options; end + + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/json_csrf.rb#39 + def has_vector?(request, headers); end + + # source://rack-protection//lib/rack/protection/base.rb#75 + def react(env); end + + # source://rack-protection//lib/rack/protection/json_csrf.rb#47 + def react_and_close(env, body); end +end + +# Prevented attack:: Directory traversal +# Supported browsers:: all +# More infos:: http://en.wikipedia.org/wiki/Directory_traversal +# +# Unescapes '/' and '.', expands +path_info+. +# Thus GET /foo/%2e%2e%2fbar becomes GET /bar. +# +# source://rack-protection//lib/rack/protection/path_traversal.rb#14 +class Rack::Protection::PathTraversal < ::Rack::Protection::Base + # source://rack-protection//lib/rack/protection/path_traversal.rb#15 + def call(env); end + + # source://rack-protection//lib/rack/protection/path_traversal.rb#23 + def cleanup(path); end +end + +# Prevented attack:: Secret leakage, third party tracking +# Supported browsers:: mixed support +# More infos:: https://www.w3.org/TR/referrer-policy/ +# https://caniuse.com/#search=referrer-policy +# +# Sets Referrer-Policy header to tell the browser to limit the Referer header. +# +# Options: +# referrer_policy:: The policy to use (default: 'strict-origin-when-cross-origin') +# +# source://rack-protection//lib/rack/protection/referrer_policy.rb#17 +class Rack::Protection::ReferrerPolicy < ::Rack::Protection::Base + # source://rack-protection//lib/rack/protection/referrer_policy.rb#20 + def call(env); end + + # source://rack-protection//lib/rack/protection/base.rb#24 + def default_options; end +end + +# Prevented attack:: CSRF +# Supported browsers:: all +# More infos:: http://en.wikipedia.org/wiki/Cross-site_request_forgery +# +# Does not accept unsafe HTTP requests if the Referer [sic] header is set to +# a different host. +# +# source://rack-protection//lib/rack/protection/remote_referrer.rb#14 +class Rack::Protection::RemoteReferrer < ::Rack::Protection::Base + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/remote_referrer.rb#17 + def accepts?(env); end + + # source://rack-protection//lib/rack/protection/base.rb#75 + def default_reaction(env); end +end + +# Prevented attack:: CSRF +# Supported browsers:: all +# More infos:: http://en.wikipedia.org/wiki/Cross-site_request_forgery +# +# Only accepts unsafe HTTP requests if a given access token matches the token +# included in the session *or* the request comes from the same origin. +# +# Compatible with rack-csrf. +# +# source://rack-protection//lib/rack/protection/remote_token.rb#16 +class Rack::Protection::RemoteToken < ::Rack::Protection::AuthenticityToken + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/remote_token.rb#19 + def accepts?(env); end + + # source://rack-protection//lib/rack/protection/base.rb#75 + def default_reaction(env); end +end + +# Prevented attack:: Session Hijacking +# Supported browsers:: all +# More infos:: http://en.wikipedia.org/wiki/Session_hijacking +# +# Tracks request properties like the user agent in the session and empties +# the session if those properties change. This essentially prevents attacks +# from Firesheep. Since all headers taken into consideration can be +# spoofed, too, this will not prevent determined hijacking attempts. +# +# source://rack-protection//lib/rack/protection/session_hijacking.rb#16 +class Rack::Protection::SessionHijacking < ::Rack::Protection::Base + # @return [Boolean] + # + # source://rack-protection//lib/rack/protection/session_hijacking.rb#21 + def accepts?(env); end + + # source://rack-protection//lib/rack/protection/base.rb#24 + def default_options; end + + # source://rack-protection//lib/rack/protection/base.rb#95 + def default_reaction(env); end + + # source://rack-protection//lib/rack/protection/session_hijacking.rb#32 + def encode(value); end +end + +# Prevented attack:: Protects against against protocol downgrade attacks and cookie hijacking. +# Supported browsers:: all +# More infos:: https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security +# +# browser will prevent any communications from being sent over HTTP +# to the specified domain and will instead send all communications over HTTPS. +# It also prevents HTTPS click through prompts on browsers. +# +# Options: +# +# max_age:: How long future requests to the domain should go over HTTPS; specified in seconds +# include_subdomains:: If all present and future subdomains will be HTTPS +# preload:: Allow this domain to be included in browsers HSTS preload list. See https://hstspreload.appspot.com/ +# +# source://rack-protection//lib/rack/protection/strict_transport.rb#22 +class Rack::Protection::StrictTransport < ::Rack::Protection::Base + # source://rack-protection//lib/rack/protection/strict_transport.rb#34 + def call(env); end + + # source://rack-protection//lib/rack/protection/base.rb#24 + def default_options; end + + # source://rack-protection//lib/rack/protection/strict_transport.rb#25 + def strict_transport; end +end + +# source://rack-protection//lib/rack/protection/version.rb#5 +Rack::Protection::VERSION = T.let(T.unsafe(nil), String) + +# Prevented attack:: Non-permanent XSS +# Supported browsers:: Internet Explorer 8+ and Chrome +# More infos:: http://blogs.msdn.com/b/ie/archive/2008/07/01/ie8-security-part-iv-the-xss-filter.aspx +# +# Sets X-XSS-Protection header to tell the browser to block attacks. +# +# Options: +# xss_mode:: How the browser should prevent the attack (default: :block) +# +# source://rack-protection//lib/rack/protection/xss_header.rb#16 +class Rack::Protection::XSSHeader < ::Rack::Protection::Base + # source://rack-protection//lib/rack/protection/xss_header.rb#19 + def call(env); end + + # source://rack-protection//lib/rack/protection/base.rb#24 + def default_options; end +end diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/rack-test@2.1.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rack-test@2.1.0.rbi new file mode 100644 index 0000000..fc5a7fa --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rack-test@2.1.0.rbi @@ -0,0 +1,750 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rack-test` gem. +# Please instead update this file by running `bin/tapioca gem rack-test`. + + +# source://rack-test//lib/rack/test/cookie_jar.rb#6 +module Rack + class << self + # source://rack/2.2.9/lib/rack/version.rb#26 + def release; end + + # source://rack/2.2.9/lib/rack/version.rb#19 + def version; end + end +end + +# For backwards compatibility with 1.1.0 and below +# +# source://rack-test//lib/rack/test.rb#381 +Rack::MockSession = Rack::Test::Session + +# source://rack-test//lib/rack/test/cookie_jar.rb#7 +module Rack::Test + class << self + # Whether the version of rack in use handles encodings. + # + # @return [Boolean] + # + # source://rack-test//lib/rack/test.rb#375 + def encoding_aware_strings?; end + end +end + +# Represents individual cookies in the cookie jar. This is considered private +# API and behavior of this class can change at any time. +# +# source://rack-test//lib/rack/test/cookie_jar.rb#10 +class Rack::Test::Cookie + include ::Rack::Utils + + # @return [Cookie] a new instance of Cookie + # + # source://rack-test//lib/rack/test/cookie_jar.rb#23 + def initialize(raw, uri = T.unsafe(nil), default_host = T.unsafe(nil)); end + + # Order cookies by name, path, and domain. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#107 + def <=>(other); end + + # The explicit or implicit domain for the cookie. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#59 + def domain; end + + # Whether the cookie has a value. + # + # @return [Boolean] + # + # source://rack-test//lib/rack/test/cookie_jar.rb#54 + def empty?; end + + # Whether the cookie is currently expired. + # + # @return [Boolean] + # + # source://rack-test//lib/rack/test/cookie_jar.rb#86 + def expired?; end + + # A Time value for when the cookie expires, if the expires option is set. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#81 + def expires; end + + # Whether the cookie has the httponly flag, indicating it is not available via + # a javascript API. + # + # @return [Boolean] + # + # source://rack-test//lib/rack/test/cookie_jar.rb#71 + def http_only?; end + + # Cookies that do not match the URI will not be sent in requests to the URI. + # + # @return [Boolean] + # + # source://rack-test//lib/rack/test/cookie_jar.rb#102 + def matches?(uri); end + + # The name of the cookie, will be a string + # + # source://rack-test//lib/rack/test/cookie_jar.rb#14 + def name; end + + # The explicit or implicit path for the cookie. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#76 + def path; end + + # The raw string for the cookie, without options. Will generally be in + # name=value format is name and value are provided. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#21 + def raw; end + + # Wether the given cookie can replace the current cookie in the cookie jar. + # + # @return [Boolean] + # + # source://rack-test//lib/rack/test/cookie_jar.rb#49 + def replaces?(other); end + + # Whether the cookie has the secure flag, indicating it can only be sent over + # an encrypted connection. + # + # @return [Boolean] + # + # source://rack-test//lib/rack/test/cookie_jar.rb#65 + def secure?; end + + # A hash of cookie options, including the cookie value, but excluding the cookie name. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#112 + def to_h; end + + # A hash of cookie options, including the cookie value, but excluding the cookie name. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#112 + def to_hash; end + + # Whether the cookie is valid for the given URI. + # + # @return [Boolean] + # + # source://rack-test//lib/rack/test/cookie_jar.rb#91 + def valid?(uri); end + + # The value of the cookie, will be a string or nil if there is no value. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#17 + def value; end + + private + + # The default URI to use for the cookie, including just the host. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#124 + def default_uri; end +end + +# Represents all cookies for a session, handling adding and +# removing cookies, and finding which cookies apply to a given +# request. This is considered private API and behavior of this +# class can change at any time. +# +# source://rack-test//lib/rack/test/cookie_jar.rb#133 +class Rack::Test::CookieJar + # @return [CookieJar] a new instance of CookieJar + # + # source://rack-test//lib/rack/test/cookie_jar.rb#136 + def initialize(cookies = T.unsafe(nil), default_host = T.unsafe(nil)); end + + # Add a Cookie to the cookie jar. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#198 + def <<(new_cookie); end + + # Return the value for first cookie with the given name, or nil + # if no such cookie exists. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#149 + def [](name); end + + # Set a cookie with the given name and value in the + # cookie jar. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#159 + def []=(name, value); end + + # Delete all cookies with the given name from the cookie jar. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#173 + def delete(name); end + + # Return a raw cookie string for the cookie header to + # use for the given URI. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#209 + def for(uri); end + + # Return the first cookie with the given name, or nil if + # no such cookie exists. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#165 + def get_cookie(name); end + + # Add a string of raw cookie information to the cookie jar, + # if the cookie is valid for the given URI. + # Cookies should be separated with a newline. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#183 + def merge(raw_cookies, uri = T.unsafe(nil)); end + + # Return a hash cookie names and cookie values for cookies in the jar. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#226 + def to_hash; end + + private + + # Yield each cookie that matches for the URI. + # + # The cookies are sorted by most specific first. So, we loop through + # all the cookies in order and add it to a hash by cookie name if + # the cookie can be sent to the current URI. It's added to the hash + # so that when we are done, the cookies will be unique by name and + # we'll have grabbed the most specific to the URI. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#245 + def each_cookie_for(uri); end + + # Ensure the copy uses a distinct cookies array. + # + # source://rack-test//lib/rack/test/cookie_jar.rb#142 + def initialize_copy(other); end +end + +# source://rack-test//lib/rack/test/cookie_jar.rb#134 +Rack::Test::CookieJar::DELIMITER = T.let(T.unsafe(nil), String) + +# The default host to use for requests, when a full URI is not +# provided. +# +# source://rack-test//lib/rack/test.rb#33 +Rack::Test::DEFAULT_HOST = T.let(T.unsafe(nil), String) + +# The ending boundary in multipart requests +# +# source://rack-test//lib/rack/test.rb#42 +Rack::Test::END_BOUNDARY = T.let(T.unsafe(nil), String) + +# The common base class for exceptions raised by Rack::Test +# +# source://rack-test//lib/rack/test.rb#45 +class Rack::Test::Error < ::StandardError; end + +# The default multipart boundary to use for multipart request bodies +# +# source://rack-test//lib/rack/test.rb#36 +Rack::Test::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String) + +# This module serves as the primary integration point for using Rack::Test +# in a testing environment. It depends on an app method being defined in the +# same context, and provides the Rack::Test API methods (see Rack::Test::Session +# for their documentation). It defines the following methods that are delegated +# to the current session: :request, :get, :post, :put, :patch, :delete, :options, +# :head, :custom_request, :follow_redirect!, :header, :env, :set_cookie, +# :clear_cookies, :authorize, :basic_authorize, :last_response, and :last_request. +# +# Example: +# +# class HomepageTest < Test::Unit::TestCase +# include Rack::Test::Methods +# +# def app +# MyApp +# end +# end +# +# source://rack-test//lib/rack/test/methods.rb#24 +module Rack::Test::Methods + extend ::Forwardable + + # Private accessor to avoid uninitialized instance variable warning in Ruby 2.* + # + # source://rack-test//lib/rack/test/methods.rb#90 + def _rack_test_current_session=(_arg0); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def authorize(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def basic_authorize(*args, **_arg1, &block); end + + # Create a new Rack::Test::Session for #app. + # + # source://rack-test//lib/rack/test/methods.rb#40 + def build_rack_test_session(_name); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def clear_cookies(*args, **_arg1, &block); end + + # Return the currently actively session. This is the session to + # which the delegated methods are sent. + # + # source://rack-test//lib/rack/test/methods.rb#55 + def current_session; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def custom_request(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def delete(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def env(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def follow_redirect!(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def get(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def head(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def header(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def last_request(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def last_response(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def options(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def patch(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def post(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def put(*args, **_arg1, &block); end + + # Return the existing session with the given name, or a new + # rack session. Always use a new session if name is nil. + # For backwards compatibility with older rack-test versions. + # + # source://rack-test//lib/rack/test/methods.rb#29 + def rack_mock_session(name = T.unsafe(nil)); end + + # Return the existing session with the given name, or a new + # rack session. Always use a new session if name is nil. + # + # source://rack-test//lib/rack/test/methods.rb#29 + def rack_test_session(name = T.unsafe(nil)); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def request(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def set_cookie(*args, **_arg1, &block); end + + # Create a new session (or reuse an existing session with the given name), + # and make it the current session for the given block. + # + # source://rack-test//lib/rack/test/methods.rb#61 + def with_session(name); end + + private + + # Private accessor to avoid uninitialized instance variable warning in Ruby 2.* + # + # source://rack-test//lib/rack/test/methods.rb#90 + def _rack_test_current_session; end +end + +# The starting boundary in multipart requests +# +# source://rack-test//lib/rack/test.rb#39 +Rack::Test::START_BOUNDARY = T.let(T.unsafe(nil), String) + +# Rack::Test::Session handles a series of requests issued to a Rack app. +# It keeps track of the cookies for the session, and allows for setting headers +# and a default rack environment that is used for future requests. +# +# Rack::Test::Session's methods are most often called through Rack::Test::Methods, +# which will automatically build a session when it's first used. +# +# source://rack-test//lib/rack/test.rb#53 +class Rack::Test::Session + include ::Rack::Utils + include ::Rack::Test::Utils + extend ::Forwardable + + # Creates a Rack::Test::Session for a given Rack app or Rack::Test::BasicSession. + # + # Note: Generally, you won't need to initialize a Rack::Test::Session directly. + # Instead, you should include Rack::Test::Methods into your testing context. + # (See README.rdoc for an example) + # + # The following methods are defined via metaprogramming: get, post, put, patch, + # delete, options, and head. Each method submits a request with the given request + # method, with the given URI and optional parameters and rack environment. + # Examples: + # + # # URI only: + # get("/") # GET / + # get("/?foo=bar") # GET /?foo=bar + # + # # URI and parameters + # get("/foo", 'bar'=>'baz') # GET /foo?bar=baz + # post("/foo", 'bar'=>'baz') # POST /foo (bar=baz in request body) + # + # # URI, parameters, and rack environment + # get("/bar", {}, 'CONTENT_TYPE'=>'foo') + # get("/bar", {'foo'=>'baz'}, 'HTTP_ACCEPT'=>'*') + # + # The above methods as well as #request and #custom_request store the Rack::Request + # submitted in #last_request. The methods store a Rack::MockResponse based on the + # response in #last_response. #last_response is also returned by the methods. + # If a block is given, #last_response is also yielded to the block. + # + # @return [Session] a new instance of Session + # + # source://rack-test//lib/rack/test.rb#99 + def initialize(app, default_host = T.unsafe(nil)); end + + # Run a block after the each request completes. + # + # source://rack-test//lib/rack/test.rb#118 + def after_request(&block); end + + # Set the username and password for HTTP Basic authorization, to be + # included in subsequent requests in the HTTP_AUTHORIZATION header. + # + # Example: + # basic_authorize "bryan", "secret" + # + # source://rack-test//lib/rack/test.rb#198 + def authorize(username, password); end + + # Set the username and password for HTTP Basic authorization, to be + # included in subsequent requests in the HTTP_AUTHORIZATION header. + # + # Example: + # basic_authorize "bryan", "secret" + # + # source://rack-test//lib/rack/test.rb#198 + def basic_authorize(username, password); end + + # Replace the current cookie jar with an empty cookie jar. + # + # source://rack-test//lib/rack/test.rb#123 + def clear_cookies; end + + # The Rack::Test::CookieJar for the cookies for the current session. + # + # source://rack-test//lib/rack/test.rb#67 + def cookie_jar; end + + # The Rack::Test::CookieJar for the cookies for the current session. + # + # source://rack-test//lib/rack/test.rb#67 + def cookie_jar=(_arg0); end + + # Issue a request using the given HTTP verb for the given URI, with optional + # params and rack environment. Example: + # + # custom_request "LINK", "/" + # + # source://rack-test//lib/rack/test.rb#160 + def custom_request(verb, uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end + + # The default host used for the session for when using paths for URIs. + # + # source://rack-test//lib/rack/test.rb#70 + def default_host; end + + # source://rack-test//lib/rack/test.rb#111 + def delete(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end + + # Set an entry in the rack environment to be included on all subsequent + # requests through the session. Use a value of nil to remove a previously + # value. Example: + # + # env "rack.session", {:csrf => 'token'} + # + # source://rack-test//lib/rack/test.rb#185 + def env(name, value); end + + # Rack::Test will not follow any redirects automatically. This method + # will follow the redirect returned (including setting the Referer header + # on the new request) in the last response. If the last response was not + # a redirect, an error will be raised. + # + # source://rack-test//lib/rack/test.rb#209 + def follow_redirect!; end + + # source://rack-test//lib/rack/test.rb#111 + def get(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end + + # source://rack-test//lib/rack/test.rb#111 + def head(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end + + # Set a header to be included on all subsequent requests through the + # session. Use a value of nil to remove a previously configured header. + # + # In accordance with the Rack spec, headers will be included in the Rack + # environment hash in HTTP_USER_AGENT form. Example: + # + # header "user-agent", "Firefox" + # + # source://rack-test//lib/rack/test.rb#173 + def header(name, value); end + + # Return the last request issued in the session. Raises an error if no + # requests have been sent yet. + # + # @raise [Error] + # + # source://rack-test//lib/rack/test.rb#134 + def last_request; end + + # Return the last response received in the session. Raises an error if + # no requests have been sent yet. + # + # @raise [Error] + # + # source://rack-test//lib/rack/test.rb#141 + def last_response; end + + # source://rack-test//lib/rack/test.rb#111 + def options(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end + + # source://rack-test//lib/rack/test.rb#111 + def patch(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end + + # source://rack-test//lib/rack/test.rb#111 + def post(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end + + # source://rack-test//lib/rack/test.rb#111 + def put(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end + + # Issue a request to the Rack app for the given URI and optional Rack + # environment. Example: + # + # request "/" + # + # source://rack-test//lib/rack/test.rb#150 + def request(uri, env = T.unsafe(nil), &block); end + + # Yield to the block, and restore the last request, last response, and + # cookie jar to the state they were prior to block execution upon + # exiting the block. + # + # source://rack-test//lib/rack/test.rb#240 + def restore_state; end + + # Set a cookie in the current cookie jar. + # + # source://rack-test//lib/rack/test.rb#128 + def set_cookie(cookie, uri = T.unsafe(nil)); end + + private + + # Append a string version of the query params to the array of query params. + # + # source://rack-test//lib/rack/test.rb#340 + def append_query_params(query_array, query_params); end + + # close() gets called automatically in newer Rack versions. + # + # source://rack-test//lib/rack/test.rb#266 + def close_body(body); end + + # Update environment to use based on given URI. + # + # source://rack-test//lib/rack/test.rb#293 + def env_for(uri, env); end + + # Return the multipart content type to use based on the environment. + # + # source://rack-test//lib/rack/test.rb#346 + def multipart_content_type(env); end + + # Normalize URI based on given URI/path and environment. + # + # source://rack-test//lib/rack/test.rb#271 + def parse_uri(path, env); end + + # Submit the request with the given URI and rack environment to + # the mock session. Returns and potentially yields the last response. + # + # @yield [@last_response] + # + # source://rack-test//lib/rack/test.rb#357 + def process_request(uri, env); end + + class << self + # source://rack-test//lib/rack/test.rb#57 + def new(app, default_host = T.unsafe(nil)); end + end +end + +# source://rack-test//lib/rack/test.rb#279 +Rack::Test::Session::DEFAULT_ENV = T.let(T.unsafe(nil), Hash) + +# Wraps a Tempfile with a content type. Including one or more UploadedFile's +# in the params causes Rack::Test to build and issue a multipart request. +# +# Example: +# post "/photos", "file" => Rack::Test::UploadedFile.new("me.jpg", "image/jpeg") +# +# source://rack-test//lib/rack/test/uploaded_file.rb#14 +class Rack::Test::UploadedFile + # Creates a new UploadedFile instance. + # + # Arguments: + # content :: is a path to a file, or an {IO} or {StringIO} object representing the content. + # content_type :: MIME type of the file + # binary :: Whether the file should be set to binmode (content treated as binary). + # original_filename :: The filename to use for the file. Required if content is StringIO, optional override if not + # + # @return [UploadedFile] a new instance of UploadedFile + # + # source://rack-test//lib/rack/test/uploaded_file.rb#31 + def initialize(content, content_type = T.unsafe(nil), binary = T.unsafe(nil), original_filename: T.unsafe(nil)); end + + # Append to given buffer in 64K chunks to avoid multiple large + # copies of file data in memory. Rewind tempfile before and + # after to make sure all data in tempfile is appended to the + # buffer. + # + # source://rack-test//lib/rack/test/uploaded_file.rb#60 + def append_to(buffer); end + + # The content type of the "uploaded" file + # + # source://rack-test//lib/rack/test/uploaded_file.rb#22 + def content_type; end + + # The content type of the "uploaded" file + # + # source://rack-test//lib/rack/test/uploaded_file.rb#22 + def content_type=(_arg0); end + + # The path to the tempfile. Will not work if the receiver's content is from a StringIO. + # + # source://rack-test//lib/rack/test/uploaded_file.rb#46 + def local_path; end + + # Delegate all methods not handled to the tempfile. + # + # source://rack-test//lib/rack/test/uploaded_file.rb#52 + def method_missing(method_name, *args, &block); end + + # The filename, *not* including the path, of the "uploaded" file + # + # source://rack-test//lib/rack/test/uploaded_file.rb#16 + def original_filename; end + + # The path to the tempfile. Will not work if the receiver's content is from a StringIO. + # + # source://rack-test//lib/rack/test/uploaded_file.rb#46 + def path; end + + # The tempfile + # + # source://rack-test//lib/rack/test/uploaded_file.rb#19 + def tempfile; end + + private + + # Create a tempfile and copy the content from the given path into the tempfile, optionally renaming if + # original_filename has been set. + # + # source://rack-test//lib/rack/test/uploaded_file.rb#98 + def initialize_from_file_path(path); end + + # Use the StringIO as the tempfile. + # + # @raise [ArgumentError] + # + # source://rack-test//lib/rack/test/uploaded_file.rb#90 + def initialize_from_stringio(stringio); end + + # @return [Boolean] + # + # source://rack-test//lib/rack/test/uploaded_file.rb#71 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end + + class << self + # Close and unlink the given file, used as a finalizer for the tempfile, + # if the tempfile is backed by a file in the filesystem. + # + # source://rack-test//lib/rack/test/uploaded_file.rb#82 + def actually_finalize(file); end + + # A proc that can be used as a finalizer to close and unlink the tempfile. + # + # source://rack-test//lib/rack/test/uploaded_file.rb#76 + def finalize(file); end + end +end + +# source://rack-test//lib/rack/test/utils.rb#5 +module Rack::Test::Utils + include ::Rack::Utils + extend ::Rack::Utils + extend ::Rack::Test::Utils + + # Build a multipart body for the given params. + # + # @raise [ArgumentError] + # + # source://rack-test//lib/rack/test/utils.rb#34 + def build_multipart(params, _first = T.unsafe(nil), multipart = T.unsafe(nil)); end + + # Build a query string for the given value and prefix. The value + # can be an array or hash of parameters. + # + # source://rack-test//lib/rack/test/utils.rb#11 + def build_nested_query(value, prefix = T.unsafe(nil)); end + + private + + # Append each multipart parameter value to the buffer. + # + # source://rack-test//lib/rack/test/utils.rb#100 + def _build_parts(buffer, parameters); end + + # Append the multipart fragment for a parameter that is a file upload to the buffer. + # + # source://rack-test//lib/rack/test/utils.rb#133 + def build_file_part(buffer, parameter_name, uploaded_file); end + + # Build the multipart content for uploading. + # + # source://rack-test//lib/rack/test/utils.rb#94 + def build_parts(buffer, parameters); end + + # Append the multipart fragment for a parameter that isn't a file upload to the buffer. + # + # source://rack-test//lib/rack/test/utils.rb#121 + def build_primitive_part(buffer, parameter_name, value); end + + # Return a flattened hash of parameter values based on the given params. + # + # source://rack-test//lib/rack/test/utils.rb#62 + def normalize_multipart_params(params, first = T.unsafe(nil)); end +end + +# source://rack-test//lib/rack/test/version.rb#3 +Rack::Test::VERSION = T.let(T.unsafe(nil), String) diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/rack@2.2.9.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rack@2.2.9.rbi new file mode 100644 index 0000000..f55b061 --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rack@2.2.9.rbi @@ -0,0 +1,5634 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rack` gem. +# Please instead update this file by running `bin/tapioca gem rack`. + + +# The Rack main module, serving as a namespace for all core Rack +# modules and classes. +# +# All modules meant for use in your application are autoloaded here, +# so it should be enough just to require 'rack' in your code. +# +# source://rack//lib/rack/version.rb#14 +module Rack + class << self + # Return the Rack release as a dotted string. + # + # source://rack//lib/rack/version.rb#26 + def release; end + + # Return the Rack protocol version as a dotted string. + # + # source://rack//lib/rack/version.rb#19 + def version; end + end +end + +# source://rack//lib/rack.rb#124 +module Rack::Auth; end + +# Rack::Auth::AbstractHandler implements common authentication functionality. +# +# +realm+ should be set for all handlers. +# +# source://rack//lib/rack/auth/abstract/handler.rb#9 +class Rack::Auth::AbstractHandler + # @return [AbstractHandler] a new instance of AbstractHandler + # + # source://rack//lib/rack/auth/abstract/handler.rb#13 + def initialize(app, realm = T.unsafe(nil), &authenticator); end + + # Returns the value of attribute realm. + # + # source://rack//lib/rack/auth/abstract/handler.rb#11 + def realm; end + + # Sets the attribute realm + # + # @param value the value to set the attribute realm to. + # + # source://rack//lib/rack/auth/abstract/handler.rb#11 + def realm=(_arg0); end + + private + + # source://rack//lib/rack/auth/abstract/handler.rb#29 + def bad_request; end + + # source://rack//lib/rack/auth/abstract/handler.rb#20 + def unauthorized(www_authenticate = T.unsafe(nil)); end +end + +# source://rack//lib/rack/auth/abstract/request.rb#5 +class Rack::Auth::AbstractRequest + # @return [AbstractRequest] a new instance of AbstractRequest + # + # source://rack//lib/rack/auth/abstract/request.rb#7 + def initialize(env); end + + # source://rack//lib/rack/auth/abstract/request.rb#31 + def params; end + + # source://rack//lib/rack/auth/abstract/request.rb#23 + def parts; end + + # @return [Boolean] + # + # source://rack//lib/rack/auth/abstract/request.rb#15 + def provided?; end + + # source://rack//lib/rack/auth/abstract/request.rb#11 + def request; end + + # source://rack//lib/rack/auth/abstract/request.rb#27 + def scheme; end + + # @return [Boolean] + # + # source://rack//lib/rack/auth/abstract/request.rb#19 + def valid?; end + + private + + # source://rack//lib/rack/auth/abstract/request.rb#40 + def authorization_key; end +end + +# source://rack//lib/rack/auth/abstract/request.rb#38 +Rack::Auth::AbstractRequest::AUTHORIZATION_KEYS = T.let(T.unsafe(nil), Array) + +# Rack::Auth::Basic implements HTTP Basic Authentication, as per RFC 2617. +# +# Initialize with the Rack application that you want protecting, +# and a block that checks if a username and password pair are valid. +# +# See also: example/protectedlobster.rb +# +# source://rack//lib/rack/auth/basic.rb#16 +class Rack::Auth::Basic < ::Rack::Auth::AbstractHandler + # source://rack//lib/rack/auth/basic.rb#18 + def call(env); end + + private + + # source://rack//lib/rack/auth/basic.rb#37 + def challenge; end + + # @return [Boolean] + # + # source://rack//lib/rack/auth/basic.rb#41 + def valid?(auth); end +end + +# source://rack//lib/rack/auth/basic.rb#45 +class Rack::Auth::Basic::Request < ::Rack::Auth::AbstractRequest + # @return [Boolean] + # + # source://rack//lib/rack/auth/basic.rb#46 + def basic?; end + + # source://rack//lib/rack/auth/basic.rb#50 + def credentials; end + + # source://rack//lib/rack/auth/basic.rb#54 + def username; end +end + +# source://rack//lib/rack.rb#128 +module Rack::Auth::Digest; end + +# Rack::Auth::Digest::MD5 implements the MD5 algorithm version of +# HTTP Digest Authentication, as per RFC 2617. +# +# Initialize with the [Rack] application that you want protecting, +# and a block that looks up a plaintext password for a given username. +# +# +opaque+ needs to be set to a constant base64/hexadecimal string. +# +# source://rack//lib/rack/auth/digest/md5.rb#20 +class Rack::Auth::Digest::MD5 < ::Rack::Auth::AbstractHandler + # @return [MD5] a new instance of MD5 + # + # source://rack//lib/rack/auth/digest/md5.rb#26 + def initialize(app, realm = T.unsafe(nil), opaque = T.unsafe(nil), &authenticator); end + + # source://rack//lib/rack/auth/digest/md5.rb#39 + def call(env); end + + # Returns the value of attribute opaque. + # + # source://rack//lib/rack/auth/digest/md5.rb#22 + def opaque; end + + # Sets the attribute opaque + # + # @param value the value to set the attribute opaque to. + # + # source://rack//lib/rack/auth/digest/md5.rb#22 + def opaque=(_arg0); end + + # Sets the attribute passwords_hashed + # + # @param value the value to set the attribute passwords_hashed to. + # + # source://rack//lib/rack/auth/digest/md5.rb#24 + def passwords_hashed=(_arg0); end + + # @return [Boolean] + # + # source://rack//lib/rack/auth/digest/md5.rb#35 + def passwords_hashed?; end + + private + + # source://rack//lib/rack/auth/digest/md5.rb#114 + def A1(auth, password); end + + # source://rack//lib/rack/auth/digest/md5.rb#118 + def A2(auth); end + + # source://rack//lib/rack/auth/digest/md5.rb#104 + def H(data); end + + # source://rack//lib/rack/auth/digest/md5.rb#110 + def KD(secret, data); end + + # source://rack//lib/rack/auth/digest/md5.rb#79 + def challenge(hash = T.unsafe(nil)); end + + # source://rack//lib/rack/auth/digest/md5.rb#122 + def digest(auth, password); end + + # source://rack//lib/rack/auth/digest/md5.rb#104 + def md5(data); end + + # source://rack//lib/rack/auth/digest/md5.rb#68 + def params(hash = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rack//lib/rack/auth/digest/md5.rb#83 + def valid?(auth); end + + # @return [Boolean] + # + # source://rack//lib/rack/auth/digest/md5.rb#99 + def valid_digest?(auth); end + + # @return [Boolean] + # + # source://rack//lib/rack/auth/digest/md5.rb#95 + def valid_nonce?(auth); end + + # @return [Boolean] + # + # source://rack//lib/rack/auth/digest/md5.rb#91 + def valid_opaque?(auth); end + + # @return [Boolean] + # + # source://rack//lib/rack/auth/digest/md5.rb#87 + def valid_qop?(auth); end +end + +# source://rack//lib/rack/auth/digest/md5.rb#66 +Rack::Auth::Digest::MD5::QOP = T.let(T.unsafe(nil), String) + +# Rack::Auth::Digest::Nonce is the default nonce generator for the +# Rack::Auth::Digest::MD5 authentication handler. +# +# +private_key+ needs to set to a constant string. +# +# +time_limit+ can be optionally set to an integer (number of seconds), +# to limit the validity of the generated nonces. +# +# source://rack//lib/rack/auth/digest/nonce.rb#17 +class Rack::Auth::Digest::Nonce + # @return [Nonce] a new instance of Nonce + # + # source://rack//lib/rack/auth/digest/nonce.rb#27 + def initialize(timestamp = T.unsafe(nil), given_digest = T.unsafe(nil)); end + + # source://rack//lib/rack/auth/digest/nonce.rb#35 + def digest; end + + # @return [Boolean] + # + # source://rack//lib/rack/auth/digest/nonce.rb#47 + def fresh?; end + + # @return [Boolean] + # + # source://rack//lib/rack/auth/digest/nonce.rb#43 + def stale?; end + + # source://rack//lib/rack/auth/digest/nonce.rb#31 + def to_s; end + + # @return [Boolean] + # + # source://rack//lib/rack/auth/digest/nonce.rb#39 + def valid?; end + + class << self + # source://rack//lib/rack/auth/digest/nonce.rb#23 + def parse(string); end + + # Returns the value of attribute private_key. + # + # source://rack//lib/rack/auth/digest/nonce.rb#20 + def private_key; end + + # Sets the attribute private_key + # + # @param value the value to set the attribute private_key to. + # + # source://rack//lib/rack/auth/digest/nonce.rb#20 + def private_key=(_arg0); end + + # Returns the value of attribute time_limit. + # + # source://rack//lib/rack/auth/digest/nonce.rb#20 + def time_limit; end + + # Sets the attribute time_limit + # + # @param value the value to set the attribute time_limit to. + # + # source://rack//lib/rack/auth/digest/nonce.rb#20 + def time_limit=(_arg0); end + end +end + +# source://rack//lib/rack/auth/digest/params.rb#6 +class Rack::Auth::Digest::Params < ::Hash + # @return [Params] a new instance of Params + # @yield [_self] + # @yieldparam _self [Rack::Auth::Digest::Params] the object that the method was called on + # + # source://rack//lib/rack/auth/digest/params.rb#25 + def initialize; end + + # source://rack//lib/rack/auth/digest/params.rb#31 + def [](k); end + + # source://rack//lib/rack/auth/digest/params.rb#35 + def []=(k, v); end + + # From WEBrick::HTTPUtils + # + # source://rack//lib/rack/auth/digest/params.rb#47 + def quote(str); end + + # source://rack//lib/rack/auth/digest/params.rb#41 + def to_s; end + + class << self + # From WEBrick::HTTPUtils + # + # source://rack//lib/rack/auth/digest/params.rb#15 + def dequote(str); end + + # source://rack//lib/rack/auth/digest/params.rb#8 + def parse(str); end + + # source://rack//lib/rack/auth/digest/params.rb#21 + def split_header_value(str); end + end +end + +# source://rack//lib/rack/auth/digest/params.rb#39 +Rack::Auth::Digest::Params::UNQUOTED = T.let(T.unsafe(nil), Array) + +# source://rack//lib/rack/auth/digest/request.rb#10 +class Rack::Auth::Digest::Request < ::Rack::Auth::AbstractRequest + # @return [Boolean] + # + # source://rack//lib/rack/auth/digest/request.rb#19 + def correct_uri?; end + + # @return [Boolean] + # + # source://rack//lib/rack/auth/digest/request.rb#15 + def digest?; end + + # source://rack//lib/rack/auth/digest/request.rb#11 + def method; end + + # @raise [ArgumentError] + # + # source://rack//lib/rack/auth/digest/request.rb#35 + def method_missing(sym, *args); end + + # source://rack//lib/rack/auth/digest/request.rb#23 + def nonce; end + + # source://rack//lib/rack/auth/digest/request.rb#27 + def params; end + + # @return [Boolean] + # + # source://rack//lib/rack/auth/digest/request.rb#31 + def respond_to?(sym, *_arg1); end +end + +# Proxy for response bodies allowing calling a block when +# the response body is closed (after the response has been fully +# sent to the client). +# +# source://rack//lib/rack/body_proxy.rb#7 +class Rack::BodyProxy + # Set the response body to wrap, and the block to call when the + # response has been fully sent. + # + # @return [BodyProxy] a new instance of BodyProxy + # + # source://rack//lib/rack/body_proxy.rb#10 + def initialize(body, &block); end + + # If not already closed, close the wrapped body and + # then call the block the proxy was initialized with. + # + # source://rack//lib/rack/body_proxy.rb#23 + def close; end + + # Whether the proxy is closed. The proxy starts as not closed, + # and becomes closed on the first call to close. + # + # @return [Boolean] + # + # source://rack//lib/rack/body_proxy.rb#35 + def closed?; end + + # Delegate missing methods to the wrapped body. + # + # source://rack//lib/rack/body_proxy.rb#40 + def method_missing(method_name, *args, **_arg2, &block); end + + private + + # Return whether the wrapped body responds to the method. + # + # @return [Boolean] + # + # source://rack//lib/rack/body_proxy.rb#17 + def respond_to_missing?(method_name, include_all = T.unsafe(nil)); end +end + +# Rack::Builder implements a small DSL to iteratively construct Rack +# applications. +# +# Example: +# +# require 'rack/lobster' +# app = Rack::Builder.new do +# use Rack::CommonLogger +# use Rack::ShowExceptions +# map "/lobster" do +# use Rack::Lint +# run Rack::Lobster.new +# end +# end +# +# run app +# +# Or +# +# app = Rack::Builder.app do +# use Rack::CommonLogger +# run lambda { |env| [200, {'Content-Type' => 'text/plain'}, ['OK']] } +# end +# +# run app +# +# +use+ adds middleware to the stack, +run+ dispatches to an application. +# You can use +map+ to construct a Rack::URLMap in a convenient way. +# +# source://rack//lib/rack/builder.rb#33 +class Rack::Builder + # Initialize a new Rack::Builder instance. +default_app+ specifies the + # default application if +run+ is not called later. If a block + # is given, it is evaluted in the context of the instance. + # + # @return [Builder] a new instance of Builder + # + # source://rack//lib/rack/builder.rb#123 + def initialize(default_app = T.unsafe(nil), &block); end + + # Call the Rack application generated by this builder instance. Note that + # this rebuilds the Rack application and runs the warmup code (if any) + # every time it is called, so it should not be used if performance is important. + # + # source://rack//lib/rack/builder.rb#243 + def call(env); end + + # Freeze the app (set using run) and all middleware instances when building the application + # in to_app. + # + # source://rack//lib/rack/builder.rb#226 + def freeze_app; end + + # Creates a route within the application. Routes under the mapped path will be sent to + # the Rack application specified by run inside the block. Other requests will be sent to the + # default application specified by run outside the block. + # + # Rack::Builder.app do + # map '/heartbeat' do + # run Heartbeat + # end + # run App + # end + # + # The +use+ method can also be used inside the block to specify middleware to run under a specific path: + # + # Rack::Builder.app do + # map '/heartbeat' do + # use Middleware + # run Heartbeat + # end + # run App + # end + # + # This example includes a piece of middleware which will run before +/heartbeat+ requests hit +Heartbeat+. + # + # Note that providing a +path+ of +/+ will ignore any default application given in a +run+ statement + # outside the block. + # + # source://rack//lib/rack/builder.rb#219 + def map(path, &block); end + + # Takes an argument that is an object that responds to #call and returns a Rack response. + # The simplest form of this is a lambda object: + # + # run lambda { |env| [200, { "Content-Type" => "text/plain" }, ["OK"]] } + # + # However this could also be a class: + # + # class Heartbeat + # def self.call(env) + # [200, { "Content-Type" => "text/plain" }, ["OK"]] + # end + # end + # + # run Heartbeat + # + # source://rack//lib/rack/builder.rb#176 + def run(app); end + + # Return the Rack application generated by this instance. + # + # source://rack//lib/rack/builder.rb#231 + def to_app; end + + # Specifies middleware to use in a stack. + # + # class Middleware + # def initialize(app) + # @app = app + # end + # + # def call(env) + # env["rack.some_header"] = "setting an example" + # @app.call(env) + # end + # end + # + # use Middleware + # run lambda { |env| [200, { "Content-Type" => "text/plain" }, ["OK"]] } + # + # All requests through to this application will first be processed by the middleware class. + # The +call+ method in this example sets an additional environment key which then can be + # referenced in the application if required. + # + # source://rack//lib/rack/builder.rb#153 + def use(middleware, *args, **_arg2, &block); end + + # Takes a lambda or block that is used to warm-up the application. This block is called + # before the Rack application is returned by to_app. + # + # warmup do |app| + # client = Rack::MockRequest.new(app) + # client.get('/') + # end + # + # use SomeMiddleware + # run MyApp + # + # source://rack//lib/rack/builder.rb#190 + def warmup(prc = T.unsafe(nil), &block); end + + private + + # Generate a URLMap instance by generating new Rack applications for each + # map block in this instance. + # + # source://rack//lib/rack/builder.rb#251 + def generate_map(default_app, mapping); end + + class << self + # Create a new Rack::Builder instance and return the Rack application + # generated from it. + # + # source://rack//lib/rack/builder.rb#130 + def app(default_app = T.unsafe(nil), &block); end + + # Load the given file as a rackup file, treating the + # contents as if specified inside a Rack::Builder block. + # + # Treats the first comment at the beginning of a line + # that starts with a backslash as options similar to + # options passed on a rackup command line. + # + # Ignores content in the file after +__END__+, so that + # use of +__END__+ will not result in a syntax error. + # + # Example config.ru file: + # + # $ cat config.ru + # + # #\ -p 9393 + # + # use Rack::ContentLength + # require './app.rb' + # run App + # + # source://rack//lib/rack/builder.rb#93 + def load_file(path, opts = T.unsafe(nil)); end + + # Evaluate the given +builder_script+ string in the context of + # a Rack::Builder block, returning a Rack application. + # + # source://rack//lib/rack/builder.rb#112 + def new_from_string(builder_script, file = T.unsafe(nil)); end + + # Parse the given config file to get a Rack application. + # + # If the config file ends in +.ru+, it is treated as a + # rackup file and the contents will be treated as if + # specified inside a Rack::Builder block, using the given + # options. + # + # If the config file does not end in +.ru+, it is + # required and Rack will use the basename of the file + # to guess which constant will be the Rack application to run. + # The options given will be ignored in this case. + # + # Examples: + # + # Rack::Builder.parse_file('config.ru') + # # Rack application built using Rack::Builder.new + # + # Rack::Builder.parse_file('app.rb') + # # requires app.rb, which can be anywhere in Ruby's + # # load path. After requiring, assumes App constant + # # contains Rack application + # + # Rack::Builder.parse_file('./my_app.rb') + # # requires ./my_app.rb, which should be in the + # # process's current directory. After requiring, + # # assumes MyApp constant contains Rack application + # + # source://rack//lib/rack/builder.rb#64 + def parse_file(config, opts = T.unsafe(nil)); end + end +end + +# https://stackoverflow.com/questions/2223882/whats-the-difference-between-utf-8-and-utf-8-without-bom +# +# source://rack//lib/rack/builder.rb#36 +Rack::Builder::UTF_8_BOM = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#29 +Rack::CACHE_CONTROL = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#31 +Rack::CONTENT_LENGTH = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#32 +Rack::CONTENT_TYPE = T.let(T.unsafe(nil), String) + +# Rack::Cascade tries a request on several apps, and returns the +# first response that is not 404 or 405 (or in a list of configured +# status codes). If all applications tried return one of the configured +# status codes, return the last response. +# +# source://rack//lib/rack/cascade.rb#9 +class Rack::Cascade + # Set the apps to send requests to, and what statuses result in + # cascading. Arguments: + # + # apps: An enumerable of rack applications. + # cascade_for: The statuses to use cascading for. If a response is received + # from an app, the next app is tried. + # + # @return [Cascade] a new instance of Cascade + # + # source://rack//lib/rack/cascade.rb#22 + def initialize(apps, cascade_for = T.unsafe(nil)); end + + # Append an app to the list of apps to cascade. This app will + # be tried last. + # + # source://rack//lib/rack/cascade.rb#57 + def <<(app); end + + # Append an app to the list of apps to cascade. This app will + # be tried last. + # + # source://rack//lib/rack/cascade.rb#57 + def add(app); end + + # An array of applications to try in order. + # + # source://rack//lib/rack/cascade.rb#14 + def apps; end + + # Call each app in order. If the responses uses a status that requires + # cascading, try the next app. If all responses require cascading, + # return the response from the last app. + # + # source://rack//lib/rack/cascade.rb#33 + def call(env); end + + # Whether the given app is one of the apps to cascade to. + # + # @return [Boolean] + # + # source://rack//lib/rack/cascade.rb#62 + def include?(app); end +end + +# deprecated, no longer used +# +# source://rack//lib/rack/cascade.rb#11 +Rack::Cascade::NotFound = T.let(T.unsafe(nil), Array) + +# Middleware that applies chunked transfer encoding to response bodies +# when the response does not include a Content-Length header. +# +# This supports the Trailer response header to allow the use of trailing +# headers in the chunked encoding. However, using this requires you manually +# specify a response body that supports a +trailers+ method. Example: +# +# [200, { 'Trailer' => 'Expires'}, ["Hello", "World"]] +# # error raised +# +# body = ["Hello", "World"] +# def body.trailers +# { 'Expires' => Time.now.to_s } +# end +# [200, { 'Trailer' => 'Expires'}, body] +# # No exception raised +# +# source://rack//lib/rack/chunked.rb#21 +class Rack::Chunked + include ::Rack::Utils + + # @return [Chunked] a new instance of Chunked + # + # source://rack//lib/rack/chunked.rb#78 + def initialize(app); end + + # If the rack app returns a response that should have a body, + # but does not have Content-Length or Transfer-Encoding headers, + # modify the response to use chunked Transfer-Encoding. + # + # source://rack//lib/rack/chunked.rb#97 + def call(env); end + + # Whether the HTTP version supports chunked encoding (HTTP 1.1 does). + # + # @return [Boolean] + # + # source://rack//lib/rack/chunked.rb#83 + def chunkable_version?(ver); end +end + +# A body wrapper that emits chunked responses. +# +# source://rack//lib/rack/chunked.rb#25 +class Rack::Chunked::Body + # Store the response body to be chunked. + # + # @return [Body] a new instance of Body + # + # source://rack//lib/rack/chunked.rb#30 + def initialize(body); end + + # Close the response body if the response body supports it. + # + # source://rack//lib/rack/chunked.rb#50 + def close; end + + # For each element yielded by the response body, yield + # the element in chunked encoding. + # + # @yield [TAIL] + # + # source://rack//lib/rack/chunked.rb#36 + def each(&block); end + + private + + # Do nothing as this class does not support trailer headers. + # + # source://rack//lib/rack/chunked.rb#57 + def yield_trailers; end +end + +# source://rack//lib/rack/chunked.rb#27 +Rack::Chunked::Body::TAIL = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/chunked.rb#26 +Rack::Chunked::Body::TERM = T.let(T.unsafe(nil), String) + +# A body wrapper that emits chunked responses and also supports +# sending Trailer headers. Note that the response body provided to +# initialize must have a +trailers+ method that returns a hash +# of trailer headers, and the rack response itself should have a +# Trailer header listing the headers that the +trailers+ method +# will return. +# +# source://rack//lib/rack/chunked.rb#67 +class Rack::Chunked::TrailerBody < ::Rack::Chunked::Body + private + + # Yield strings for each trailer header. + # + # source://rack//lib/rack/chunked.rb#71 + def yield_trailers; end +end + +# Rack::CommonLogger forwards every request to the given +app+, and +# logs a line in the +# {Apache common log format}[http://httpd.apache.org/docs/1.3/logs.html#common] +# to the configured logger. +# +# source://rack//lib/rack/common_logger.rb#8 +class Rack::CommonLogger + # +logger+ can be any object that supports the +write+ or +<<+ methods, + # which includes the standard library Logger. These methods are called + # with a single string argument, the log message. + # If +logger+ is nil, CommonLogger will fall back env['rack.errors']. + # + # @return [CommonLogger] a new instance of CommonLogger + # + # source://rack//lib/rack/common_logger.rb#24 + def initialize(app, logger = T.unsafe(nil)); end + + # Log all requests in common_log format after a response has been + # returned. Note that if the app raises an exception, the request + # will not be logged, so if exception handling middleware are used, + # they should be loaded after this middleware. Additionally, because + # the logging happens after the request body has been fully sent, any + # exceptions raised during the sending of the response body will + # cause the request not to be logged. + # + # source://sinatra/3.2.0/lib/sinatra/base.rb#259 + def call(env); end + + # source://rack//lib/rack/common_logger.rb#36 + def call_without_check(env); end + + private + + # Attempt to determine the content length for the response to + # include it in the logged data. + # + # source://rack//lib/rack/common_logger.rb#78 + def extract_content_length(headers); end + + # Log the request to the configured logger. + # + # source://rack//lib/rack/common_logger.rb#47 + def log(env, status, header, began_at); end +end + +# Common Log Format: http://httpd.apache.org/docs/1.3/logs.html#common +# +# lilith.local - - [07/Aug/2006 23:58:02 -0400] "GET / HTTP/1.1" 500 - +# +# %{%s - %s [%s] "%s %s%s %s" %d %s\n} % +# +# The actual format is slightly different than the above due to the +# separation of SCRIPT_NAME and PATH_INFO, and because the elapsed +# time in seconds is included at the end. +# +# source://rack//lib/rack/common_logger.rb#18 +Rack::CommonLogger::FORMAT = T.let(T.unsafe(nil), String) + +# Middleware that enables conditional GET using If-None-Match and +# If-Modified-Since. The application should set either or both of the +# Last-Modified or Etag response headers according to RFC 2616. When +# either of the conditions is met, the response body is set to be zero +# length and the response status is set to 304 Not Modified. +# +# Applications that defer response body generation until the body's each +# message is received will avoid response body generation completely when +# a conditional GET matches. +# +# Adapted from Michael Klishin's Merb implementation: +# https://github.com/wycats/merb/blob/master/merb-core/lib/merb-core/rack/middleware/conditional_get.rb +# +# source://rack//lib/rack/conditional_get.rb#17 +class Rack::ConditionalGet + # @return [ConditionalGet] a new instance of ConditionalGet + # + # source://rack//lib/rack/conditional_get.rb#18 + def initialize(app); end + + # Return empty 304 response if the response has not been + # modified since the last request. + # + # source://rack//lib/rack/conditional_get.rb#24 + def call(env); end + + private + + # Whether the ETag response header matches the If-None-Match request header. + # If so, the request has not been modified. + # + # @return [Boolean] + # + # source://rack//lib/rack/conditional_get.rb#59 + def etag_matches?(none_match, headers); end + + # Return whether the response has not been modified since the + # last request. + # + # @return [Boolean] + # + # source://rack//lib/rack/conditional_get.rb#48 + def fresh?(env, headers); end + + # Whether the Last-Modified response header matches the If-Modified-Since + # request header. If so, the request has not been modified. + # + # @return [Boolean] + # + # source://rack//lib/rack/conditional_get.rb#65 + def modified_since?(modified_since, headers); end + + # Return a Time object for the given string (which should be in RFC2822 + # format), or nil if the string cannot be parsed. + # + # source://rack//lib/rack/conditional_get.rb#72 + def to_rfc2822(since); end +end + +# Rack::Config modifies the environment using the block given during +# initialization. +# +# Example: +# use Rack::Config do |env| +# env['my-key'] = 'some-value' +# end +# +# source://rack//lib/rack/config.rb#11 +class Rack::Config + # @return [Config] a new instance of Config + # + # source://rack//lib/rack/config.rb#12 + def initialize(app, &block); end + + # source://rack//lib/rack/config.rb#17 + def call(env); end +end + +# Sets the Content-Length header on responses that do not specify +# a Content-Length or Transfer-Encoding header. Note that this +# does not fix responses that have an invalid Content-Length +# header specified. +# +# source://rack//lib/rack/content_length.rb#9 +class Rack::ContentLength + include ::Rack::Utils + + # @return [ContentLength] a new instance of ContentLength + # + # source://rack//lib/rack/content_length.rb#12 + def initialize(app); end + + # source://rack//lib/rack/content_length.rb#16 + def call(env); end +end + +# Sets the Content-Type header on responses which don't have one. +# +# Builder Usage: +# use Rack::ContentType, "text/plain" +# +# When no content type argument is provided, "text/html" is the +# default. +# +# source://rack//lib/rack/content_type.rb#12 +class Rack::ContentType + include ::Rack::Utils + + # @return [ContentType] a new instance of ContentType + # + # source://rack//lib/rack/content_type.rb#15 + def initialize(app, content_type = T.unsafe(nil)); end + + # source://rack//lib/rack/content_type.rb#19 + def call(env); end +end + +# source://rack//lib/rack.rb#43 +Rack::DELETE = T.let(T.unsafe(nil), String) + +# This middleware enables content encoding of http responses, +# usually for purposes of compression. +# +# Currently supported encodings: +# +# * gzip +# * identity (no transformation) +# +# This middleware automatically detects when encoding is supported +# and allowed. For example no encoding is made when a cache +# directive of 'no-transform' is present, when the response status +# code is one that doesn't allow an entity body, or when the body +# is empty. +# +# Note that despite the name, Deflater does not support the +deflate+ +# encoding. +# +# source://rack//lib/rack/deflater.rb#23 +class Rack::Deflater + # Creates Rack::Deflater middleware. Options: + # + # :if :: a lambda enabling / disabling deflation based on returned boolean value + # (e.g use Rack::Deflater, :if => lambda { |*, body| sum=0; body.each { |i| sum += i.length }; sum > 512 }). + # However, be aware that calling `body.each` inside the block will break cases where `body.each` is not idempotent, + # such as when it is an +IO+ instance. + # :include :: a list of content types that should be compressed. By default, all content types are compressed. + # :sync :: determines if the stream is going to be flushed after every chunk. Flushing after every chunk reduces + # latency for time-sensitive streaming applications, but hurts compression and throughput. + # Defaults to +true+. + # + # @return [Deflater] a new instance of Deflater + # + # source://rack//lib/rack/deflater.rb#36 + def initialize(app, options = T.unsafe(nil)); end + + # source://rack//lib/rack/deflater.rb#43 + def call(env); end + + private + + # Whether the body should be compressed. + # + # @return [Boolean] + # + # source://rack//lib/rack/deflater.rb#122 + def should_deflate?(env, status, headers, body); end +end + +# Body class used for gzip encoded responses. +# +# source://rack//lib/rack/deflater.rb#79 +class Rack::Deflater::GzipStream + # Initialize the gzip stream. Arguments: + # body :: Response body to compress with gzip + # mtime :: The modification time of the body, used to set the + # modification time in the gzip header. + # sync :: Whether to flush each gzip chunk as soon as it is ready. + # + # @return [GzipStream] a new instance of GzipStream + # + # source://rack//lib/rack/deflater.rb#85 + def initialize(body, mtime, sync); end + + # Close the original body if possible. + # + # source://rack//lib/rack/deflater.rb#114 + def close; end + + # Yield gzip compressed strings to the given block. + # + # source://rack//lib/rack/deflater.rb#92 + def each(&block); end + + # Call the block passed to #each with the the gzipped data. + # + # source://rack//lib/rack/deflater.rb#109 + def write(data); end +end + +# Rack::Directory serves entries below the +root+ given, according to the +# path info of the Rack request. If a directory is found, the file's contents +# will be presented in an html based index. If a file is found, the env will +# be passed to the specified +app+. +# +# If +app+ is not specified, a Rack::Files of the same +root+ will be used. +# +# source://rack//lib/rack/directory.rb#13 +class Rack::Directory + # Set the root directory and application for serving files. + # + # @return [Directory] a new instance of Directory + # + # source://rack//lib/rack/directory.rb#77 + def initialize(root, app = T.unsafe(nil)); end + + # source://rack//lib/rack/directory.rb#83 + def call(env); end + + # Rack response to use for requests with invalid paths, or nil if path is valid. + # + # source://rack//lib/rack/directory.rb#103 + def check_bad_request(path_info); end + + # Rack response to use for requests with paths outside the root, or nil if path is inside the root. + # + # source://rack//lib/rack/directory.rb#113 + def check_forbidden(path_info); end + + # Rack response to use for unreadable and non-file, non-directory entries. + # + # source://rack//lib/rack/directory.rb#175 + def entity_not_found(path_info); end + + # Provide human readable file sizes + # + # source://rack//lib/rack/directory.rb#191 + def filesize_format(int); end + + # Internals of request handling. Similar to call but does + # not remove body for HEAD requests. + # + # source://rack//lib/rack/directory.rb#90 + def get(env); end + + # Rack response to use for directories under the root. + # + # source://rack//lib/rack/directory.rb#124 + def list_directory(path_info, path, script_name); end + + # Rack response to use for files and directories under the root. + # Unreadable and non-file, non-directory entries will get a 404 response. + # + # source://rack//lib/rack/directory.rb#165 + def list_path(env, path, path_info, script_name); end + + # The root of the directory hierarchy. Only requests for files and + # directories inside of the root directory are supported. + # + # source://rack//lib/rack/directory.rb#74 + def root; end + + # File::Stat for the given path, but return nil for missing/bad entries. + # + # source://rack//lib/rack/directory.rb#157 + def stat(path); end +end + +# source://rack//lib/rack/directory.rb#14 +Rack::Directory::DIR_FILE = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/directory.rb#37 +Rack::Directory::DIR_PAGE_FOOTER = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/directory.rb#15 +Rack::Directory::DIR_PAGE_HEADER = T.let(T.unsafe(nil), String) + +# Body class for directory entries, showing an index page with links +# to each file. +# +# source://rack//lib/rack/directory.rb#45 +class Rack::Directory::DirectoryBody < ::Struct + # Yield strings for each part of the directory entry + # + # @yield [DIR_PAGE_HEADER % [ show_path, show_path ]] + # + # source://rack//lib/rack/directory.rb#47 + def each; end + + private + + # Escape each element in the array of html strings. + # + # source://rack//lib/rack/directory.rb#67 + def DIR_FILE_escape(htmls); end +end + +# Stolen from Ramaze +# +# source://rack//lib/rack/directory.rb#183 +Rack::Directory::FILESIZE_FORMAT = T.let(T.unsafe(nil), Array) + +# source://rack//lib/rack.rb#36 +Rack::ETAG = T.let(T.unsafe(nil), String) + +# Automatically sets the ETag header on all String bodies. +# +# The ETag header is skipped if ETag or Last-Modified headers are sent or if +# a sendfile body (body.responds_to :to_path) is given (since such cases +# should be handled by apache/nginx). +# +# On initialization, you can pass two parameters: a Cache-Control directive +# used when Etag is absent and a directive when it is present. The first +# defaults to nil, while the second defaults to "max-age=0, private, must-revalidate" +# +# source://rack//lib/rack/etag.rb#16 +class Rack::ETag + # @return [ETag] a new instance of ETag + # + # source://rack//lib/rack/etag.rb#20 + def initialize(app, no_cache_control = T.unsafe(nil), cache_control = T.unsafe(nil)); end + + # source://rack//lib/rack/etag.rb#26 + def call(env); end + + private + + # source://rack//lib/rack/etag.rb#65 + def digest_body(body); end + + # @return [Boolean] + # + # source://rack//lib/rack/etag.rb#57 + def etag_body?(body); end + + # @return [Boolean] + # + # source://rack//lib/rack/etag.rb#53 + def etag_status?(status); end + + # @return [Boolean] + # + # source://rack//lib/rack/etag.rb#61 + def skip_caching?(headers); end +end + +# source://rack//lib/rack/etag.rb#18 +Rack::ETag::DEFAULT_CACHE_CONTROL = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/etag.rb#17 +Rack::ETag::ETAG_STRING = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#30 +Rack::EXPIRES = T.let(T.unsafe(nil), String) + +# This middleware provides hooks to certain places in the request / +# response lifecycle. This is so that middleware that don't need to filter +# the response data can safely leave it alone and not have to send messages +# down the traditional "rack stack". +# +# The events are: +# +# * on_start(request, response) +# +# This event is sent at the start of the request, before the next +# middleware in the chain is called. This method is called with a request +# object, and a response object. Right now, the response object is always +# nil, but in the future it may actually be a real response object. +# +# * on_commit(request, response) +# +# The response has been committed. The application has returned, but the +# response has not been sent to the webserver yet. This method is always +# called with a request object and the response object. The response +# object is constructed from the rack triple that the application returned. +# Changes may still be made to the response object at this point. +# +# * on_send(request, response) +# +# The webserver has started iterating over the response body and presumably +# has started sending data over the wire. This method is always called with +# a request object and the response object. The response object is +# constructed from the rack triple that the application returned. Changes +# SHOULD NOT be made to the response object as the webserver has already +# started sending data. Any mutations will likely result in an exception. +# +# * on_finish(request, response) +# +# The webserver has closed the response, and all data has been written to +# the response socket. The request and response object should both be +# read-only at this point. The body MAY NOT be available on the response +# object as it may have been flushed to the socket. +# +# * on_error(request, response, error) +# +# An exception has occurred in the application or an `on_commit` event. +# This method will get the request, the response (if available) and the +# exception that was raised. +# +# ## Order +# +# `on_start` is called on the handlers in the order that they were passed to +# the constructor. `on_commit`, on_send`, `on_finish`, and `on_error` are +# called in the reverse order. `on_finish` handlers are called inside an +# `ensure` block, so they are guaranteed to be called even if something +# raises an exception. If something raises an exception in a `on_finish` +# method, then nothing is guaranteed. +# +# source://rack//lib/rack/events.rb#57 +class Rack::Events + # @return [Events] a new instance of Events + # + # source://rack//lib/rack/events.rb#102 + def initialize(app, handlers); end + + # source://rack//lib/rack/events.rb#107 + def call(env); end + + private + + # source://rack//lib/rack/events.rb#145 + def make_request(env); end + + # source://rack//lib/rack/events.rb#149 + def make_response(status, headers, body); end + + # source://rack//lib/rack/events.rb#133 + def on_commit(request, response); end + + # source://rack//lib/rack/events.rb#129 + def on_error(request, response, e); end + + # source://rack//lib/rack/events.rb#141 + def on_finish(request, response); end + + # source://rack//lib/rack/events.rb#137 + def on_start(request, response); end +end + +# source://rack//lib/rack/events.rb#58 +module Rack::Events::Abstract + # source://rack//lib/rack/events.rb#62 + def on_commit(req, res); end + + # source://rack//lib/rack/events.rb#71 + def on_error(req, res, e); end + + # source://rack//lib/rack/events.rb#68 + def on_finish(req, res); end + + # source://rack//lib/rack/events.rb#65 + def on_send(req, res); end + + # source://rack//lib/rack/events.rb#59 + def on_start(req, res); end +end + +# source://rack//lib/rack/events.rb#91 +class Rack::Events::BufferedResponse < ::Rack::Response::Raw + # @return [BufferedResponse] a new instance of BufferedResponse + # + # source://rack//lib/rack/events.rb#94 + def initialize(status, headers, body); end + + # Returns the value of attribute body. + # + # source://rack//lib/rack/events.rb#92 + def body; end + + # source://rack//lib/rack/events.rb#99 + def to_a; end +end + +# source://rack//lib/rack/events.rb#75 +class Rack::Events::EventedBodyProxy < ::Rack::BodyProxy + # @return [EventedBodyProxy] a new instance of EventedBodyProxy + # + # source://rack//lib/rack/events.rb#78 + def initialize(body, request, response, handlers, &block); end + + # source://rack//lib/rack/events.rb#85 + def each; end + + # Returns the value of attribute request. + # + # source://rack//lib/rack/events.rb#76 + def request; end + + # Returns the value of attribute response. + # + # source://rack//lib/rack/events.rb#76 + def response; end +end + +# source://rack//lib/rack/file.rb#6 +Rack::File = Rack::Files + +# Rack::Files serves files below the +root+ directory given, according to the +# path info of the Rack request. +# e.g. when Rack::Files.new("/etc") is used, you can access 'passwd' file +# as http://localhost:9292/passwd +# +# Handlers can detect if bodies are a Rack::Files, and use mechanisms +# like sendfile on the +path+. +# +# source://rack//lib/rack/files.rb#14 +class Rack::Files + # @return [Files] a new instance of Files + # + # source://rack//lib/rack/files.rb#29 + def initialize(root, headers = T.unsafe(nil), default_mime = T.unsafe(nil)); end + + # source://rack//lib/rack/files.rb#36 + def call(env); end + + # source://rack//lib/rack/files.rb#41 + def get(env); end + + # Returns the value of attribute root. + # + # source://rack//lib/rack/files.rb#27 + def root; end + + # source://rack//lib/rack/files.rb#70 + def serving(request, path); end + + private + + # source://rack//lib/rack/files.rb#192 + def fail(status, body, headers = T.unsafe(nil)); end + + # source://rack//lib/rack/files.rb#211 + def filesize(path); end + + # The MIME type for the contents of the file located at @path + # + # source://rack//lib/rack/files.rb#207 + def mime_type(path, default_mime); end + + class << self + # @todo remove in 3.0 + # + # source://rack//lib/rack/files.rb#20 + def method_added(name); end + end +end + +# source://rack//lib/rack/files.rb#15 +Rack::Files::ALLOWED_VERBS = T.let(T.unsafe(nil), Array) + +# source://rack//lib/rack/files.rb#16 +Rack::Files::ALLOW_HEADER = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/files.rb#123 +class Rack::Files::BaseIterator + # @return [BaseIterator] a new instance of BaseIterator + # + # source://rack//lib/rack/files.rb#126 + def initialize(path, ranges, options); end + + # source://rack//lib/rack/files.rb#146 + def bytesize; end + + # source://rack//lib/rack/files.rb#155 + def close; end + + # source://rack//lib/rack/files.rb#132 + def each; end + + # Returns the value of attribute options. + # + # source://rack//lib/rack/files.rb#124 + def options; end + + # Returns the value of attribute path. + # + # source://rack//lib/rack/files.rb#124 + def path; end + + # Returns the value of attribute ranges. + # + # source://rack//lib/rack/files.rb#124 + def ranges; end + + private + + # source://rack//lib/rack/files.rb#173 + def each_range_part(file, range); end + + # @return [Boolean] + # + # source://rack//lib/rack/files.rb#159 + def multipart?; end + + # source://rack//lib/rack/files.rb#163 + def multipart_heading(range); end +end + +# source://rack//lib/rack/files.rb#186 +class Rack::Files::Iterator < ::Rack::Files::BaseIterator + # source://rack//lib/rack/files.rb#124 + def to_path; end +end + +# source://rack//lib/rack/files.rb#17 +Rack::Files::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String) + +# Rack::ForwardRequest gets caught by Rack::Recursive and redirects +# the current request to the app at +url+. +# +# raise ForwardRequest.new("/not-found") +# +# source://rack//lib/rack/recursive.rb#12 +class Rack::ForwardRequest < ::Exception + # @return [ForwardRequest] a new instance of ForwardRequest + # + # source://rack//lib/rack/recursive.rb#15 + def initialize(url, env = T.unsafe(nil)); end + + # Returns the value of attribute env. + # + # source://rack//lib/rack/recursive.rb#13 + def env; end + + # Returns the value of attribute url. + # + # source://rack//lib/rack/recursive.rb#13 + def url; end +end + +# HTTP method verbs +# +# source://rack//lib/rack.rb#39 +Rack::GET = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#44 +Rack::HEAD = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#20 +Rack::HTTPS = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#35 +Rack::HTTP_COOKIE = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#17 +Rack::HTTP_HOST = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#18 +Rack::HTTP_PORT = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#19 +Rack::HTTP_VERSION = T.let(T.unsafe(nil), String) + +# *Handlers* connect web servers with Rack. +# +# Rack includes Handlers for Thin, WEBrick, FastCGI, CGI, SCGI +# and LiteSpeed. +# +# Handlers usually are activated by calling MyHandler.run(myapp). +# A second optional hash can be passed to include server-specific +# configuration. +# +# source://rack//lib/rack/handler.rb#12 +module Rack::Handler + class << self + # source://rack//lib/rack/handler.rb#51 + def default; end + + # source://rack//lib/rack/handler.rb#13 + def get(server); end + + # Select first available Rack handler given an `Array` of server names. + # Raises `LoadError` if no handler was found. + # + # > pick ['thin', 'webrick'] + # => Rack::Handler::WEBrick + # + # @raise [LoadError] + # + # source://rack//lib/rack/handler.rb#36 + def pick(server_names); end + + # source://rack//lib/rack/handler.rb#85 + def register(server, klass); end + + # Transforms server-name constants to their canonical form as filenames, + # then tries to require them but silences the LoadError if not found + # + # Naming convention: + # + # Foo # => 'foo' + # FooBar # => 'foo_bar.rb' + # FooBAR # => 'foobar.rb' + # FOObar # => 'foobar.rb' + # FOOBAR # => 'foobar.rb' + # FooBarBaz # => 'foo_bar_baz.rb' + # + # source://rack//lib/rack/handler.rb#75 + def try_require(prefix, const_name); end + end +end + +# source://rack//lib/rack/handler/cgi.rb#5 +class Rack::Handler::CGI + class << self + # source://rack//lib/rack/handler/cgi.rb#6 + def run(app, **options); end + + # source://rack//lib/rack/handler/cgi.rb#51 + def send_body(body); end + + # source://rack//lib/rack/handler/cgi.rb#40 + def send_headers(status, headers); end + + # source://rack//lib/rack/handler/cgi.rb#11 + def serve(app); end + end +end + +# source://rack//lib/rack/handler.rb#48 +Rack::Handler::SERVER_NAMES = T.let(T.unsafe(nil), Array) + +# Rack::Head returns an empty body for all HEAD requests. It leaves +# all other requests unchanged. +# +# source://rack//lib/rack/head.rb#6 +class Rack::Head + # @return [Head] a new instance of Head + # + # source://rack//lib/rack/head.rb#7 + def initialize(app); end + + # source://rack//lib/rack/head.rb#11 + def call(env); end +end + +# source://rack//lib/rack.rb#46 +Rack::LINK = T.let(T.unsafe(nil), String) + +# Rack::Lint validates your application and the requests and +# responses according to the Rack spec. +# +# source://rack//lib/rack/lint.rb#9 +class Rack::Lint + include ::Rack::Lint::Assertion + + # @return [Lint] a new instance of Lint + # + # source://rack//lib/rack/lint.rb#10 + def initialize(app); end + + # @raise [LintError] + # + # source://rack//lib/rack/lint.rb#41 + def _call(env); end + + # A Rack application is a Ruby object (not a class) that + # responds to +call+. + # + # source://rack//lib/rack/lint.rb#37 + def call(env = T.unsafe(nil)); end + + # === The Content-Length + # + # source://rack//lib/rack/lint.rb#708 + def check_content_length(status, headers); end + + # === The Content-Type + # + # source://rack//lib/rack/lint.rb#694 + def check_content_type(status, headers); end + + # == The Environment + # + # @raise [LintError] + # + # source://rack//lib/rack/lint.rb#73 + def check_env(env); end + + # === The Error Stream + # + # source://rack//lib/rack/lint.rb#483 + def check_error(error); end + + # === The Headers + # + # source://rack//lib/rack/lint.rb#656 + def check_headers(header); end + + # === Hijacking + # + # AUTHORS: n.b. The trailing whitespace between paragraphs is important and + # should not be removed. The whitespace creates paragraphs in the RDoc + # output. + # + # ==== Request (before status) + # + # source://rack//lib/rack/lint.rb#548 + def check_hijack(env); end + + # ==== Response (after headers) + # It is also possible to hijack a response after the status and headers + # have been sent. + # + # source://rack//lib/rack/lint.rb#595 + def check_hijack_response(headers, env); end + + # === The Input Stream + # + # The input stream is an IO-like object which contains the raw HTTP + # POST data. + # + # source://rack//lib/rack/lint.rb#365 + def check_input(input); end + + # === The Status + # + # source://rack//lib/rack/lint.rb#647 + def check_status(status); end + + # source://rack//lib/rack/lint.rb#781 + def close; end + + # === The Body + # + # source://rack//lib/rack/lint.rb#734 + def each; end + + # source://rack//lib/rack/lint.rb#721 + def verify_content_length(bytes); end +end + +# source://rack//lib/rack/lint.rb#18 +module Rack::Lint::Assertion + # source://rack//lib/rack/lint.rb#19 + def assert(message); end +end + +# source://rack//lib/rack/lint.rb#492 +class Rack::Lint::ErrorWrapper + include ::Rack::Lint::Assertion + + # @return [ErrorWrapper] a new instance of ErrorWrapper + # + # source://rack//lib/rack/lint.rb#495 + def initialize(error); end + + # * +close+ must never be called on the error stream. + # + # @raise [LintError] + # + # source://rack//lib/rack/lint.rb#517 + def close(*args); end + + # * +flush+ must be called without arguments and must be called + # in order to make the error appear for sure. + # + # source://rack//lib/rack/lint.rb#512 + def flush; end + + # * +puts+ must be called with a single argument that responds to +to_s+. + # + # source://rack//lib/rack/lint.rb#500 + def puts(str); end + + # * +write+ must be called with a single argument that is a String. + # + # @raise [LintError] + # + # source://rack//lib/rack/lint.rb#505 + def write(str); end +end + +# source://rack//lib/rack/lint.rb#522 +class Rack::Lint::HijackWrapper + include ::Rack::Lint::Assertion + extend ::Forwardable + + # @return [HijackWrapper] a new instance of HijackWrapper + # + # source://rack//lib/rack/lint.rb#533 + def initialize(io); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def close(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def close_read(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def close_write(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def closed?(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def flush(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def read(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def read_nonblock(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def write(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def write_nonblock(*args, **_arg1, &block); end +end + +# source://rack//lib/rack/lint.rb#526 +Rack::Lint::HijackWrapper::REQUIRED_METHODS = T.let(T.unsafe(nil), Array) + +# source://rack//lib/rack/lint.rb#383 +class Rack::Lint::InputWrapper + include ::Rack::Lint::Assertion + + # @return [InputWrapper] a new instance of InputWrapper + # + # source://rack//lib/rack/lint.rb#386 + def initialize(input); end + + # * +close+ must never be called on the input stream. + # + # @raise [LintError] + # + # source://rack//lib/rack/lint.rb#477 + def close(*args); end + + # * +each+ must be called without arguments and only yield Strings. + # + # @raise [LintError] + # + # source://rack//lib/rack/lint.rb#451 + def each(*args); end + + # * +gets+ must be called without arguments and return a string, + # or +nil+ on EOF. + # + # @raise [LintError] + # + # source://rack//lib/rack/lint.rb#392 + def gets(*args); end + + # * +read+ behaves like IO#read. + # Its signature is read([length, [buffer]]). + # + # If given, +length+ must be a non-negative Integer (>= 0) or +nil+, + # and +buffer+ must be a String and may not be nil. + # + # If +length+ is given and not nil, then this method reads at most + # +length+ bytes from the input stream. + # + # If +length+ is not given or nil, then this method reads + # all data until EOF. + # + # When EOF is reached, this method returns nil if +length+ is given + # and not nil, or "" if +length+ is not given or is nil. + # + # If +buffer+ is given, then the read data will be placed + # into +buffer+ instead of a newly created String object. + # + # source://rack//lib/rack/lint.rb#418 + def read(*args); end + + # * +rewind+ must be called without arguments. It rewinds the input + # stream back to the beginning. It must not raise Errno::ESPIPE: + # that is, it may not be a pipe or a socket. Therefore, handler + # developers must buffer the input data into some rewindable object + # if the underlying input stream is not rewindable. + # + # @raise [LintError] + # + # source://rack//lib/rack/lint.rb#466 + def rewind(*args); end +end + +# :stopdoc: +# +# source://rack//lib/rack/lint.rb#17 +class Rack::Lint::LintError < ::RuntimeError; end + +# Rack::Lock locks every request inside a mutex, so that every request +# will effectively be executed synchronously. +# +# source://rack//lib/rack/lock.rb#8 +class Rack::Lock + # @return [Lock] a new instance of Lock + # + # source://rack//lib/rack/lock.rb#9 + def initialize(app, mutex = T.unsafe(nil)); end + + # source://rack//lib/rack/lock.rb#13 + def call(env); end + + private + + # source://rack//lib/rack/lock.rb#27 + def unlock; end +end + +# Sets up rack.logger to write to rack.errors stream +# +# source://rack//lib/rack/logger.rb#7 +class Rack::Logger + # @return [Logger] a new instance of Logger + # + # source://rack//lib/rack/logger.rb#8 + def initialize(app, level = T.unsafe(nil)); end + + # source://rack//lib/rack/logger.rb#12 + def call(env); end +end + +# Rack::MediaType parse media type and parameters out of content_type string +# +# source://rack//lib/rack/media_type.rb#6 +class Rack::MediaType + class << self + # The media type parameters provided in CONTENT_TYPE as a Hash, or + # an empty Hash if no CONTENT_TYPE or media-type parameters were + # provided. e.g., when the CONTENT_TYPE is "text/plain;charset=utf-8", + # this method responds with the following Hash: + # { 'charset' => 'utf-8' } + # + # source://rack//lib/rack/media_type.rb#30 + def params(content_type); end + + # The media type (type/subtype) portion of the CONTENT_TYPE header + # without any media type parameters. e.g., when CONTENT_TYPE is + # "text/plain;charset=utf-8", the media-type is "text/plain". + # + # For more information on the use of media types in HTTP, see: + # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7 + # + # source://rack//lib/rack/media_type.rb#16 + def type(content_type); end + + private + + # source://rack//lib/rack/media_type.rb#43 + def strip_doublequotes(str); end + end +end + +# source://rack//lib/rack/media_type.rb#7 +Rack::MediaType::SPLIT_PATTERN = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/method_override.rb#4 +class Rack::MethodOverride + # @return [MethodOverride] a new instance of MethodOverride + # + # source://rack//lib/rack/method_override.rb#11 + def initialize(app); end + + # source://rack//lib/rack/method_override.rb#15 + def call(env); end + + # source://rack//lib/rack/method_override.rb#27 + def method_override(env); end + + private + + # source://rack//lib/rack/method_override.rb#40 + def allowed_methods; end + + # source://rack//lib/rack/method_override.rb#44 + def method_override_param(req); end +end + +# source://rack//lib/rack/method_override.rb#9 +Rack::MethodOverride::ALLOWED_METHODS = T.let(T.unsafe(nil), Array) + +# source://rack//lib/rack/method_override.rb#5 +Rack::MethodOverride::HTTP_METHODS = T.let(T.unsafe(nil), Array) + +# source://rack//lib/rack/method_override.rb#8 +Rack::MethodOverride::HTTP_METHOD_OVERRIDE_HEADER = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/method_override.rb#7 +Rack::MethodOverride::METHOD_OVERRIDE_PARAM_KEY = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/mime.rb#4 +module Rack::Mime + private + + # Returns true if the given value is a mime match for the given mime match + # specification, false otherwise. + # + # Rack::Mime.match?('text/html', 'text/*') => true + # Rack::Mime.match?('text/plain', '*') => true + # Rack::Mime.match?('text/html', 'application/json') => false + # + # @return [Boolean] + # + # source://rack//lib/rack/mime.rb#30 + def match?(value, matcher); end + + # Returns String with mime type if found, otherwise use +fallback+. + # +ext+ should be filename extension in the '.ext' format that + # File.extname(file) returns. + # +fallback+ may be any object + # + # Also see the documentation for MIME_TYPES + # + # Usage: + # Rack::Mime.mime_type('.foo') + # + # This is a shortcut for: + # Rack::Mime::MIME_TYPES.fetch('.foo', 'application/octet-stream') + # + # source://rack//lib/rack/mime.rb#18 + def mime_type(ext, fallback = T.unsafe(nil)); end + + class << self + # Returns true if the given value is a mime match for the given mime match + # specification, false otherwise. + # + # Rack::Mime.match?('text/html', 'text/*') => true + # Rack::Mime.match?('text/plain', '*') => true + # Rack::Mime.match?('text/html', 'application/json') => false + # + # @return [Boolean] + # + # source://rack//lib/rack/mime.rb#30 + def match?(value, matcher); end + + # Returns String with mime type if found, otherwise use +fallback+. + # +ext+ should be filename extension in the '.ext' format that + # File.extname(file) returns. + # +fallback+ may be any object + # + # Also see the documentation for MIME_TYPES + # + # Usage: + # Rack::Mime.mime_type('.foo') + # + # This is a shortcut for: + # Rack::Mime::MIME_TYPES.fetch('.foo', 'application/octet-stream') + # + # source://rack//lib/rack/mime.rb#18 + def mime_type(ext, fallback = T.unsafe(nil)); end + end +end + +# List of most common mime-types, selected various sources +# according to their usefulness in a webserving scope for Ruby +# users. +# +# To amend this list with your local mime.types list you can use: +# +# require 'webrick/httputils' +# list = WEBrick::HTTPUtils.load_mime_types('/etc/mime.types') +# Rack::Mime::MIME_TYPES.merge!(list) +# +# N.B. On Ubuntu the mime.types file does not include the leading period, so +# users may need to modify the data before merging into the hash. +# +# source://rack//lib/rack/mime.rb#51 +Rack::Mime::MIME_TYPES = T.let(T.unsafe(nil), Hash) + +# Rack::MockRequest helps testing your Rack application without +# actually using HTTP. +# +# After performing a request on a URL with get/post/put/patch/delete, it +# returns a MockResponse with useful helper methods for effective +# testing. +# +# You can pass a hash with additional configuration to the +# get/post/put/patch/delete. +# :input:: A String or IO-like to be used as rack.input. +# :fatal:: Raise a FatalWarning if the app writes to rack.errors. +# :lint:: If true, wrap the application in a Rack::Lint. +# +# source://rack//lib/rack/mock.rb#22 +class Rack::MockRequest + # @return [MockRequest] a new instance of MockRequest + # + # source://rack//lib/rack/mock.rb#52 + def initialize(app); end + + # Make a DELETE request and return a MockResponse. See #request. + # + # source://rack//lib/rack/mock.rb#65 + def delete(uri, opts = T.unsafe(nil)); end + + # Make a GET request and return a MockResponse. See #request. + # + # source://rack//lib/rack/mock.rb#57 + def get(uri, opts = T.unsafe(nil)); end + + # Make a HEAD request and return a MockResponse. See #request. + # + # source://rack//lib/rack/mock.rb#67 + def head(uri, opts = T.unsafe(nil)); end + + # Make an OPTIONS request and return a MockResponse. See #request. + # + # source://rack//lib/rack/mock.rb#69 + def options(uri, opts = T.unsafe(nil)); end + + # Make a PATCH request and return a MockResponse. See #request. + # + # source://rack//lib/rack/mock.rb#63 + def patch(uri, opts = T.unsafe(nil)); end + + # Make a POST request and return a MockResponse. See #request. + # + # source://rack//lib/rack/mock.rb#59 + def post(uri, opts = T.unsafe(nil)); end + + # Make a PUT request and return a MockResponse. See #request. + # + # source://rack//lib/rack/mock.rb#61 + def put(uri, opts = T.unsafe(nil)); end + + # Make a request using the given request method for the given + # uri to the rack application and return a MockResponse. + # Options given are passed to MockRequest.env_for. + # + # source://rack//lib/rack/mock.rb#74 + def request(method = T.unsafe(nil), uri = T.unsafe(nil), opts = T.unsafe(nil)); end + + class << self + # Return the Rack environment used for a request to +uri+. + # All options that are strings are added to the returned environment. + # Options: + # :fatal :: Whether to raise an exception if request outputs to rack.errors + # :input :: The rack.input to set + # :method :: The HTTP request method to use + # :params :: The params to use + # :script_name :: The SCRIPT_NAME to set + # + # source://rack//lib/rack/mock.rb#105 + def env_for(uri = T.unsafe(nil), opts = T.unsafe(nil)); end + + # For historical reasons, we're pinning to RFC 2396. + # URI::Parser = URI::RFC2396_Parser + # + # source://rack//lib/rack/mock.rb#92 + def parse_uri_rfc2396(uri); end + end +end + +# source://rack//lib/rack/mock.rb#43 +Rack::MockRequest::DEFAULT_ENV = T.let(T.unsafe(nil), Hash) + +# source://rack//lib/rack/mock.rb#26 +class Rack::MockRequest::FatalWarner + # source://rack//lib/rack/mock.rb#35 + def flush; end + + # @raise [FatalWarning] + # + # source://rack//lib/rack/mock.rb#27 + def puts(warning); end + + # source://rack//lib/rack/mock.rb#38 + def string; end + + # @raise [FatalWarning] + # + # source://rack//lib/rack/mock.rb#31 + def write(warning); end +end + +# source://rack//lib/rack/mock.rb#23 +class Rack::MockRequest::FatalWarning < ::RuntimeError; end + +# Rack::MockResponse provides useful helpers for testing your apps. +# Usually, you don't create the MockResponse on your own, but use +# MockRequest. +# +# source://rack//lib/rack/mock.rb#173 +class Rack::MockResponse < ::Rack::Response + # @return [MockResponse] a new instance of MockResponse + # + # source://rack//lib/rack/mock.rb#184 + def initialize(status, headers, body, errors = T.unsafe(nil)); end + + # source://rack//lib/rack/mock.rb#194 + def =~(other); end + + # source://rack//lib/rack/mock.rb#202 + def body; end + + # source://rack//lib/rack/mock.rb#226 + def cookie(name); end + + # Headers + # + # source://rack//lib/rack/mock.rb#179 + def cookies; end + + # @return [Boolean] + # + # source://rack//lib/rack/mock.rb#222 + def empty?; end + + # Errors + # + # source://rack//lib/rack/mock.rb#182 + def errors; end + + # Errors + # + # source://rack//lib/rack/mock.rb#182 + def errors=(_arg0); end + + # source://rack//lib/rack/mock.rb#198 + def match(other); end + + # Headers + # + # source://rack//lib/rack/mock.rb#179 + def original_headers; end + + private + + # source://rack//lib/rack/mock.rb#253 + def identify_cookie_attributes(cookie_filling); end + + # source://rack//lib/rack/mock.rb#232 + def parse_cookies_from_header; end + + class << self + def [](*_arg0); end + end +end + +# A multipart form data parser, adapted from IOWA. +# +# Usually, Rack::Request#POST takes care of calling this. +# +# source://rack//lib/rack/multipart/parser.rb#6 +module Rack::Multipart + class << self + # source://rack//lib/rack/multipart.rb#58 + def build_multipart(params, first = T.unsafe(nil)); end + + # source://rack//lib/rack/multipart.rb#44 + def extract_multipart(req, params = T.unsafe(nil)); end + + # source://rack//lib/rack/multipart.rb#40 + def parse_multipart(env, params = T.unsafe(nil)); end + end +end + +# source://rack//lib/rack/multipart.rb#25 +Rack::Multipart::ATTRIBUTE = T.let(T.unsafe(nil), Regexp) + +# Updated definitions from RFC 2231 +# +# source://rack//lib/rack/multipart.rb#24 +Rack::Multipart::ATTRIBUTE_CHAR = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#19 +Rack::Multipart::BROKEN = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#17 +Rack::Multipart::CONDISP = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#36 +Rack::Multipart::DISPPARM = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#13 +Rack::Multipart::EOL = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/multipart.rb#32 +Rack::Multipart::EXTENDED_INITIAL_NAME = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#34 +Rack::Multipart::EXTENDED_INITIAL_PARAMETER = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#33 +Rack::Multipart::EXTENDED_INITIAL_VALUE = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#29 +Rack::Multipart::EXTENDED_OTHER_NAME = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#31 +Rack::Multipart::EXTENDED_OTHER_PARAMETER = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#30 +Rack::Multipart::EXTENDED_OTHER_VALUE = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#35 +Rack::Multipart::EXTENDED_PARAMETER = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart/generator.rb#5 +class Rack::Multipart::Generator + # @return [Generator] a new instance of Generator + # + # source://rack//lib/rack/multipart/generator.rb#6 + def initialize(params, first = T.unsafe(nil)); end + + # source://rack//lib/rack/multipart/generator.rb#14 + def dump; end + + private + + # source://rack//lib/rack/multipart/generator.rb#87 + def content_for_other(file, name); end + + # source://rack//lib/rack/multipart/generator.rb#75 + def content_for_tempfile(io, file, name); end + + # source://rack//lib/rack/multipart/generator.rb#50 + def flattened_params; end + + # @return [Boolean] + # + # source://rack//lib/rack/multipart/generator.rb#35 + def multipart?; end +end + +# source://rack//lib/rack/multipart.rb#15 +Rack::Multipart::MULTIPART = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#14 +Rack::Multipart::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/multipart.rb#21 +Rack::Multipart::MULTIPART_CONTENT_DISPOSITION = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#22 +Rack::Multipart::MULTIPART_CONTENT_ID = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#20 +Rack::Multipart::MULTIPART_CONTENT_TYPE = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart/parser.rb#7 +class Rack::Multipart::MultipartPartLimitError < ::Errno::EMFILE; end + +# source://rack//lib/rack/multipart/parser.rb#8 +class Rack::Multipart::MultipartTotalPartLimitError < ::StandardError; end + +# source://rack//lib/rack/multipart/parser.rb#10 +class Rack::Multipart::Parser + # @return [Parser] a new instance of Parser + # + # source://rack//lib/rack/multipart/parser.rb#180 + def initialize(boundary, tempfile, bufsize, query_parser); end + + # source://rack//lib/rack/multipart/parser.rb#199 + def on_read(content); end + + # source://rack//lib/rack/multipart/parser.rb#205 + def result; end + + # Returns the value of attribute state. + # + # source://rack//lib/rack/multipart/parser.rb#178 + def state; end + + private + + # source://rack//lib/rack/multipart/parser.rb#302 + def consume_boundary; end + + # source://rack//lib/rack/multipart/parser.rb#300 + def full_boundary; end + + # source://rack//lib/rack/multipart/parser.rb#312 + def get_filename(head); end + + # source://rack//lib/rack/multipart/parser.rb#248 + def handle_consume_token; end + + # source://rack//lib/rack/multipart/parser.rb#377 + def handle_empty_content!(content); end + + # source://rack//lib/rack/multipart/parser.rb#234 + def handle_fast_forward; end + + # source://rack//lib/rack/multipart/parser.rb#281 + def handle_mime_body; end + + # source://rack//lib/rack/multipart/parser.rb#258 + def handle_mime_head; end + + # source://rack//lib/rack/multipart/parser.rb#217 + def run_parser; end + + # source://rack//lib/rack/multipart/parser.rb#349 + def tag_multipart_encoding(filename, content_type, name, body); end + + class << self + # source://rack//lib/rack/multipart/parser.rb#66 + def parse(io, content_length, content_type, tmpfile, bufsize, qp); end + + # source://rack//lib/rack/multipart/parser.rb#59 + def parse_boundary(content_type); end + end +end + +# source://rack//lib/rack/multipart/parser.rb#21 +Rack::Multipart::Parser::BOUNDARY_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart/parser.rb#13 +Rack::Multipart::Parser::BUFSIZE = T.let(T.unsafe(nil), Integer) + +# source://rack//lib/rack/multipart/parser.rb#23 +class Rack::Multipart::Parser::BoundedIO + # @return [BoundedIO] a new instance of BoundedIO + # + # source://rack//lib/rack/multipart/parser.rb#24 + def initialize(io, content_length); end + + # source://rack//lib/rack/multipart/parser.rb#30 + def read(size, outbuf = T.unsafe(nil)); end + + # source://rack//lib/rack/multipart/parser.rb#51 + def rewind; end +end + +# source://rack//lib/rack/multipart/parser.rb#347 +Rack::Multipart::Parser::CHARSET = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/multipart/parser.rb#87 +class Rack::Multipart::Parser::Collector + include ::Enumerable + + # @return [Collector] a new instance of Collector + # + # source://rack//lib/rack/multipart/parser.rb#123 + def initialize(tempfile); end + + # source://rack//lib/rack/multipart/parser.rb#129 + def each; end + + # source://rack//lib/rack/multipart/parser.rb#149 + def on_mime_body(mime_index, content); end + + # source://rack//lib/rack/multipart/parser.rb#153 + def on_mime_finish(mime_index); end + + # source://rack//lib/rack/multipart/parser.rb#133 + def on_mime_head(mime_index, head, filename, content_type, name); end + + private + + # source://rack//lib/rack/multipart/parser.rb#158 + def check_part_limits; end +end + +# source://rack//lib/rack/multipart/parser.rb#111 +class Rack::Multipart::Parser::Collector::BufferPart < ::Rack::Multipart::Parser::Collector::MimePart + # source://rack//lib/rack/multipart/parser.rb#113 + def close; end + + # @return [Boolean] + # + # source://rack//lib/rack/multipart/parser.rb#112 + def file?; end +end + +# source://rack//lib/rack/multipart/parser.rb#88 +class Rack::Multipart::Parser::Collector::MimePart < ::Struct + # @yield [data] + # + # source://rack//lib/rack/multipart/parser.rb#89 + def get_data; end +end + +# source://rack//lib/rack/multipart/parser.rb#116 +class Rack::Multipart::Parser::Collector::TempfilePart < ::Rack::Multipart::Parser::Collector::MimePart + # source://rack//lib/rack/multipart/parser.rb#118 + def close; end + + # @return [Boolean] + # + # source://rack//lib/rack/multipart/parser.rb#117 + def file?; end +end + +# source://rack//lib/rack/multipart/parser.rb#57 +Rack::Multipart::Parser::EMPTY = T.let(T.unsafe(nil), Rack::Multipart::Parser::MultipartInfo) + +# source://rack//lib/rack/multipart/parser.rb#56 +class Rack::Multipart::Parser::MultipartInfo < ::Struct + # Returns the value of attribute params + # + # @return [Object] the current value of params + def params; end + + # Sets the attribute params + # + # @param value [Object] the value to set the attribute params to. + # @return [Object] the newly set value + def params=(_); end + + # Returns the value of attribute tmp_files + # + # @return [Object] the current value of tmp_files + def tmp_files; end + + # Sets the attribute tmp_files + # + # @param value [Object] the value to set the attribute tmp_files to. + # @return [Object] the newly set value + def tmp_files=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# source://rack//lib/rack/multipart/parser.rb#15 +Rack::Multipart::Parser::TEMPFILE_FACTORY = T.let(T.unsafe(nil), Proc) + +# source://rack//lib/rack/multipart/parser.rb#14 +Rack::Multipart::Parser::TEXT_PLAIN = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/multipart.rb#28 +Rack::Multipart::REGULAR_PARAMETER = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#27 +Rack::Multipart::REGULAR_PARAMETER_NAME = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#37 +Rack::Multipart::RFC2183 = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#26 +Rack::Multipart::SECTION = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#16 +Rack::Multipart::TOKEN = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart/uploaded_file.rb#5 +class Rack::Multipart::UploadedFile + # @return [UploadedFile] a new instance of UploadedFile + # + # source://rack//lib/rack/multipart/uploaded_file.rb#12 + def initialize(filepath = T.unsafe(nil), ct = T.unsafe(nil), bin = T.unsafe(nil), path: T.unsafe(nil), content_type: T.unsafe(nil), binary: T.unsafe(nil), filename: T.unsafe(nil), io: T.unsafe(nil)); end + + # The content type of the "uploaded" file + # + # source://rack//lib/rack/multipart/uploaded_file.rb#10 + def content_type; end + + # The content type of the "uploaded" file + # + # source://rack//lib/rack/multipart/uploaded_file.rb#10 + def content_type=(_arg0); end + + # source://rack//lib/rack/multipart/uploaded_file.rb#27 + def local_path; end + + # source://rack//lib/rack/multipart/uploaded_file.rb#36 + def method_missing(method_name, *args, &block); end + + # The filename, *not* including the path, of the "uploaded" file + # + # source://rack//lib/rack/multipart/uploaded_file.rb#7 + def original_filename; end + + # source://rack//lib/rack/multipart/uploaded_file.rb#27 + def path; end + + # @return [Boolean] + # + # source://rack//lib/rack/multipart/uploaded_file.rb#32 + def respond_to?(*args); end +end + +# source://rack//lib/rack/multipart.rb#18 +Rack::Multipart::VALUE = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/null_logger.rb#4 +class Rack::NullLogger + # @return [NullLogger] a new instance of NullLogger + # + # source://rack//lib/rack/null_logger.rb#5 + def initialize(app); end + + # source://rack//lib/rack/null_logger.rb#37 + def <<(msg); end + + # source://rack//lib/rack/null_logger.rb#36 + def add(severity, message = T.unsafe(nil), progname = T.unsafe(nil), &block); end + + # source://rack//lib/rack/null_logger.rb#9 + def call(env); end + + # source://rack//lib/rack/null_logger.rb#35 + def close; end + + # source://rack//lib/rack/null_logger.rb#27 + def datetime_format; end + + # source://rack//lib/rack/null_logger.rb#32 + def datetime_format=(datetime_format); end + + # source://rack//lib/rack/null_logger.rb#15 + def debug(progname = T.unsafe(nil), &block); end + + # @return [Boolean] + # + # source://rack//lib/rack/null_logger.rb#21 + def debug?; end + + # source://rack//lib/rack/null_logger.rb#17 + def error(progname = T.unsafe(nil), &block); end + + # @return [Boolean] + # + # source://rack//lib/rack/null_logger.rb#23 + def error?; end + + # source://rack//lib/rack/null_logger.rb#18 + def fatal(progname = T.unsafe(nil), &block); end + + # @return [Boolean] + # + # source://rack//lib/rack/null_logger.rb#24 + def fatal?; end + + # source://rack//lib/rack/null_logger.rb#28 + def formatter; end + + # source://rack//lib/rack/null_logger.rb#33 + def formatter=(formatter); end + + # source://rack//lib/rack/null_logger.rb#14 + def info(progname = T.unsafe(nil), &block); end + + # @return [Boolean] + # + # source://rack//lib/rack/null_logger.rb#20 + def info?; end + + # source://rack//lib/rack/null_logger.rb#25 + def level; end + + # source://rack//lib/rack/null_logger.rb#30 + def level=(level); end + + # source://rack//lib/rack/null_logger.rb#26 + def progname; end + + # source://rack//lib/rack/null_logger.rb#31 + def progname=(progname); end + + # source://rack//lib/rack/null_logger.rb#29 + def sev_threshold; end + + # source://rack//lib/rack/null_logger.rb#34 + def sev_threshold=(sev_threshold); end + + # source://rack//lib/rack/null_logger.rb#19 + def unknown(progname = T.unsafe(nil), &block); end + + # source://rack//lib/rack/null_logger.rb#16 + def warn(progname = T.unsafe(nil), &block); end + + # @return [Boolean] + # + # source://rack//lib/rack/null_logger.rb#22 + def warn?; end +end + +# source://rack//lib/rack.rb#45 +Rack::OPTIONS = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#42 +Rack::PATCH = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#21 +Rack::PATH_INFO = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#40 +Rack::POST = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#41 +Rack::PUT = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#25 +Rack::QUERY_STRING = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/query_parser.rb#4 +class Rack::QueryParser + # @return [QueryParser] a new instance of QueryParser + # + # source://rack//lib/rack/query_parser.rb#29 + def initialize(params_class, key_space_limit, param_depth_limit); end + + # Returns the value of attribute key_space_limit. + # + # source://rack//lib/rack/query_parser.rb#27 + def key_space_limit; end + + # source://rack//lib/rack/query_parser.rb#128 + def make_params; end + + # source://rack//lib/rack/query_parser.rb#136 + def new_depth_limit(param_depth_limit); end + + # source://rack//lib/rack/query_parser.rb#132 + def new_space_limit(key_space_limit); end + + # normalize_params recursively expands parameters into structural types. If + # the structural types represented by two different parameter names are in + # conflict, a ParameterTypeError is raised. + # + # @raise [ParamsTooDeepError] + # + # source://rack//lib/rack/query_parser.rb#87 + def normalize_params(params, name, v, depth); end + + # Returns the value of attribute param_depth_limit. + # + # source://rack//lib/rack/query_parser.rb#27 + def param_depth_limit; end + + # parse_nested_query expands a query string into structural types. Supported + # types are Arrays, Hashes and basic value types. It is possible to supply + # query strings with parameters of conflicting types, in this case a + # ParameterTypeError is raised. Users are encouraged to return a 400 in this + # case. + # + # source://rack//lib/rack/query_parser.rb#68 + def parse_nested_query(qs, d = T.unsafe(nil)); end + + # Stolen from Mongrel, with some small modifications: + # Parses a query string by breaking it up at the '&' + # and ';' characters. You can also use this to parse + # cookies by changing the characters used in the second + # parameter (which defaults to '&;'). + # + # source://rack//lib/rack/query_parser.rb#40 + def parse_query(qs, d = T.unsafe(nil), &unescaper); end + + private + + # @return [Boolean] + # + # source://rack//lib/rack/query_parser.rb#146 + def params_hash_has_key?(hash, key); end + + # @return [Boolean] + # + # source://rack//lib/rack/query_parser.rb#142 + def params_hash_type?(obj); end + + # source://rack//lib/rack/query_parser.rb#158 + def unescape(s); end + + class << self + # source://rack//lib/rack/query_parser.rb#23 + def make_default(key_space_limit, param_depth_limit); end + end +end + +# source://rack//lib/rack/query_parser.rb#8 +Rack::QueryParser::COMMON_SEP = T.let(T.unsafe(nil), Hash) + +# source://rack//lib/rack/query_parser.rb#7 +Rack::QueryParser::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp) + +# InvalidParameterError is the error that is raised when incoming structural +# parameters (parsed by parse_nested_query) contain invalid format or byte +# sequence. +# +# source://rack//lib/rack/query_parser.rb#17 +class Rack::QueryParser::InvalidParameterError < ::ArgumentError; end + +# ParameterTypeError is the error that is raised when incoming structural +# parameters (parsed by parse_nested_query) contain conflicting types. +# +# source://rack//lib/rack/query_parser.rb#12 +class Rack::QueryParser::ParameterTypeError < ::TypeError; end + +# source://rack//lib/rack/query_parser.rb#162 +class Rack::QueryParser::Params + # @return [Params] a new instance of Params + # + # source://rack//lib/rack/query_parser.rb#163 + def initialize(limit); end + + # source://rack//lib/rack/query_parser.rb#169 + def [](key); end + + # @raise [ParamsTooDeepError] + # + # source://rack//lib/rack/query_parser.rb#173 + def []=(key, value); end + + # @return [Boolean] + # + # source://rack//lib/rack/query_parser.rb#179 + def key?(key); end + + # Recursively unwraps nested `Params` objects and constructs an object + # of the same shape, but using the objects' internal representations + # (Ruby hashes) in place of the objects. The result is a hash consisting + # purely of Ruby primitives. + # + # Mutation warning! + # + # 1. This method mutates the internal representation of the `Params` + # objects in order to save object allocations. + # + # 2. The value you get back is a reference to the internal hash + # representation, not a copy. + # + # 3. Because the `Params` object's internal representation is mutable + # through the `#[]=` method, it is not thread safe. The result of + # getting the hash representation while another thread is adding a + # key to it is non-deterministic. + # + # source://rack//lib/rack/query_parser.rb#201 + def to_h; end + + # Recursively unwraps nested `Params` objects and constructs an object + # of the same shape, but using the objects' internal representations + # (Ruby hashes) in place of the objects. The result is a hash consisting + # purely of Ruby primitives. + # + # Mutation warning! + # + # 1. This method mutates the internal representation of the `Params` + # objects in order to save object allocations. + # + # 2. The value you get back is a reference to the internal hash + # representation, not a copy. + # + # 3. Because the `Params` object's internal representation is mutable + # through the `#[]=` method, it is not thread safe. The result of + # getting the hash representation while another thread is adding a + # key to it is non-deterministic. + # + # source://rack//lib/rack/query_parser.rb#201 + def to_params_hash; end +end + +# ParamsTooDeepError is the error that is raised when params are recursively +# nested over the specified limit. +# +# source://rack//lib/rack/query_parser.rb#21 +class Rack::QueryParser::ParamsTooDeepError < ::RangeError; end + +# source://rack//lib/rack.rb#53 +Rack::RACK_ERRORS = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#63 +Rack::RACK_HIJACK = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#65 +Rack::RACK_HIJACK_IO = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#55 +Rack::RACK_INPUT = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#64 +Rack::RACK_IS_HIJACK = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#54 +Rack::RACK_LOGGER = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#76 +Rack::RACK_METHODOVERRIDE_ORIGINAL_METHOD = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#67 +Rack::RACK_MULTIPART_BUFFER_SIZE = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#68 +Rack::RACK_MULTIPART_TEMPFILE_FACTORY = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#60 +Rack::RACK_MULTIPROCESS = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#59 +Rack::RACK_MULTITHREAD = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#66 +Rack::RACK_RECURSIVE_INCLUDE = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#72 +Rack::RACK_REQUEST_COOKIE_HASH = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#73 +Rack::RACK_REQUEST_COOKIE_STRING = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#70 +Rack::RACK_REQUEST_FORM_HASH = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#69 +Rack::RACK_REQUEST_FORM_INPUT = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#71 +Rack::RACK_REQUEST_FORM_VARS = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#74 +Rack::RACK_REQUEST_QUERY_HASH = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#75 +Rack::RACK_REQUEST_QUERY_STRING = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#61 +Rack::RACK_RUNONCE = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#56 +Rack::RACK_SESSION = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#57 +Rack::RACK_SESSION_OPTIONS = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#77 +Rack::RACK_SESSION_UNPACKED_COOKIE_DATA = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#58 +Rack::RACK_SHOWSTATUS_DETAIL = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#52 +Rack::RACK_TEMPFILES = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#62 +Rack::RACK_URL_SCHEME = T.let(T.unsafe(nil), String) + +# Rack environment variables +# +# source://rack//lib/rack.rb#51 +Rack::RACK_VERSION = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/version.rb#23 +Rack::RELEASE = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#22 +Rack::REQUEST_METHOD = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#23 +Rack::REQUEST_PATH = T.let(T.unsafe(nil), String) + +# Rack::Recursive allows applications called down the chain to +# include data from other applications (by using +# rack['rack.recursive.include'][...] or raise a +# ForwardRequest to redirect internally. +# +# source://rack//lib/rack/recursive.rb#34 +class Rack::Recursive + # @return [Recursive] a new instance of Recursive + # + # source://rack//lib/rack/recursive.rb#35 + def initialize(app); end + + # source://rack//lib/rack/recursive.rb#43 + def _call(env); end + + # source://rack//lib/rack/recursive.rb#39 + def call(env); end + + # source://rack//lib/rack/recursive.rb#50 + def include(env, path); end +end + +# High performant source reloader +# +# This class acts as Rack middleware. +# +# What makes it especially suited for use in a production environment is that +# any file will only be checked once and there will only be made one system +# call stat(2). +# +# Please note that this will not reload files in the background, it does so +# only when actively called. +# +# It is performing a check/reload cycle at the start of every request, but +# also respects a cool down time, during which nothing will be done. +# +# source://rack//lib/rack/reloader.rb#24 +class Rack::Reloader + # @return [Reloader] a new instance of Reloader + # + # source://rack//lib/rack/reloader.rb#27 + def initialize(app, cooldown = T.unsafe(nil), backend = T.unsafe(nil)); end + + # source://rack//lib/rack/reloader.rb#38 + def call(env); end + + # source://rack//lib/rack/reloader.rb#52 + def reload!(stderr = T.unsafe(nil)); end + + # A safe Kernel::load, issuing the hooks depending on the results + # + # source://rack//lib/rack/reloader.rb#60 + def safe_load(file, mtime, stderr = T.unsafe(nil)); end +end + +# source://rack//lib/rack/reloader.rb#70 +module Rack::Reloader::Stat + # Takes a relative or absolute +file+ name, a couple possible +paths+ that + # the +file+ might reside in. Returns the full path and File::Stat for the + # path. + # + # source://rack//lib/rack/reloader.rb#90 + def figure_path(file, paths); end + + # source://rack//lib/rack/reloader.rb#71 + def rotation; end + + # source://rack//lib/rack/reloader.rb#105 + def safe_stat(file); end +end + +# Rack::Request provides a convenient interface to a Rack +# environment. It is stateless, the environment +env+ passed to the +# constructor will be directly modified. +# +# req = Rack::Request.new(env) +# req.post? +# req.params["data"] +# +# source://rack//lib/rack/request.rb#12 +class Rack::Request + include ::Rack::Request::Env + include ::Rack::Request::Helpers + + # @return [Request] a new instance of Request + # + # source://rack//lib/rack/request.rb#26 + def initialize(env); end + + # source://rack//lib/rack/request.rb#40 + def delete_param(k); end + + # source://rack//lib/rack/request.rb#31 + def params; end + + # source://rack//lib/rack/request.rb#31 + def query; end + + # source://rack//lib/rack/request.rb#35 + def update_param(k, v); end + + # source://yard/0.9.37/lib/yard/server/rack_adapter.rb#94 + def version_supplied; end + + # source://yard/0.9.37/lib/yard/server/rack_adapter.rb#94 + def version_supplied=(_arg0); end + + # source://yard/0.9.37/lib/yard/server/rack_adapter.rb#96 + def xhr?; end + + class << self + # Returns the value of attribute ip_filter. + # + # source://rack//lib/rack/request.rb#16 + def ip_filter; end + + # Sets the attribute ip_filter + # + # @param value the value to set the attribute ip_filter to. + # + # source://rack//lib/rack/request.rb#16 + def ip_filter=(_arg0); end + end +end + +# source://rack//lib/rack/request.rb#20 +Rack::Request::ALLOWED_SCHEMES = T.let(T.unsafe(nil), Array) + +# source://rack//lib/rack/request.rb#46 +module Rack::Request::Env + # source://rack//lib/rack/request.rb#50 + def initialize(env); end + + # Add a header that may have multiple values. + # + # Example: + # request.add_header 'Accept', 'image/png' + # request.add_header 'Accept', '*/*' + # + # assert_equal 'image/png,*/*', request.get_header('Accept') + # + # http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 + # + # source://rack//lib/rack/request.rb#91 + def add_header(key, v); end + + # Delete a request specific value for `name`. + # + # source://rack//lib/rack/request.rb#102 + def delete_header(name); end + + # Loops through each key / value pair in the request specific data. + # + # source://rack//lib/rack/request.rb#73 + def each_header(&block); end + + # The environment of the request. + # + # source://rack//lib/rack/request.rb#48 + def env; end + + # If a block is given, it yields to the block if the value hasn't been set + # on the request. + # + # source://rack//lib/rack/request.rb#68 + def fetch_header(name, &block); end + + # Get a request specific value for `name`. + # + # source://rack//lib/rack/request.rb#62 + def get_header(name); end + + # Predicate method to test to see if `name` has been set as request + # specific data + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#57 + def has_header?(name); end + + # Set a request specific value for `name` to `v` + # + # source://rack//lib/rack/request.rb#78 + def set_header(name, v); end + + private + + # source://rack//lib/rack/request.rb#106 + def initialize_copy(other); end +end + +# source://rack//lib/rack/request.rb#111 +module Rack::Request::Helpers + # Returns the data received in the query string. + # + # source://rack//lib/rack/request.rb#426 + def GET; end + + # Returns the data received in the request body. + # + # This method support both application/x-www-form-urlencoded and + # multipart/form-data. + # + # source://rack//lib/rack/request.rb#440 + def POST; end + + # shortcut for request.params[key] + # + # source://rack//lib/rack/request.rb#532 + def [](key); end + + # shortcut for request.params[key] = value + # + # Note that modifications will not be persisted in the env. Use update_param or delete_param if you want to destructively modify params. + # + # source://rack//lib/rack/request.rb#543 + def []=(key, value); end + + # source://rack//lib/rack/request.rb#519 + def accept_encoding; end + + # source://rack//lib/rack/request.rb#523 + def accept_language; end + + # The authority of the incoming request as defined by RFC3976. + # https://tools.ietf.org/html/rfc3986#section-3.2 + # + # In HTTP/1, this is the `host` header. + # In HTTP/2, this is the `:authority` pseudo-header. + # + # source://rack//lib/rack/request.rb#227 + def authority; end + + # source://rack//lib/rack/request.rb#502 + def base_url; end + + # source://rack//lib/rack/request.rb#150 + def body; end + + # The character set of the request body if a "charset" media type + # parameter was given, or nil if no "charset" was specified. Note + # that, per RFC2616, text/* media types that specify no explicit + # charset are to be considered ISO-8859-1. + # + # source://rack//lib/rack/request.rb#400 + def content_charset; end + + # source://rack//lib/rack/request.rb#159 + def content_length; end + + # source://rack//lib/rack/request.rb#271 + def content_type; end + + # source://rack//lib/rack/request.rb#256 + def cookies; end + + # Checks the HTTP request method (or verb) to see if it was of type DELETE + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#181 + def delete?; end + + # Destructively delete a parameter, whether it's in GET or POST. Returns the value of the deleted parameter. + # + # If the parameter is in both GET and POST, the POST value takes precedence since that's how #params works. + # + # env['rack.input'] is not touched. + # + # source://rack//lib/rack/request.rb#497 + def delete_param(k); end + + # Determine whether the request body contains form-data by checking + # the request Content-Type for one of the media-types: + # "application/x-www-form-urlencoded" or "multipart/form-data". The + # list of form-data media types can be modified through the + # +FORM_DATA_MEDIA_TYPES+ array. + # + # A request body is also assumed to contain form-data when no + # Content-Type header is provided and the request_method is POST. + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#412 + def form_data?; end + + # source://rack//lib/rack/request.rb#344 + def forwarded_authority; end + + # source://rack//lib/rack/request.rb#330 + def forwarded_for; end + + # source://rack//lib/rack/request.rb#338 + def forwarded_port; end + + # source://rack//lib/rack/request.rb#515 + def fullpath; end + + # Checks the HTTP request method (or verb) to see if it was of type GET + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#184 + def get?; end + + # Checks the HTTP request method (or verb) to see if it was of type HEAD + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#187 + def head?; end + + # Returns a formatted host, suitable for being used in a URI. + # + # source://rack//lib/rack/request.rb#296 + def host; end + + # The `HTTP_HOST` header. + # + # source://rack//lib/rack/request.rb#281 + def host_authority; end + + # source://rack//lib/rack/request.rb#285 + def host_with_port(authority = T.unsafe(nil)); end + + # Returns an address suitable for being to resolve to an address. + # In the case of a domain name or IPv4 address, the result is the same + # as +host+. In the case of IPv6 or future address formats, the square + # brackets are removed. + # + # source://rack//lib/rack/request.rb#304 + def hostname; end + + # source://rack//lib/rack/request.rb#354 + def ip; end + + # Checks the HTTP request method (or verb) to see if it was of type LINK + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#193 + def link?; end + + # source://rack//lib/rack/request.rb#160 + def logger; end + + # The media type (type/subtype) portion of the CONTENT_TYPE header + # without any media type parameters. e.g., when CONTENT_TYPE is + # "text/plain;charset=utf-8", the media-type is "text/plain". + # + # For more information on the use of media types in HTTP, see: + # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7 + # + # source://rack//lib/rack/request.rb#383 + def media_type; end + + # The media type parameters provided in CONTENT_TYPE as a Hash, or + # an empty Hash if no CONTENT_TYPE or media-type parameters were + # provided. e.g., when the CONTENT_TYPE is "text/plain;charset=utf-8", + # this method responds with the following Hash: + # { 'charset' => 'utf-8' } + # + # source://rack//lib/rack/request.rb#392 + def media_type_params; end + + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#162 + def multithread?; end + + # Checks the HTTP request method (or verb) to see if it was of type OPTIONS + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#190 + def options?; end + + # The union of GET and POST data. + # + # Note that modifications will not be persisted in the env. Use update_param or delete_param if you want to destructively modify params. + # + # source://rack//lib/rack/request.rb#468 + def params; end + + # Determine whether the request body contains data by checking + # the request media_type against registered parse-data media-types + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#421 + def parseable_data?; end + + # Checks the HTTP request method (or verb) to see if it was of type PATCH + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#196 + def patch?; end + + # source://rack//lib/rack/request.rb#511 + def path; end + + # source://rack//lib/rack/request.rb#154 + def path_info; end + + # source://rack//lib/rack/request.rb#155 + def path_info=(s); end + + # source://rack//lib/rack/request.rb#308 + def port; end + + # Checks the HTTP request method (or verb) to see if it was of type POST + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#199 + def post?; end + + # Checks the HTTP request method (or verb) to see if it was of type PUT + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#202 + def put?; end + + # source://rack//lib/rack/request.rb#158 + def query_string; end + + # the referer of the client + # + # source://rack//lib/rack/request.rb#165 + def referer; end + + # the referer of the client + # + # source://rack//lib/rack/request.rb#165 + def referrer; end + + # source://rack//lib/rack/request.rb#157 + def request_method; end + + # source://rack//lib/rack/request.rb#210 + def scheme; end + + # source://rack//lib/rack/request.rb#151 + def script_name; end + + # source://rack//lib/rack/request.rb#152 + def script_name=(s); end + + # The authority as defined by the `SERVER_NAME` and `SERVER_PORT` + # variables. + # + # source://rack//lib/rack/request.rb#233 + def server_authority; end + + # source://rack//lib/rack/request.rb#246 + def server_name; end + + # source://rack//lib/rack/request.rb#250 + def server_port; end + + # source://rack//lib/rack/request.rb#168 + def session; end + + # source://rack//lib/rack/request.rb#174 + def session_options; end + + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#350 + def ssl?; end + + # Checks the HTTP request method (or verb) to see if it was of type TRACE + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#205 + def trace?; end + + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#527 + def trusted_proxy?(ip); end + + # Checks the HTTP request method (or verb) to see if it was of type UNLINK + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#208 + def unlink?; end + + # Destructively update a parameter, whether it's in GET and/or POST. Returns nil. + # + # The parameter is updated wherever it was previous defined, so GET, POST, or both. If it wasn't previously defined, it's inserted into GET. + # + # env['rack.input'] is not touched. + # + # source://rack//lib/rack/request.rb#477 + def update_param(k, v); end + + # Tries to return a remake of the original request URL as a string. + # + # source://rack//lib/rack/request.rb#507 + def url; end + + # source://rack//lib/rack/request.rb#161 + def user_agent; end + + # like Hash#values_at + # + # source://rack//lib/rack/request.rb#552 + def values_at(*keys); end + + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#276 + def xhr?; end + + private + + # source://rack//lib/rack/request.rb#641 + def allowed_scheme(header); end + + # source://rack//lib/rack/request.rb#558 + def default_session; end + + # source://rack//lib/rack/request.rb#645 + def extract_proto_header(header); end + + # source://rack//lib/rack/request.rb#636 + def forwarded_scheme; end + + # source://rack//lib/rack/request.rb#574 + def parse_http_accept_header(header); end + + # source://rack//lib/rack/request.rb#593 + def parse_multipart; end + + # source://rack//lib/rack/request.rb#589 + def parse_query(qs, d = T.unsafe(nil)); end + + # source://rack//lib/rack/request.rb#585 + def query_parser; end + + # source://rack//lib/rack/request.rb#632 + def reject_trusted_ip_addresses(ip_addresses); end + + # source://rack//lib/rack/request.rb#619 + def split_authority(authority); end + + # source://rack//lib/rack/request.rb#597 + def split_header(value); end + + # Assist with compatibility when processing `X-Forwarded-For`. + # + # source://rack//lib/rack/request.rb#561 + def wrap_ipv6(host); end +end + +# source://rack//lib/rack/request.rb#601 +Rack::Request::Helpers::AUTHORITY = T.let(T.unsafe(nil), Regexp) + +# Default ports depending on scheme. Used to decide whether or not +# to include the port in a generated URI. +# +# source://rack//lib/rack/request.rb#130 +Rack::Request::Helpers::DEFAULT_PORTS = T.let(T.unsafe(nil), Hash) + +# The set of form-data media-types. Requests that do not indicate +# one of the media types present in this list will not be eligible +# for form-data / param parsing. +# +# source://rack//lib/rack/request.rb#115 +Rack::Request::Helpers::FORM_DATA_MEDIA_TYPES = T.let(T.unsafe(nil), Array) + +# The address of the client which connected to the proxy. +# +# source://rack//lib/rack/request.rb#133 +Rack::Request::Helpers::HTTP_X_FORWARDED_FOR = T.let(T.unsafe(nil), String) + +# The contents of the host/:authority header sent to the proxy. +# +# source://rack//lib/rack/request.rb#136 +Rack::Request::Helpers::HTTP_X_FORWARDED_HOST = T.let(T.unsafe(nil), String) + +# The port used to connect to the proxy. +# +# source://rack//lib/rack/request.rb#145 +Rack::Request::Helpers::HTTP_X_FORWARDED_PORT = T.let(T.unsafe(nil), String) + +# The protocol used to connect to the proxy. +# +# source://rack//lib/rack/request.rb#142 +Rack::Request::Helpers::HTTP_X_FORWARDED_PROTO = T.let(T.unsafe(nil), String) + +# The value of the scheme sent to the proxy. +# +# source://rack//lib/rack/request.rb#139 +Rack::Request::Helpers::HTTP_X_FORWARDED_SCHEME = T.let(T.unsafe(nil), String) + +# Another way for specifing https scheme was used. +# +# source://rack//lib/rack/request.rb#148 +Rack::Request::Helpers::HTTP_X_FORWARDED_SSL = T.let(T.unsafe(nil), String) + +# The set of media-types. Requests that do not indicate +# one of the media types present in this list will not be eligible +# for param parsing like soap attachments or generic multiparts +# +# source://rack//lib/rack/request.rb#123 +Rack::Request::Helpers::PARSEABLE_DATA_MEDIA_TYPES = T.let(T.unsafe(nil), Array) + +# source://rack//lib/rack/request.rb#21 +Rack::Request::SCHEME_WHITELIST = T.let(T.unsafe(nil), Array) + +# Rack::Response provides a convenient interface to create a Rack +# response. +# +# It allows setting of headers and cookies, and provides useful +# defaults (an OK response with empty headers and body). +# +# You can use Response#write to iteratively generate your response, +# but note that this is buffered by Rack::Response until you call +# +finish+. +finish+ however can take a block inside which calls to +# +write+ are synchronous with the Rack response. +# +# Your application's +call+ should end returning Response#finish. +# +# source://rack//lib/rack/response.rb#18 +class Rack::Response + include ::Rack::Response::Helpers + + # Initialize the response object with the specified body, status + # and headers. + # + # HTTP protocol RFCs. + # conform to the HTTP protocol RFCs. + # + # Providing a body which responds to #to_str is legacy behaviour. + # + # @param body [nil, #each, #to_str] the response body. + # @param status [Integer] the integer status as defined by the + # @param headers [#each] a list of key-value header pairs which + # @return [Response] a new instance of Response + # @yield [_self] + # @yieldparam _self [Rack::Response] the object that the method was called on + # + # source://rack//lib/rack/response.rb#42 + def initialize(body = T.unsafe(nil), status = T.unsafe(nil), headers = T.unsafe(nil)); end + + # source://rack//lib/rack/response.rb#127 + def [](key); end + + # source://rack//lib/rack/response.rb#128 + def []=(key, v); end + + # Returns the value of attribute body. + # + # source://rack//lib/rack/response.rb#26 + def body; end + + # Sets the attribute body + # + # @param value the value to set the attribute body to. + # + # source://rack//lib/rack/response.rb#26 + def body=(_arg0); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#73 + def chunked?; end + + # source://rack//lib/rack/response.rb#118 + def close; end + + # source://rack//lib/rack/response.rb#129 + def delete_header(key); end + + # source://rack//lib/rack/response.rb#98 + def each(&callback); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#122 + def empty?; end + + # Generate a response array consistent with the requirements of the SPEC. + # which is suitable to be returned from the middleware `#call(env)` method. + # + # @return [Array] a 3-tuple suitable of `[status, headers, body]` + # + # source://rack//lib/rack/response.rb#80 + def finish(&block); end + + # source://rack//lib/rack/response.rb#127 + def get_header(key); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#126 + def has_header?(key); end + + # Returns the value of attribute headers. + # + # @deprecated Use {#headers} instead. + # + # source://rack//lib/rack/response.rb#27 + def header; end + + # Returns the value of attribute headers. + # + # source://rack//lib/rack/response.rb#27 + def headers; end + + # Returns the value of attribute length. + # + # source://rack//lib/rack/response.rb#26 + def length; end + + # Sets the attribute length + # + # @param value the value to set the attribute length to. + # + # source://rack//lib/rack/response.rb#26 + def length=(_arg0); end + + # source://rack//lib/rack/response.rb#68 + def redirect(target, status = T.unsafe(nil)); end + + # source://rack//lib/rack/response.rb#128 + def set_header(key, v); end + + # Returns the value of attribute status. + # + # source://rack//lib/rack/response.rb#26 + def status; end + + # Sets the attribute status + # + # @param value the value to set the attribute status to. + # + # source://rack//lib/rack/response.rb#26 + def status=(_arg0); end + + # Generate a response array consistent with the requirements of the SPEC. + # which is suitable to be returned from the middleware `#call(env)` method. + # For *response + # + # @return [Array] a 3-tuple suitable of `[status, headers, body]` + # + # source://rack//lib/rack/response.rb#80 + def to_a(&block); end + + # Append to body and update Content-Length. + # + # NOTE: Do not mix #write and direct #body access! + # + # source://rack//lib/rack/response.rb#112 + def write(chunk); end + + class << self + # source://rack//lib/rack/response.rb#19 + def [](status, headers, body); end + end +end + +# source://rack//lib/rack/response.rb#23 +Rack::Response::CHUNKED = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/response.rb#134 +module Rack::Response::Helpers + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#145 + def accepted?; end + + # Add a header that may have multiple values. + # + # Example: + # response.add_header 'Vary', 'Accept-Encoding' + # response.add_header 'Vary', 'Cookie' + # + # assert_equal 'Accept-Encoding,Cookie', response.get_header('Vary') + # + # http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 + # + # source://rack//lib/rack/response.rb#171 + def add_header(key, v); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#148 + def bad_request?; end + + # Specify that the content should be cached. + # + # @option directive + # @param duration [Integer] The number of seconds until the cache expires. + # @param directive [Hash] a customizable set of options + # + # source://rack//lib/rack/response.rb#246 + def cache!(duration = T.unsafe(nil), directive: T.unsafe(nil)); end + + # source://rack//lib/rack/response.rb#229 + def cache_control; end + + # source://rack//lib/rack/response.rb#233 + def cache_control=(v); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#140 + def client_error?; end + + # source://rack//lib/rack/response.rb#199 + def content_length; end + + # Get the content type of the response. + # + # source://rack//lib/rack/response.rb#182 + def content_type; end + + # Set the content type of the response. + # + # source://rack//lib/rack/response.rb#187 + def content_type=(content_type); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#144 + def created?; end + + # source://rack//lib/rack/response.rb#217 + def delete_cookie(key, value = T.unsafe(nil)); end + + # Specifies that the content shouldn't be cached. Overrides `cache!` if already called. + # + # source://rack//lib/rack/response.rb#238 + def do_not_cache!; end + + # source://rack//lib/rack/response.rb#253 + def etag; end + + # source://rack//lib/rack/response.rb#257 + def etag=(v); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#150 + def forbidden?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#158 + def include?(header); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#137 + def informational?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#135 + def invalid?; end + + # source://rack//lib/rack/response.rb#204 + def location; end + + # source://rack//lib/rack/response.rb#208 + def location=(location); end + + # source://rack//lib/rack/response.rb#191 + def media_type; end + + # source://rack//lib/rack/response.rb#195 + def media_type_params; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#152 + def method_not_allowed?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#147 + def moved_permanently?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#146 + def no_content?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#151 + def not_found?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#143 + def ok?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#153 + def precondition_failed?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#156 + def redirect?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#139 + def redirection?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#141 + def server_error?; end + + # source://rack//lib/rack/response.rb#212 + def set_cookie(key, value); end + + # source://rack//lib/rack/response.rb#221 + def set_cookie_header; end + + # source://rack//lib/rack/response.rb#225 + def set_cookie_header=(v); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#138 + def successful?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#149 + def unauthorized?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#154 + def unprocessable?; end + + protected + + # source://rack//lib/rack/response.rb#287 + def append(chunk); end + + # source://rack//lib/rack/response.rb#263 + def buffered_body!; end +end + +# source://rack//lib/rack/response.rb#301 +class Rack::Response::Raw + include ::Rack::Response::Helpers + + # @return [Raw] a new instance of Raw + # + # source://rack//lib/rack/response.rb#307 + def initialize(status, headers); end + + # source://rack//lib/rack/response.rb#315 + def delete_header(key); end + + # source://rack//lib/rack/response.rb#313 + def get_header(key); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#312 + def has_header?(key); end + + # Returns the value of attribute headers. + # + # source://rack//lib/rack/response.rb#304 + def headers; end + + # source://rack//lib/rack/response.rb#314 + def set_header(key, v); end + + # Returns the value of attribute status. + # + # source://rack//lib/rack/response.rb#305 + def status; end + + # Sets the attribute status + # + # @param value the value to set the attribute status to. + # + # source://rack//lib/rack/response.rb#305 + def status=(_arg0); end +end + +# source://rack//lib/rack/response.rb#24 +Rack::Response::STATUS_WITH_NO_ENTITY_BODY = T.let(T.unsafe(nil), Hash) + +# Class which can make any IO object rewindable, including non-rewindable ones. It does +# this by buffering the data into a tempfile, which is rewindable. +# +# rack.input is required to be rewindable, so if your input stream IO is non-rewindable +# by nature (e.g. a pipe or a socket) then you can wrap it in an object of this class +# to easily make it rewindable. +# +# Don't forget to call #close when you're done. This frees up temporary resources that +# RewindableInput uses, though it does *not* close the original IO object. +# +# source://rack//lib/rack/rewindable_input.rb#16 +class Rack::RewindableInput + # @return [RewindableInput] a new instance of RewindableInput + # + # source://rack//lib/rack/rewindable_input.rb#17 + def initialize(io); end + + # Closes this RewindableInput object without closing the originally + # wrapped IO object. Cleans up any temporary resources that this RewindableInput + # has created. + # + # This method may be called multiple times. It does nothing on subsequent calls. + # + # source://rack//lib/rack/rewindable_input.rb#48 + def close; end + + # source://rack//lib/rack/rewindable_input.rb#33 + def each(&block); end + + # source://rack//lib/rack/rewindable_input.rb#23 + def gets; end + + # source://rack//lib/rack/rewindable_input.rb#28 + def read(*args); end + + # source://rack//lib/rack/rewindable_input.rb#38 + def rewind; end + + private + + # @return [Boolean] + # + # source://rack//lib/rack/rewindable_input.rb#90 + def filesystem_has_posix_semantics?; end + + # source://rack//lib/rack/rewindable_input.rb#61 + def make_rewindable; end +end + +# Sets an "X-Runtime" response header, indicating the response +# time of the request, in seconds +# +# You can put it right before the application to see the processing +# time, or before all the other middlewares to include time for them, +# too. +# +# source://rack//lib/rack/runtime.rb#10 +class Rack::Runtime + # @return [Runtime] a new instance of Runtime + # + # source://rack//lib/rack/runtime.rb#14 + def initialize(app, name = T.unsafe(nil)); end + + # source://rack//lib/rack/runtime.rb#20 + def call(env); end +end + +# source://rack//lib/rack/runtime.rb#11 +Rack::Runtime::FORMAT_STRING = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/runtime.rb#12 +Rack::Runtime::HEADER_NAME = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#24 +Rack::SCRIPT_NAME = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#27 +Rack::SERVER_NAME = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#28 +Rack::SERVER_PORT = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#26 +Rack::SERVER_PROTOCOL = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#33 +Rack::SET_COOKIE = T.let(T.unsafe(nil), String) + +# = Sendfile +# +# The Sendfile middleware intercepts responses whose body is being +# served from a file and replaces it with a server specific X-Sendfile +# header. The web server is then responsible for writing the file contents +# to the client. This can dramatically reduce the amount of work required +# by the Ruby backend and takes advantage of the web server's optimized file +# delivery code. +# +# In order to take advantage of this middleware, the response body must +# respond to +to_path+ and the request must include an X-Sendfile-Type +# header. Rack::Files and other components implement +to_path+ so there's +# rarely anything you need to do in your application. The X-Sendfile-Type +# header is typically set in your web servers configuration. The following +# sections attempt to document +# +# === Nginx +# +# Nginx supports the X-Accel-Redirect header. This is similar to X-Sendfile +# but requires parts of the filesystem to be mapped into a private URL +# hierarchy. +# +# The following example shows the Nginx configuration required to create +# a private "/files/" area, enable X-Accel-Redirect, and pass the special +# X-Sendfile-Type and X-Accel-Mapping headers to the backend: +# +# location ~ /files/(.*) { +# internal; +# alias /var/www/$1; +# } +# +# location / { +# proxy_redirect off; +# +# proxy_set_header Host $host; +# proxy_set_header X-Real-IP $remote_addr; +# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +# +# proxy_set_header X-Sendfile-Type X-Accel-Redirect; +# proxy_set_header X-Accel-Mapping /var/www/=/files/; +# +# proxy_pass http://127.0.0.1:8080/; +# } +# +# Note that the X-Sendfile-Type header must be set exactly as shown above. +# The X-Accel-Mapping header should specify the location on the file system, +# followed by an equals sign (=), followed name of the private URL pattern +# that it maps to. The middleware performs a simple substitution on the +# resulting path. +# +# See Also: https://www.nginx.com/resources/wiki/start/topics/examples/xsendfile +# +# === lighttpd +# +# Lighttpd has supported some variation of the X-Sendfile header for some +# time, although only recent version support X-Sendfile in a reverse proxy +# configuration. +# +# $HTTP["host"] == "example.com" { +# proxy-core.protocol = "http" +# proxy-core.balancer = "round-robin" +# proxy-core.backends = ( +# "127.0.0.1:8000", +# "127.0.0.1:8001", +# ... +# ) +# +# proxy-core.allow-x-sendfile = "enable" +# proxy-core.rewrite-request = ( +# "X-Sendfile-Type" => (".*" => "X-Sendfile") +# ) +# } +# +# See Also: http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModProxyCore +# +# === Apache +# +# X-Sendfile is supported under Apache 2.x using a separate module: +# +# https://tn123.org/mod_xsendfile/ +# +# Once the module is compiled and installed, you can enable it using +# XSendFile config directive: +# +# RequestHeader Set X-Sendfile-Type X-Sendfile +# ProxyPassReverse / http://localhost:8001/ +# XSendFile on +# +# === Mapping parameter +# +# The third parameter allows for an overriding extension of the +# X-Accel-Mapping header. Mappings should be provided in tuples of internal to +# external. The internal values may contain regular expression syntax, they +# will be matched with case indifference. +# +# source://rack//lib/rack/sendfile.rb#100 +class Rack::Sendfile + # @return [Sendfile] a new instance of Sendfile + # + # source://rack//lib/rack/sendfile.rb#101 + def initialize(app, variation = T.unsafe(nil), mappings = T.unsafe(nil)); end + + # source://rack//lib/rack/sendfile.rb#109 + def call(env); end + + private + + # source://rack//lib/rack/sendfile.rb#149 + def map_accel_path(env, path); end + + # source://rack//lib/rack/sendfile.rb#143 + def variation(env); end +end + +# source://rack//lib/rack/server.rb#8 +class Rack::Server + # Options may include: + # * :app + # a rack application to run (overrides :config and :builder) + # * :builder + # a string to evaluate a Rack::Builder from + # * :config + # a rackup configuration file path to load (.ru) + # * :environment + # this selects the middleware that will be wrapped around + # your application. Default options available are: + # - development: CommonLogger, ShowExceptions, and Lint + # - deployment: CommonLogger + # - none: no extra middleware + # note: when the server is a cgi server, CommonLogger is not included. + # * :server + # choose a specific Rack::Handler, e.g. cgi, fcgi, webrick + # * :daemonize + # if true, the server will daemonize itself (fork, detach, etc) + # * :pid + # path to write a pid file after daemonize + # * :Host + # the host address to bind to (used by supporting Rack::Handler) + # * :Port + # the port to bind to (used by supporting Rack::Handler) + # * :AccessLog + # webrick access log options (or supporting Rack::Handler) + # * :debug + # turn on debug output ($DEBUG = true) + # * :warn + # turn on warnings ($-w = true) + # * :include + # add given paths to $LOAD_PATH + # * :require + # require the given libraries + # + # Additional options for profiling app initialization include: + # * :heapfile + # location for ObjectSpace.dump_all to write the output to + # * :profile_file + # location for CPU/Memory (StackProf) profile output (defaults to a tempfile) + # * :profile_mode + # StackProf profile mode (cpu|wall|object) + # + # @return [Server] a new instance of Server + # + # source://rack//lib/rack/server.rb#215 + def initialize(options = T.unsafe(nil)); end + + # source://rack//lib/rack/server.rb#248 + def app; end + + # source://rack//lib/rack/server.rb#234 + def default_options; end + + # source://rack//lib/rack/server.rb#282 + def middleware; end + + # source://rack//lib/rack/server.rb#229 + def options; end + + # Sets the attribute options + # + # @param value the value to set the attribute options to. + # + # source://rack//lib/rack/server.rb#171 + def options=(_arg0); end + + # source://rack//lib/rack/server.rb#330 + def server; end + + # source://rack//lib/rack/server.rb#286 + def start(&block); end + + private + + # source://rack//lib/rack/server.rb#411 + def build_app(app); end + + # source://rack//lib/rack/server.rb#344 + def build_app_and_options_from_config; end + + # source://rack//lib/rack/server.rb#392 + def build_app_from_string; end + + # source://rack//lib/rack/server.rb#440 + def check_pid!; end + + # source://rack//lib/rack/server.rb#425 + def daemonize_app; end + + # source://rack//lib/rack/server.rb#354 + def handle_profiling(heapfile, profile_mode, filename); end + + # source://rack//lib/rack/server.rb#382 + def make_profile_name(filename); end + + # source://rack//lib/rack/server.rb#407 + def opt_parser; end + + # source://rack//lib/rack/server.rb#396 + def parse_options(args); end + + # source://rack//lib/rack/server.rb#450 + def pidfile_process_status; end + + # source://rack//lib/rack/server.rb#421 + def wrapped_app; end + + # source://rack//lib/rack/server.rb#432 + def write_pid; end + + class << self + # source://rack//lib/rack/server.rb#259 + def default_middleware_by_environment; end + + # source://rack//lib/rack/server.rb#253 + def logging_middleware; end + + # source://rack//lib/rack/server.rb#277 + def middleware; end + + # Start a new rack server (like running rackup). This will parse ARGV and + # provide standard ARGV rackup options, defaulting to load 'config.ru'. + # + # Providing an options hash will prevent ARGV parsing and will not include + # any default options. + # + # This method can be used to very easily launch a CGI application, for + # example: + # + # Rack::Server.start( + # :app => lambda do |e| + # [200, {'Content-Type' => 'text/html'}, ['hello world']] + # end, + # :server => 'cgi' + # ) + # + # Further options available here are documented on Rack::Server#initialize + # + # source://rack//lib/rack/server.rb#167 + def start(options = T.unsafe(nil)); end + end +end + +# source://rack//lib/rack/server.rb#11 +class Rack::Server::Options + # source://rack//lib/rack/server.rb#127 + def handler_opts(options); end + + # source://rack//lib/rack/server.rb#12 + def parse!(args); end +end + +# source://rack//lib/rack.rb#136 +module Rack::Session; end + +# source://rack//lib/rack/session/abstract/id.rb#41 +module Rack::Session::Abstract; end + +# source://rack//lib/rack/session/abstract/id.rb#487 +class Rack::Session::Abstract::ID < ::Rack::Session::Abstract::Persisted + # All thread safety and session destroy procedures should occur here. + # Should return a new session id or nil if options[:drop] + # + # source://rack//lib/rack/session/abstract/id.rb#517 + def delete_session(req, sid, options); end + + # All thread safety and session retrieval procedures should occur here. + # Should return [session_id, session]. + # If nil is provided as the session id, generation of a new valid id + # should occur within. + # + # source://rack//lib/rack/session/abstract/id.rb#502 + def find_session(req, sid); end + + # All thread safety and session storage procedures should occur here. + # Must return the session id if the session was saved successfully, or + # false if the session could not be saved. + # + # source://rack//lib/rack/session/abstract/id.rb#510 + def write_session(req, sid, session, options); end + + class << self + # @private + # + # source://rack//lib/rack/session/abstract/id.rb#488 + def inherited(klass); end + end +end + +# ID sets up a basic framework for implementing an id based sessioning +# service. Cookies sent to the client for maintaining sessions will only +# contain an id reference. Only #find_session, #write_session and +# #delete_session are required to be overwritten. +# +# All parameters are optional. +# * :key determines the name of the cookie, by default it is +# 'rack.session' +# * :path, :domain, :expire_after, :secure, and :httponly set the related +# cookie options as by Rack::Response#set_cookie +# * :skip will not a set a cookie in the response nor update the session state +# * :defer will not set a cookie in the response but still update the session +# state if it is used with a backend +# * :renew (implementation dependent) will prompt the generation of a new +# session id, and migration of data to be referenced at the new id. If +# :defer is set, it will be overridden and the cookie will be set. +# * :sidbits sets the number of bits in length that a generated session +# id will be. +# +# These options can be set on a per request basis, at the location of +# env['rack.session.options']. Additionally the id of the +# session can be found within the options hash at the key :id. It is +# highly not recommended to change its value. +# +# Is Rack::Utils::Context compatible. +# +# Not included by default; you must require 'rack/session/abstract/id' +# to use. +# +# source://rack//lib/rack/session/abstract/id.rb#233 +class Rack::Session::Abstract::Persisted + # @return [Persisted] a new instance of Persisted + # + # source://rack//lib/rack/session/abstract/id.rb#250 + def initialize(app, options = T.unsafe(nil)); end + + # source://rack//lib/rack/session/abstract/id.rb#259 + def call(env); end + + # Acquires the session from the environment and the session id from + # the session options and passes them to #write_session. If successful + # and the :defer option is not true, a cookie will be added to the + # response with the session's id. + # + # source://rack//lib/rack/session/abstract/id.rb#373 + def commit_session(req, res); end + + # source://rack//lib/rack/session/abstract/id.rb#263 + def context(env, app = T.unsafe(nil)); end + + # Returns the value of attribute default_options. + # + # source://rack//lib/rack/session/abstract/id.rb#248 + def default_options; end + + # Returns the value of attribute key. + # + # source://rack//lib/rack/session/abstract/id.rb#248 + def key; end + + # Returns the value of attribute sid_secure. + # + # source://rack//lib/rack/session/abstract/id.rb#248 + def sid_secure; end + + private + + # Session should be committed if it was loaded, any of specific options like :renew, :drop + # or :expire_after was given and the security permissions match. Skips if skip is given. + # + # @return [Boolean] + # + # source://rack//lib/rack/session/abstract/id.rb#342 + def commit_session?(req, session, options); end + + # source://rack//lib/rack/session/abstract/id.rb#408 + def cookie_value(data); end + + # Returns the current session id from the SessionHash. + # + # source://rack//lib/rack/session/abstract/id.rb#328 + def current_session_id(req); end + + # All thread safety and session destroy procedures should occur here. + # Should return a new session id or nil if options[:drop] + # + # source://rack//lib/rack/session/abstract/id.rb#448 + def delete_session(req, sid, options); end + + # Extract session id from request object. + # + # source://rack//lib/rack/session/abstract/id.rb#320 + def extract_session_id(request); end + + # All thread safety and session retrieval procedures should occur here. + # Should return [session_id, session]. + # If nil is provided as the session id, generation of a new valid id + # should occur within. + # + # source://rack//lib/rack/session/abstract/id.rb#433 + def find_session(env, sid); end + + # @return [Boolean] + # + # source://rack//lib/rack/session/abstract/id.rb#359 + def force_options?(options); end + + # @return [Boolean] + # + # source://rack//lib/rack/session/abstract/id.rb#355 + def forced_session_update?(session, options); end + + # Generate a new session id using Ruby #rand. The size of the + # session id is controlled by the :sidbits option. + # Monkey patch this to use custom methods for session id generation. + # + # source://rack//lib/rack/session/abstract/id.rb#288 + def generate_sid(secure = T.unsafe(nil)); end + + # source://rack//lib/rack/session/abstract/id.rb#278 + def initialize_sid; end + + # Extracts the session id from provided cookies and passes it and the + # environment to #find_session. + # + # source://rack//lib/rack/session/abstract/id.rb#312 + def load_session(req); end + + # @return [Boolean] + # + # source://rack//lib/rack/session/abstract/id.rb#351 + def loaded_session?(session); end + + # source://rack//lib/rack/session/abstract/id.rb#274 + def make_request(env); end + + # Sets the lazy session at 'rack.session' and places options and session + # metadata into 'rack.session.options'. + # + # source://rack//lib/rack/session/abstract/id.rb#301 + def prepare_session(req); end + + # @return [Boolean] + # + # source://rack//lib/rack/session/abstract/id.rb#363 + def security_matches?(request, options); end + + # Allow subclasses to prepare_session for different Session classes + # + # source://rack//lib/rack/session/abstract/id.rb#424 + def session_class; end + + # Check if the session exists or not. + # + # @return [Boolean] + # + # source://rack//lib/rack/session/abstract/id.rb#334 + def session_exists?(req); end + + # Sets the cookie back to the client with session id. We skip the cookie + # setting if the value didn't change (sid is the same) or expires was given. + # + # source://rack//lib/rack/session/abstract/id.rb#415 + def set_cookie(request, res, cookie); end + + # All thread safety and session storage procedures should occur here. + # Must return the session id if the session was saved successfully, or + # false if the session could not be saved. + # + # source://rack//lib/rack/session/abstract/id.rb#441 + def write_session(req, sid, session, options); end +end + +# source://rack//lib/rack/session/abstract/id.rb#234 +Rack::Session::Abstract::Persisted::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://rack//lib/rack/session/abstract/id.rb#453 +class Rack::Session::Abstract::PersistedSecure < ::Rack::Session::Abstract::Persisted + # source://rack//lib/rack/session/abstract/id.rb#471 + def extract_session_id(*_arg0); end + + # source://rack//lib/rack/session/abstract/id.rb#465 + def generate_sid(*_arg0); end + + private + + # source://rack//lib/rack/session/abstract/id.rb#482 + def cookie_value(data); end + + # source://rack//lib/rack/session/abstract/id.rb#478 + def session_class; end +end + +# source://rack//lib/rack/session/abstract/id.rb#454 +class Rack::Session::Abstract::PersistedSecure::SecureSessionHash < ::Rack::Session::Abstract::SessionHash + # source://rack//lib/rack/session/abstract/id.rb#455 + def [](key); end +end + +# SessionHash is responsible to lazily load the session from store. +# +# source://rack//lib/rack/session/abstract/id.rb#44 +class Rack::Session::Abstract::SessionHash + include ::Enumerable + + # @return [SessionHash] a new instance of SessionHash + # + # source://rack//lib/rack/session/abstract/id.rb#62 + def initialize(store, req); end + + # source://rack//lib/rack/session/abstract/id.rb#82 + def [](key); end + + # source://rack//lib/rack/session/abstract/id.rb#108 + def []=(key, value); end + + # source://rack//lib/rack/session/abstract/id.rb#114 + def clear; end + + # source://rack//lib/rack/session/abstract/id.rb#140 + def delete(key); end + + # source://rack//lib/rack/session/abstract/id.rb#119 + def destroy; end + + # source://rack//lib/rack/session/abstract/id.rb#87 + def dig(key, *keys); end + + # source://rack//lib/rack/session/abstract/id.rb#77 + def each(&block); end + + # @return [Boolean] + # + # source://rack//lib/rack/session/abstract/id.rb#163 + def empty?; end + + # @return [Boolean] + # + # source://rack//lib/rack/session/abstract/id.rb#153 + def exists?; end + + # source://rack//lib/rack/session/abstract/id.rb#92 + def fetch(key, default = T.unsafe(nil), &block); end + + # @return [Boolean] + # + # source://rack//lib/rack/session/abstract/id.rb#101 + def has_key?(key); end + + # source://rack//lib/rack/session/abstract/id.rb#68 + def id; end + + # Sets the attribute id + # + # @param value the value to set the attribute id to. + # + # source://rack//lib/rack/session/abstract/id.rb#46 + def id=(_arg0); end + + # @return [Boolean] + # + # source://rack//lib/rack/session/abstract/id.rb#101 + def include?(key); end + + # source://rack//lib/rack/session/abstract/id.rb#145 + def inspect; end + + # @return [Boolean] + # + # source://rack//lib/rack/session/abstract/id.rb#101 + def key?(key); end + + # source://rack//lib/rack/session/abstract/id.rb#168 + def keys; end + + # @return [Boolean] + # + # source://rack//lib/rack/session/abstract/id.rb#159 + def loaded?; end + + # source://rack//lib/rack/session/abstract/id.rb#129 + def merge!(hash); end + + # source://rack//lib/rack/session/abstract/id.rb#73 + def options; end + + # source://rack//lib/rack/session/abstract/id.rb#135 + def replace(hash); end + + # source://rack//lib/rack/session/abstract/id.rb#108 + def store(key, value); end + + # source://rack//lib/rack/session/abstract/id.rb#124 + def to_hash; end + + # source://rack//lib/rack/session/abstract/id.rb#129 + def update(hash); end + + # source://rack//lib/rack/session/abstract/id.rb#173 + def values; end + + private + + # source://rack//lib/rack/session/abstract/id.rb#188 + def load!; end + + # source://rack//lib/rack/session/abstract/id.rb#180 + def load_for_read!; end + + # source://rack//lib/rack/session/abstract/id.rb#184 + def load_for_write!; end + + # source://rack//lib/rack/session/abstract/id.rb#194 + def stringify_keys(other); end + + class << self + # source://rack//lib/rack/session/abstract/id.rb#50 + def find(req); end + + # source://rack//lib/rack/session/abstract/id.rb#54 + def set(req, session); end + + # source://rack//lib/rack/session/abstract/id.rb#58 + def set_options(req, options); end + end +end + +# source://rack//lib/rack/session/abstract/id.rb#48 +Rack::Session::Abstract::SessionHash::Unspecified = T.let(T.unsafe(nil), Object) + +# Rack::Session::Cookie provides simple cookie based session management. +# By default, the session is a Ruby Hash stored as base64 encoded marshalled +# data set to :key (default: rack.session). The object that encodes the +# session data is configurable and must respond to +encode+ and +decode+. +# Both methods must take a string and return a string. +# +# When the secret key is set, cookie data is checked for data integrity. +# The old secret key is also accepted and allows graceful secret rotation. +# +# Example: +# +# use Rack::Session::Cookie, :key => 'rack.session', +# :domain => 'foo.com', +# :path => '/', +# :expire_after => 2592000, +# :secret => 'change_me', +# :old_secret => 'also_change_me' +# +# All parameters are optional. +# +# +# Rack::Session::Cookie.new(application, { +# :coder => Rack::Session::Cookie::Identity.new +# }) +# +# +# Rack::Session::Cookie.new(application, { +# :coder => Class.new { +# def encode(str); str.reverse; end +# def decode(str); str.reverse; end +# }.new +# }) +# +# source://rack//lib/rack/session/cookie.rb#50 +class Rack::Session::Cookie < ::Rack::Session::Abstract::PersistedSecure + # @return [Cookie] a new instance of Cookie + # + # source://rack//lib/rack/session/cookie.rb#108 + def initialize(app, options = T.unsafe(nil)); end + + # Returns the value of attribute coder. + # + # source://rack//lib/rack/session/cookie.rb#106 + def coder; end + + private + + # source://rack//lib/rack/session/cookie.rb#181 + def delete_session(req, session_id, options); end + + # @return [Boolean] + # + # source://rack//lib/rack/session/cookie.rb#186 + def digest_match?(data, digest); end + + # source://rack//lib/rack/session/cookie.rb#133 + def extract_session_id(request); end + + # source://rack//lib/rack/session/cookie.rb#127 + def find_session(req, sid); end + + # source://rack//lib/rack/session/cookie.rb#193 + def generate_hmac(data, secret); end + + # source://rack//lib/rack/session/cookie.rb#150 + def persistent_session_id!(data, sid = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rack//lib/rack/session/cookie.rb#197 + def secure?(options); end + + # source://rack//lib/rack/session/cookie.rb#137 + def unpacked_cookie_data(request); end + + # source://rack//lib/rack/session/cookie.rb#165 + def write_session(req, session_id, session, options); end +end + +# Encode session cookies as Base64 +# +# source://rack//lib/rack/session/cookie.rb#52 +class Rack::Session::Cookie::Base64 + # source://rack//lib/rack/session/cookie.rb#57 + def decode(str); end + + # source://rack//lib/rack/session/cookie.rb#53 + def encode(str); end +end + +# N.B. Unlike other encoding methods, the contained objects must be a +# valid JSON composite type, either a Hash or an Array. +# +# source://rack//lib/rack/session/cookie.rb#75 +class Rack::Session::Cookie::Base64::JSON < ::Rack::Session::Cookie::Base64 + # source://rack//lib/rack/session/cookie.rb#80 + def decode(str); end + + # source://rack//lib/rack/session/cookie.rb#76 + def encode(obj); end +end + +# Encode session cookies as Marshaled Base64 data +# +# source://rack//lib/rack/session/cookie.rb#62 +class Rack::Session::Cookie::Base64::Marshal < ::Rack::Session::Cookie::Base64 + # source://rack//lib/rack/session/cookie.rb#67 + def decode(str); end + + # source://rack//lib/rack/session/cookie.rb#63 + def encode(str); end +end + +# source://rack//lib/rack/session/cookie.rb#86 +class Rack::Session::Cookie::Base64::ZipJSON < ::Rack::Session::Cookie::Base64 + # source://rack//lib/rack/session/cookie.rb#91 + def decode(str); end + + # source://rack//lib/rack/session/cookie.rb#87 + def encode(obj); end +end + +# Use no encoding for session cookies +# +# source://rack//lib/rack/session/cookie.rb#101 +class Rack::Session::Cookie::Identity + # source://rack//lib/rack/session/cookie.rb#103 + def decode(str); end + + # source://rack//lib/rack/session/cookie.rb#102 + def encode(str); end +end + +# source://rack//lib/rack/session/cookie.rb#156 +class Rack::Session::Cookie::SessionId + # @return [SessionId] a new instance of SessionId + # + # source://rack//lib/rack/session/cookie.rb#159 + def initialize(session_id, cookie_value); end + + # Returns the value of attribute cookie_value. + # + # source://rack//lib/rack/session/cookie.rb#157 + def cookie_value; end +end + +# Rack::Session::Pool provides simple cookie based session management. +# Session data is stored in a hash held by @pool. +# In the context of a multithreaded environment, sessions being +# committed to the pool is done in a merging manner. +# +# The :drop option is available in rack.session.options if you wish to +# explicitly remove the session from the session cache. +# +# Example: +# myapp = MyRackApp.new +# sessioned = Rack::Session::Pool.new(myapp, +# :domain => 'foo.com', +# :expire_after => 2592000 +# ) +# Rack::Handler::WEBrick.run sessioned +# +# source://rack//lib/rack/session/pool.rb#29 +class Rack::Session::Pool < ::Rack::Session::Abstract::PersistedSecure + # @return [Pool] a new instance of Pool + # + # source://rack//lib/rack/session/pool.rb#33 + def initialize(app, options = T.unsafe(nil)); end + + # source://rack//lib/rack/session/pool.rb#63 + def delete_session(req, session_id, options); end + + # source://rack//lib/rack/session/pool.rb#46 + def find_session(req, sid); end + + # source://rack//lib/rack/session/pool.rb#39 + def generate_sid; end + + # Returns the value of attribute mutex. + # + # source://rack//lib/rack/session/pool.rb#30 + def mutex; end + + # Returns the value of attribute pool. + # + # source://rack//lib/rack/session/pool.rb#30 + def pool; end + + # source://rack//lib/rack/session/pool.rb#71 + def with_lock(req); end + + # source://rack//lib/rack/session/pool.rb#56 + def write_session(req, session_id, new_session, options); end + + private + + # source://rack//lib/rack/session/pool.rb#80 + def get_session_with_fallback(sid); end +end + +# source://rack//lib/rack/session/pool.rb#31 +Rack::Session::Pool::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://rack//lib/rack/session/abstract/id.rb#15 +class Rack::Session::SessionId + # @return [SessionId] a new instance of SessionId + # + # source://rack//lib/rack/session/abstract/id.rb#20 + def initialize(public_id); end + + # Returns the value of attribute public_id. + # + # source://rack//lib/rack/session/abstract/id.rb#18 + def cookie_value; end + + # @return [Boolean] + # + # source://rack//lib/rack/session/abstract/id.rb#31 + def empty?; end + + # source://rack//lib/rack/session/abstract/id.rb#32 + def inspect; end + + # source://rack//lib/rack/session/abstract/id.rb#24 + def private_id; end + + # Returns the value of attribute public_id. + # + # source://rack//lib/rack/session/abstract/id.rb#18 + def public_id; end + + # Returns the value of attribute public_id. + # + # source://rack//lib/rack/session/abstract/id.rb#18 + def to_s; end + + private + + # source://rack//lib/rack/session/abstract/id.rb#36 + def hash_sid(sid); end +end + +# source://rack//lib/rack/session/abstract/id.rb#16 +Rack::Session::SessionId::ID_VERSION = T.let(T.unsafe(nil), Integer) + +# Rack::ShowExceptions catches all exceptions raised from the app it +# wraps. It shows a useful backtrace with the sourcefile and +# clickable context, the whole Rack environment and the request +# data. +# +# Be careful when you use this on public-facing sites as it could +# reveal information helpful to attackers. +# +# source://rack//lib/rack/show_exceptions.rb#15 +class Rack::ShowExceptions + # @return [ShowExceptions] a new instance of ShowExceptions + # + # source://rack//lib/rack/show_exceptions.rb#18 + def initialize(app); end + + # source://rack//lib/rack/show_exceptions.rb#22 + def call(env); end + + # source://rack//lib/rack/show_exceptions.rb#57 + def dump_exception(exception); end + + # source://rack//lib/rack/show_exceptions.rb#103 + def h(obj); end + + # @return [Boolean] + # + # source://rack//lib/rack/show_exceptions.rb#48 + def prefers_plaintext?(env); end + + # source://rack//lib/rack/show_exceptions.rb#63 + def pretty(env, exception); end + + # source://rack//lib/rack/show_exceptions.rb#99 + def template; end + + private + + # @return [Boolean] + # + # source://rack//lib/rack/show_exceptions.rb#52 + def accepts_html?(env); end +end + +# source://rack//lib/rack/show_exceptions.rb#16 +Rack::ShowExceptions::CONTEXT = T.let(T.unsafe(nil), Integer) + +# source://rack//lib/rack/show_exceptions.rb#118 +Rack::ShowExceptions::TEMPLATE = T.let(T.unsafe(nil), ERB) + +# Rack::ShowStatus catches all empty responses and replaces them +# with a site explaining the error. +# +# Additional details can be put into rack.showstatus.detail +# and will be shown as HTML. If such details exist, the error page +# is always rendered, even if the reply was not empty. +# +# source://rack//lib/rack/show_status.rb#13 +class Rack::ShowStatus + # @return [ShowStatus] a new instance of ShowStatus + # + # source://rack//lib/rack/show_status.rb#14 + def initialize(app); end + + # source://rack//lib/rack/show_status.rb#19 + def call(env); end + + # source://rack//lib/rack/show_status.rb#44 + def h(obj); end +end + +# source://rack//lib/rack/show_status.rb#59 +Rack::ShowStatus::TEMPLATE = T.let(T.unsafe(nil), String) + +# The Rack::Static middleware intercepts requests for static files +# (javascript files, images, stylesheets, etc) based on the url prefixes or +# route mappings passed in the options, and serves them using a Rack::Files +# object. This allows a Rack stack to serve both static and dynamic content. +# +# Examples: +# +# Serve all requests beginning with /media from the "media" folder located +# in the current directory (ie media/*): +# +# use Rack::Static, :urls => ["/media"] +# +# Same as previous, but instead of returning 404 for missing files under +# /media, call the next middleware: +# +# use Rack::Static, :urls => ["/media"], :cascade => true +# +# Serve all requests beginning with /css or /images from the folder "public" +# in the current directory (ie public/css/* and public/images/*): +# +# use Rack::Static, :urls => ["/css", "/images"], :root => "public" +# +# Serve all requests to / with "index.html" from the folder "public" in the +# current directory (ie public/index.html): +# +# use Rack::Static, :urls => {"/" => 'index.html'}, :root => 'public' +# +# Serve all requests normally from the folder "public" in the current +# directory but uses index.html as default route for "/" +# +# use Rack::Static, :urls => [""], :root => 'public', :index => +# 'index.html' +# +# Set custom HTTP Headers for based on rules: +# +# use Rack::Static, :root => 'public', +# :header_rules => [ +# [rule, {header_field => content, header_field => content}], +# [rule, {header_field => content}] +# ] +# +# Rules for selecting files: +# +# 1) All files +# Provide the :all symbol +# :all => Matches every file +# +# 2) Folders +# Provide the folder path as a string +# '/folder' or '/folder/subfolder' => Matches files in a certain folder +# +# 3) File Extensions +# Provide the file extensions as an array +# ['css', 'js'] or %w(css js) => Matches files ending in .css or .js +# +# 4) Regular Expressions / Regexp +# Provide a regular expression +# %r{\.(?:css|js)\z} => Matches files ending in .css or .js +# /\.(?:eot|ttf|otf|woff2|woff|svg)\z/ => Matches files ending in +# the most common web font formats (.eot, .ttf, .otf, .woff2, .woff, .svg) +# Note: This Regexp is available as a shortcut, using the :fonts rule +# +# 5) Font Shortcut +# Provide the :fonts symbol +# :fonts => Uses the Regexp rule stated right above to match all common web font endings +# +# Rule Ordering: +# Rules are applied in the order that they are provided. +# List rather general rules above special ones. +# +# Complete example use case including HTTP header rules: +# +# use Rack::Static, :root => 'public', +# :header_rules => [ +# # Cache all static files in public caches (e.g. Rack::Cache) +# # as well as in the browser +# [:all, {'Cache-Control' => 'public, max-age=31536000'}], +# +# # Provide web fonts with cross-origin access-control-headers +# # Firefox requires this when serving assets using a Content Delivery Network +# [:fonts, {'Access-Control-Allow-Origin' => '*'}] +# ] +# +# source://rack//lib/rack/static.rb#88 +class Rack::Static + # @return [Static] a new instance of Static + # + # source://rack//lib/rack/static.rb#91 + def initialize(app, options = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rack//lib/rack/static.rb#107 + def add_index_root?(path); end + + # Convert HTTP header rules to HTTP headers + # + # source://rack//lib/rack/static.rb#166 + def applicable_rules(path); end + + # source://rack//lib/rack/static.rb#123 + def call(env); end + + # source://rack//lib/rack/static.rb#119 + def can_serve(path); end + + # source://rack//lib/rack/static.rb#111 + def overwrite_file_path(path); end + + # source://rack//lib/rack/static.rb#115 + def route_file(path); end +end + +# source://rack//lib/rack.rb#48 +Rack::TRACE = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack.rb#34 +Rack::TRANSFER_ENCODING = T.let(T.unsafe(nil), String) + +# Middleware tracks and cleans Tempfiles created throughout a request (i.e. Rack::Multipart) +# Ideas/strategy based on posts by Eric Wong and Charles Oliver Nutter +# https://groups.google.com/forum/#!searchin/rack-devel/temp/rack-devel/brK8eh-MByw/sw61oJJCGRMJ +# +# source://rack//lib/rack/tempfile_reaper.rb#8 +class Rack::TempfileReaper + # @return [TempfileReaper] a new instance of TempfileReaper + # + # source://rack//lib/rack/tempfile_reaper.rb#9 + def initialize(app); end + + # source://rack//lib/rack/tempfile_reaper.rb#13 + def call(env); end +end + +# source://rack//lib/rack.rb#47 +Rack::UNLINK = T.let(T.unsafe(nil), String) + +# Rack::URLMap takes a hash mapping urls or paths to apps, and +# dispatches accordingly. Support for HTTP/1.1 host names exists if +# the URLs start with http:// or https://. +# +# URLMap modifies the SCRIPT_NAME and PATH_INFO such that the part +# relevant for dispatch is in the SCRIPT_NAME, and the rest in the +# PATH_INFO. This should be taken care of when you need to +# reconstruct the URL in order to create links. +# +# URLMap dispatches in such a way that the longest paths are tried +# first, since they are most specific. +# +# source://rack//lib/rack/urlmap.rb#18 +class Rack::URLMap + # @return [URLMap] a new instance of URLMap + # + # source://rack//lib/rack/urlmap.rb#19 + def initialize(map = T.unsafe(nil)); end + + # source://rack//lib/rack/urlmap.rb#46 + def call(env); end + + # source://rack//lib/rack/urlmap.rb#23 + def remap(map); end + + private + + # @return [Boolean] + # + # source://rack//lib/rack/urlmap.rb#85 + def casecmp?(v1, v2); end +end + +# Rack::Utils contains a grab-bag of useful methods for writing web +# applications adopted from all kinds of Ruby libraries. +# +# source://rack//lib/rack/utils.rb#16 +module Rack::Utils + private + + # source://rack//lib/rack/utils.rb#237 + def add_cookie_to_header(header, key, value); end + + # Adds a cookie that will *remove* a cookie from the client. Hence the + # strange method name. + # + # source://rack//lib/rack/utils.rb#320 + def add_remove_cookie_to_header(header, key, value = T.unsafe(nil)); end + + # Return best accept value to use, based on the algorithm + # in RFC 2616 Section 14. If there are multiple best + # matches (same specificity and quality), the value returned + # is arbitrary. + # + # source://rack//lib/rack/utils.rb#159 + def best_q_match(q_value_header, available_mimes); end + + # source://rack//lib/rack/utils.rb#126 + def build_nested_query(value, prefix = T.unsafe(nil)); end + + # source://rack//lib/rack/utils.rb#116 + def build_query(params); end + + # Parses the "Range:" header, if present, into an array of Range objects. + # Returns nil if the header is missing or syntactically invalid. + # Returns an empty array if none of the ranges are satisfiable. + # + # source://rack//lib/rack/utils.rb#352 + def byte_ranges(env, size); end + + # source://rack//lib/rack/utils.rb#609 + def clean_path_info(path_info); end + + # :nocov: + # + # source://rack//lib/rack/utils.rb#97 + def clock_time; end + + # source://rack//lib/rack/utils.rb#313 + def delete_cookie_header!(header, key, value = T.unsafe(nil)); end + + # URI escapes. (CGI style space to +) + # + # source://rack//lib/rack/utils.rb#38 + def escape(s); end + + # Escape ampersands, brackets and quotes to their HTML/XML entities. + # + # source://rack//lib/rack/utils.rb#184 + def escape_html(string); end + + # Like URI escaping, but with %20 instead of +. Strictly speaking this is + # true URI escaping. + # + # source://rack//lib/rack/utils.rb#44 + def escape_path(s); end + + # source://rack//lib/rack/utils.rb#357 + def get_byte_ranges(http_range, size); end + + # source://rack//lib/rack/utils.rb#283 + def make_delete_cookie_header(header, key, value); end + + # source://rack//lib/rack/utils.rb#220 + def parse_cookies(env); end + + # source://rack//lib/rack/utils.rb#224 + def parse_cookies_header(header); end + + # source://rack//lib/rack/utils.rb#112 + def parse_nested_query(qs, d = T.unsafe(nil)); end + + # source://rack//lib/rack/utils.rb#108 + def parse_query(qs, d = T.unsafe(nil), &unescaper); end + + # source://rack//lib/rack/utils.rb#144 + def q_values(q_value_header); end + + # Modified version of stdlib time.rb Time#rfc2822 to use '%d-%b-%Y' instead + # of '% %b %Y'. + # It assumes that the time is in GMT to comply to the RFC 2109. + # + # NOTE: I'm not sure the RFC says it requires GMT, but is ambiguous enough + # that I'm certain someone implemented only that option. + # Do not use %a and %b from Time.strptime, it would use localized names for + # weekday and month. + # + # source://rack//lib/rack/utils.rb#343 + def rfc2109(time); end + + # source://rack//lib/rack/utils.rb#330 + def rfc2822(time); end + + # Constant time string comparison. + # + # NOTE: the values compared should be of fixed length, such as strings + # that have already been processed by HMAC. This should not be used + # on variable length plaintext strings because it could leak length info + # via timing attacks. + # + # source://rack//lib/rack/utils.rb#395 + def secure_compare(a, b); end + + # source://rack//lib/rack/utils.rb#188 + def select_best_encoding(available_encodings, accept_encoding); end + + # source://rack//lib/rack/utils.rb#278 + def set_cookie_header!(header, key, value); end + + # source://rack//lib/rack/utils.rb#599 + def status_code(status); end + + # Unescapes a URI escaped string with +encoding+. +encoding+ will be the + # target encoding of the string returned, and it defaults to UTF-8 + # + # source://rack//lib/rack/utils.rb#56 + def unescape(s, encoding = T.unsafe(nil)); end + + # Unescapes the **path** component of a URI. See Rack::Utils.unescape for + # unescaping query parameters or form components. + # + # source://rack//lib/rack/utils.rb#50 + def unescape_path(s); end + + # source://rack//lib/rack/utils.rb#626 + def valid_path?(path); end + + class << self + # source://rack//lib/rack/utils.rb#237 + def add_cookie_to_header(header, key, value); end + + # Adds a cookie that will *remove* a cookie from the client. Hence the + # strange method name. + # + # source://rack//lib/rack/utils.rb#320 + def add_remove_cookie_to_header(header, key, value = T.unsafe(nil)); end + + # Return best accept value to use, based on the algorithm + # in RFC 2616 Section 14. If there are multiple best + # matches (same specificity and quality), the value returned + # is arbitrary. + # + # source://rack//lib/rack/utils.rb#159 + def best_q_match(q_value_header, available_mimes); end + + # source://rack//lib/rack/utils.rb#126 + def build_nested_query(value, prefix = T.unsafe(nil)); end + + # source://rack//lib/rack/utils.rb#116 + def build_query(params); end + + # Parses the "Range:" header, if present, into an array of Range objects. + # Returns nil if the header is missing or syntactically invalid. + # Returns an empty array if none of the ranges are satisfiable. + # + # source://rack//lib/rack/utils.rb#352 + def byte_ranges(env, size); end + + # source://rack//lib/rack/utils.rb#609 + def clean_path_info(path_info); end + + # source://rack//lib/rack/utils.rb#97 + def clock_time; end + + # Returns the value of attribute default_query_parser. + # + # source://rack//lib/rack/utils.rb#29 + def default_query_parser; end + + # Sets the attribute default_query_parser + # + # @param value the value to set the attribute default_query_parser to. + # + # source://rack//lib/rack/utils.rb#29 + def default_query_parser=(_arg0); end + + # source://rack//lib/rack/utils.rb#313 + def delete_cookie_header!(header, key, value = T.unsafe(nil)); end + + # URI escapes. (CGI style space to +) + # + # source://rack//lib/rack/utils.rb#38 + def escape(s); end + + # Escape ampersands, brackets and quotes to their HTML/XML entities. + # + # source://rack//lib/rack/utils.rb#184 + def escape_html(string); end + + # Like URI escaping, but with %20 instead of +. Strictly speaking this is + # true URI escaping. + # + # source://rack//lib/rack/utils.rb#44 + def escape_path(s); end + + # source://rack//lib/rack/utils.rb#357 + def get_byte_ranges(http_range, size); end + + # source://rack//lib/rack/utils.rb#88 + def key_space_limit; end + + # source://rack//lib/rack/utils.rb#92 + def key_space_limit=(v); end + + # source://rack//lib/rack/utils.rb#283 + def make_delete_cookie_header(header, key, value); end + + # Returns the value of attribute multipart_file_limit. + # + # source://rack//lib/rack/utils.rb#63 + def multipart_file_limit; end + + # Sets the attribute multipart_file_limit + # + # @param value the value to set the attribute multipart_file_limit to. + # + # source://rack//lib/rack/utils.rb#63 + def multipart_file_limit=(_arg0); end + + # Returns the value of attribute multipart_file_limit. + # multipart_part_limit is the original name of multipart_file_limit, but + # the limit only counts parts with filenames. + # + # source://rack//lib/rack/utils.rb#63 + def multipart_part_limit; end + + # Sets the attribute multipart_file_limit + # + # @param value the value to set the attribute multipart_file_limit to. + # + # source://rack//lib/rack/utils.rb#63 + def multipart_part_limit=(_arg0); end + + # Returns the value of attribute multipart_total_part_limit. + # + # source://rack//lib/rack/utils.rb#61 + def multipart_total_part_limit; end + + # Sets the attribute multipart_total_part_limit + # + # @param value the value to set the attribute multipart_total_part_limit to. + # + # source://rack//lib/rack/utils.rb#61 + def multipart_total_part_limit=(_arg0); end + + # source://rack//lib/rack/utils.rb#80 + def param_depth_limit; end + + # source://rack//lib/rack/utils.rb#84 + def param_depth_limit=(v); end + + # source://rack//lib/rack/utils.rb#220 + def parse_cookies(env); end + + # source://rack//lib/rack/utils.rb#224 + def parse_cookies_header(header); end + + # source://rack//lib/rack/utils.rb#112 + def parse_nested_query(qs, d = T.unsafe(nil)); end + + # source://rack//lib/rack/utils.rb#108 + def parse_query(qs, d = T.unsafe(nil), &unescaper); end + + # source://rack//lib/rack/utils.rb#144 + def q_values(q_value_header); end + + # Modified version of stdlib time.rb Time#rfc2822 to use '%d-%b-%Y' instead + # of '% %b %Y'. + # It assumes that the time is in GMT to comply to the RFC 2109. + # + # NOTE: I'm not sure the RFC says it requires GMT, but is ambiguous enough + # that I'm certain someone implemented only that option. + # Do not use %a and %b from Time.strptime, it would use localized names for + # weekday and month. + # + # source://rack//lib/rack/utils.rb#343 + def rfc2109(time); end + + # source://rack//lib/rack/utils.rb#330 + def rfc2822(time); end + + # Constant time string comparison. + # + # NOTE: the values compared should be of fixed length, such as strings + # that have already been processed by HMAC. This should not be used + # on variable length plaintext strings because it could leak length info + # via timing attacks. + # + # source://rack//lib/rack/utils.rb#395 + def secure_compare(a, b); end + + # source://rack//lib/rack/utils.rb#188 + def select_best_encoding(available_encodings, accept_encoding); end + + # source://rack//lib/rack/utils.rb#278 + def set_cookie_header!(header, key, value); end + + # source://rack//lib/rack/utils.rb#599 + def status_code(status); end + + # Unescapes a URI escaped string with +encoding+. +encoding+ will be the + # target encoding of the string returned, and it defaults to UTF-8 + # + # source://rack//lib/rack/utils.rb#56 + def unescape(s, encoding = T.unsafe(nil)); end + + # Unescapes the **path** component of a URI. See Rack::Utils.unescape for + # unescaping query parameters or form components. + # + # source://rack//lib/rack/utils.rb#50 + def unescape_path(s); end + + # @return [Boolean] + # + # source://rack//lib/rack/utils.rb#626 + def valid_path?(path); end + end +end + +# source://rack//lib/rack/utils.rb#22 +Rack::Utils::COMMON_SEP = T.let(T.unsafe(nil), Hash) + +# Context allows the use of a compatible middleware at different points +# in a request handling stack. A compatible middleware must define +# #context which should take the arguments env and app. The first of which +# would be the request environment. The second of which would be the rack +# application that the request would be forwarded to. +# +# source://rack//lib/rack/utils.rb#410 +class Rack::Utils::Context + # @return [Context] a new instance of Context + # + # source://rack//lib/rack/utils.rb#413 + def initialize(app_f, app_r); end + + # Returns the value of attribute app. + # + # source://rack//lib/rack/utils.rb#411 + def app; end + + # source://rack//lib/rack/utils.rb#418 + def call(env); end + + # source://rack//lib/rack/utils.rb#426 + def context(env, app = T.unsafe(nil)); end + + # Returns the value of attribute for. + # + # source://rack//lib/rack/utils.rb#411 + def for; end + + # source://rack//lib/rack/utils.rb#422 + def recontext(app); end +end + +# source://rack//lib/rack/utils.rb#21 +Rack::Utils::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/utils.rb#172 +Rack::Utils::ESCAPE_HTML = T.let(T.unsafe(nil), Hash) + +# source://rack//lib/rack/utils.rb#181 +Rack::Utils::ESCAPE_HTML_PATTERN = T.let(T.unsafe(nil), Regexp) + +# Every standard HTTP code mapped to the appropriate message. +# Generated with: +# curl -s https://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv | \ +# ruby -ne 'm = /^(\d{3}),(?!Unassigned|\(Unused\))([^,]+)/.match($_) and \ +# puts "#{m[1]} => \x27#{m[2].strip}\x27,"' +# +# source://rack//lib/rack/utils.rb#526 +Rack::Utils::HTTP_STATUS_CODES = T.let(T.unsafe(nil), Hash) + +# A case-insensitive Hash that preserves the original case of a +# header when set. +# +# @api private +# +# source://rack//lib/rack/utils.rb#435 +class Rack::Utils::HeaderHash < ::Hash + # @api private + # @return [HeaderHash] a new instance of HeaderHash + # + # source://rack//lib/rack/utils.rb#444 + def initialize(hash = T.unsafe(nil)); end + + # @api private + # + # source://rack//lib/rack/utils.rb#474 + def [](k); end + + # @api private + # + # source://rack//lib/rack/utils.rb#478 + def []=(k, v); end + + # on clear, we need to clear @names hash + # + # @api private + # + # source://rack//lib/rack/utils.rb#457 + def clear; end + + # @api private + # + # source://rack//lib/rack/utils.rb#485 + def delete(k); end + + # @api private + # + # source://rack//lib/rack/utils.rb#462 + def each; end + + # @api private + # @return [Boolean] + # + # source://rack//lib/rack/utils.rb#491 + def has_key?(k); end + + # @api private + # @return [Boolean] + # + # source://rack//lib/rack/utils.rb#491 + def include?(k); end + + # @api private + # @return [Boolean] + # + # source://rack//lib/rack/utils.rb#491 + def key?(k); end + + # @api private + # @return [Boolean] + # + # source://rack//lib/rack/utils.rb#491 + def member?(k); end + + # @api private + # + # source://rack//lib/rack/utils.rb#504 + def merge(other); end + + # @api private + # + # source://rack//lib/rack/utils.rb#499 + def merge!(other); end + + # @api private + # + # source://rack//lib/rack/utils.rb#509 + def replace(other); end + + # @api private + # + # source://rack//lib/rack/utils.rb#468 + def to_hash; end + + protected + + # @api private + # + # source://rack//lib/rack/utils.rb#516 + def names; end + + private + + # on dup/clone, we need to duplicate @names hash + # + # @api private + # + # source://rack//lib/rack/utils.rb#451 + def initialize_copy(other); end + + class << self + # @api private + # + # source://rack//lib/rack/utils.rb#436 + def [](headers); end + end +end + +# source://rack//lib/rack/utils.rb#20 +Rack::Utils::InvalidParameterError = Rack::QueryParser::InvalidParameterError + +# source://rack//lib/rack/utils.rb#23 +Rack::Utils::KeySpaceConstrainedParams = Rack::QueryParser::Params + +# source://rack//lib/rack/utils.rb#624 +Rack::Utils::NULL_BYTE = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/utils.rb#607 +Rack::Utils::PATH_SEPS = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/utils.rb#19 +Rack::Utils::ParameterTypeError = Rack::QueryParser::ParameterTypeError + +# source://rack//lib/rack/utils.rb#25 +Rack::Utils::RFC2822_DAY_NAME = T.let(T.unsafe(nil), Array) + +# source://rack//lib/rack/utils.rb#26 +Rack::Utils::RFC2822_MONTH_NAME = T.let(T.unsafe(nil), Array) + +# Responses with HTTP status codes that should not have an entity body +# +# source://rack//lib/rack/utils.rb#593 +Rack::Utils::STATUS_WITH_NO_ENTITY_BODY = T.let(T.unsafe(nil), Hash) + +# source://rack//lib/rack/utils.rb#595 +Rack::Utils::SYMBOL_TO_STATUS_CODE = T.let(T.unsafe(nil), Hash) + +# The Rack protocol version number implemented. +# +# source://rack//lib/rack/version.rb#16 +Rack::VERSION = T.let(T.unsafe(nil), Array) diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/rbi@0.1.14.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rbi@0.1.14.rbi new file mode 100644 index 0000000..f7e518b --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rbi@0.1.14.rbi @@ -0,0 +1,3327 @@ +# 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`. + + +# source://rbi//lib/rbi.rb#7 +module RBI; end + +# source://rbi//lib/rbi/model.rb#1043 +class RBI::Arg < ::RBI::Node + # source://rbi//lib/rbi/model.rb#1055 + sig { params(value: ::String, loc: T.nilable(::RBI::Loc)).void } + def initialize(value, loc: T.unsafe(nil)); end + + # source://rbi//lib/rbi/model.rb#1061 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/model.rb#1066 + sig { returns(::String) } + def to_s; end + + # source://rbi//lib/rbi/model.rb#1047 + sig { returns(::String) } + def value; end +end + +# Attributes +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://rbi//lib/rbi/model.rb#351 +class RBI::Attr < ::RBI::NodeWithComments + include ::RBI::Indexable + + abstract! + + # source://rbi//lib/rbi/model.rb#376 + sig do + params( + name: ::Symbol, + names: T::Array[::Symbol], + visibility: ::RBI::Visibility, + sigs: T::Array[::RBI::Sig], + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#414 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # @abstract + # + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#61 + sig { abstract.returns(T::Array[::RBI::Method]) } + def convert_to_methods; end + + # @abstract + # + # source://rbi//lib/rbi/model.rb#384 + sig { abstract.returns(T::Array[::String]) } + def fully_qualified_names; end + + # source://rbi//lib/rbi/index.rb#113 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#422 + sig { override.params(other: ::RBI::Node).void } + def merge_with(other); end + + # source://rbi//lib/rbi/model.rb#358 + sig { returns(T::Array[::Symbol]) } + def names; end + + # source://rbi//lib/rbi/model.rb#364 + sig { returns(T::Array[::RBI::Sig]) } + def sigs; end + + # source://rbi//lib/rbi/model.rb#361 + sig { returns(::RBI::Visibility) } + def visibility; end + + # @return [Visibility] + # + # source://rbi//lib/rbi/model.rb#361 + def visibility=(_arg0); end + + private + + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#89 + 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 + + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#110 + sig do + params( + name: ::String, + sig: T.nilable(::RBI::Sig), + attribute_type: T.nilable(::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 + + # @raise [UnexpectedMultipleSigsError] + # + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#66 + sig(:final) { returns([T.nilable(::RBI::Sig), T.nilable(::String)]) } + def parse_sig; end +end + +# source://rbi//lib/rbi/model.rb#387 +class RBI::AttrAccessor < ::RBI::Attr + # source://rbi//lib/rbi/model.rb#401 + sig do + params( + name: ::Symbol, + names: ::Symbol, + visibility: ::RBI::Visibility, + sigs: T::Array[::RBI::Sig], + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#454 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#140 + sig { override.returns(T::Array[::RBI::Method]) } + def convert_to_methods; end + + # source://rbi//lib/rbi/model.rb#407 + sig { override.returns(T::Array[::String]) } + def fully_qualified_names; end + + # source://rbi//lib/rbi/model.rb#413 + sig { override.returns(::String) } + def to_s; end +end + +# source://rbi//lib/rbi/model.rb#419 +class RBI::AttrReader < ::RBI::Attr + # source://rbi//lib/rbi/model.rb#433 + sig do + params( + name: ::Symbol, + names: ::Symbol, + visibility: ::RBI::Visibility, + sigs: T::Array[::RBI::Sig], + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#436 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#154 + sig { override.returns(T::Array[::RBI::Method]) } + def convert_to_methods; end + + # source://rbi//lib/rbi/model.rb#439 + sig { override.returns(T::Array[::String]) } + def fully_qualified_names; end + + # source://rbi//lib/rbi/model.rb#445 + sig { override.returns(::String) } + def to_s; end +end + +# source://rbi//lib/rbi/model.rb#451 +class RBI::AttrWriter < ::RBI::Attr + # source://rbi//lib/rbi/model.rb#465 + sig do + params( + name: ::Symbol, + names: ::Symbol, + visibility: ::RBI::Visibility, + sigs: T::Array[::RBI::Sig], + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#445 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#163 + sig { override.returns(T::Array[::RBI::Method]) } + def convert_to_methods; end + + # source://rbi//lib/rbi/model.rb#471 + sig { override.returns(T::Array[::String]) } + def fully_qualified_names; end + + # source://rbi//lib/rbi/model.rb#477 + sig { override.returns(::String) } + def to_s; end +end + +# An arbitrary blank line that can be added both in trees and comments +# +# source://rbi//lib/rbi/model.rb#76 +class RBI::BlankLine < ::RBI::Comment + # source://rbi//lib/rbi/model.rb#80 + sig { params(loc: T.nilable(::RBI::Loc)).void } + def initialize(loc: T.unsafe(nil)); end +end + +# source://rbi//lib/rbi/model.rb#816 +class RBI::BlockParam < ::RBI::Param + # source://rbi//lib/rbi/model.rb#827 + sig do + params( + name: ::String, + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/model.rb#838 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/model.rb#833 + sig { override.returns(::String) } + def to_s; end +end + +# source://rbi//lib/rbi/model.rb#220 +class RBI::Class < ::RBI::Scope + # source://rbi//lib/rbi/model.rb#238 + sig do + params( + name: ::String, + superclass_name: T.nilable(::String), + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#378 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # source://rbi//lib/rbi/model.rb#246 + sig { override.returns(::String) } + def fully_qualified_name; end + + # source://rbi//lib/rbi/model.rb#224 + sig { returns(::String) } + def name; end + + # @return [String] + # + # source://rbi//lib/rbi/model.rb#224 + def name=(_arg0); end + + # source://rbi//lib/rbi/model.rb#227 + sig { returns(T.nilable(::String)) } + def superclass_name; end + + # @return [String, nil] + # + # source://rbi//lib/rbi/model.rb#227 + def superclass_name=(_arg0); end +end + +# source://rbi//lib/rbi/model.rb#55 +class RBI::Comment < ::RBI::Node + # source://rbi//lib/rbi/model.rb#62 + sig { params(text: ::String, loc: T.nilable(::RBI::Loc)).void } + def initialize(text, loc: T.unsafe(nil)); end + + # source://rbi//lib/rbi/model.rb#68 + sig { params(other: ::Object).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/model.rb#59 + sig { returns(::String) } + def text; end + + # @return [String] + # + # source://rbi//lib/rbi/model.rb#59 + 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 +# ~~~ +# +# source://rbi//lib/rbi/rewriters/merge_trees.rb#591 +class RBI::ConflictTree < ::RBI::Tree + # source://rbi//lib/rbi/rewriters/merge_trees.rb#601 + sig { params(left_name: ::String, right_name: ::String).void } + def initialize(left_name: T.unsafe(nil), right_name: T.unsafe(nil)); end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#595 + sig { returns(::RBI::Tree) } + def left; end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#598 + sig { returns(::String) } + def left_name; end + + # @return [Tree] + # + # source://rbi//lib/rbi/rewriters/merge_trees.rb#595 + def right; end + + # @return [String] + # + # source://rbi//lib/rbi/rewriters/merge_trees.rb#598 + def right_name; end +end + +# Consts +# +# source://rbi//lib/rbi/model.rb#314 +class RBI::Const < ::RBI::NodeWithComments + include ::RBI::Indexable + + # source://rbi//lib/rbi/model.rb#329 + sig do + params( + name: ::String, + value: ::String, + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#405 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # source://rbi//lib/rbi/model.rb#337 + sig { returns(::String) } + def fully_qualified_name; end + + # source://rbi//lib/rbi/index.rb#103 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # source://rbi//lib/rbi/model.rb#318 + sig { returns(::String) } + def name; end + + # source://rbi//lib/rbi/model.rb#344 + sig { override.returns(::String) } + def to_s; end + + # @return [String] + # + # source://rbi//lib/rbi/model.rb#318 + def value; end +end + +# source://rbi//lib/rbi/rewriters/merge_trees.rb#351 +class RBI::DuplicateNodeError < ::RBI::Error; end + +# source://rbi//lib/rbi.rb#8 +class RBI::Error < ::StandardError; end + +# source://rbi//lib/rbi/model.rb#891 +class RBI::Extend < ::RBI::Mixin + include ::RBI::Indexable + + # source://rbi//lib/rbi/model.rb#903 + sig do + params( + name: ::String, + names: ::String, + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#504 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # source://rbi//lib/rbi/index.rb#143 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # source://rbi//lib/rbi/model.rb#909 + sig { override.returns(::String) } + def to_s; end +end + +# source://rbi//lib/rbi/model.rb#139 +class RBI::File + # source://rbi//lib/rbi/model.rb#158 + sig do + params( + strictness: T.nilable(::String), + comments: 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 + + # source://rbi//lib/rbi/model.rb#166 + sig { params(node: ::RBI::Node).void } + def <<(node); end + + # source://rbi//lib/rbi/model.rb#149 + sig { returns(T::Array[::RBI::Comment]) } + def comments; end + + # @return [Array] + # + # source://rbi//lib/rbi/model.rb#149 + def comments=(_arg0); end + + # source://rbi//lib/rbi/model.rb#171 + sig { returns(T::Boolean) } + def empty?; end + + # source://rbi//lib/rbi/printer.rb#744 + 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 + + # source://rbi//lib/rbi/model.rb#143 + sig { returns(::RBI::Tree) } + def root; end + + # @return [Tree] + # + # source://rbi//lib/rbi/model.rb#143 + def root=(_arg0); end + + # source://rbi//lib/rbi/model.rb#146 + sig { returns(T.nilable(::String)) } + def strictness; end + + # @return [String, nil] + # + # source://rbi//lib/rbi/model.rb#146 + def strictness=(_arg0); end + + # source://rbi//lib/rbi/printer.rb#750 + 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 + +# source://rbi//lib/rbi/formatter.rb#5 +class RBI::Formatter + # source://rbi//lib/rbi/formatter.rb#24 + 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_methods: T::Boolean, + sort_nodes: 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_methods: T.unsafe(nil), sort_nodes: T.unsafe(nil)); end + + # source://rbi//lib/rbi/formatter.rb#47 + sig { params(file: ::RBI::File).void } + def format_file(file); end + + # source://rbi//lib/rbi/formatter.rb#52 + sig { params(tree: ::RBI::Tree).void } + def format_tree(tree); end + + # source://rbi//lib/rbi/formatter.rb#12 + sig { returns(T.nilable(::Integer)) } + def max_line_length; end + + # @return [Integer, nil] + # + # source://rbi//lib/rbi/formatter.rb#12 + def max_line_length=(_arg0); end + + # source://rbi//lib/rbi/formatter.rb#41 + sig { params(file: ::RBI::File).returns(::String) } + def print_file(file); end + + # source://rbi//lib/rbi/formatter.rb#9 + sig { params(sort_nodes: T::Boolean).returns(T::Boolean) } + def sort_nodes=(sort_nodes); end +end + +# source://rbi//lib/rbi/rewriters/group_nodes.rb#87 +class RBI::Group < ::RBI::Tree + # source://rbi//lib/rbi/rewriters/group_nodes.rb#94 + sig { params(kind: ::RBI::Group::Kind).void } + def initialize(kind); end + + # source://rbi//lib/rbi/rewriters/group_nodes.rb#91 + sig { returns(::RBI::Group::Kind) } + def kind; end +end + +# source://rbi//lib/rbi/rewriters/group_nodes.rb#99 +class RBI::Group::Kind < ::T::Enum + enums do + Mixins = new + RequiredAncestors = new + Helpers = new + TypeMembers = new + MixesInClassMethods = new + Sends = new + Attrs = new + TStructFields = new + TEnums = new + Inits = new + Methods = new + SingletonClasses = new + Consts = new + end +end + +# source://rbi//lib/rbi/rewriters/group_nodes.rb#5 +class RBI::GroupNodesError < ::RBI::Error; end + +# Sorbet's misc. +# +# source://rbi//lib/rbi/model.rb#1374 +class RBI::Helper < ::RBI::NodeWithComments + include ::RBI::Indexable + + # source://rbi//lib/rbi/model.rb#1388 + sig do + params( + name: ::String, + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#522 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # source://rbi//lib/rbi/index.rb#173 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # source://rbi//lib/rbi/model.rb#1378 + sig { returns(::String) } + def name; end + + # source://rbi//lib/rbi/model.rb#1395 + sig { override.returns(::String) } + def to_s; end +end + +# source://rbi//lib/rbi/model.rb#868 +class RBI::Include < ::RBI::Mixin + include ::RBI::Indexable + + # source://rbi//lib/rbi/model.rb#880 + sig do + params( + name: ::String, + names: ::String, + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#495 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # source://rbi//lib/rbi/index.rb#133 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # source://rbi//lib/rbi/model.rb#886 + sig { override.returns(::String) } + def to_s; end +end + +# source://rbi//lib/rbi/index.rb#5 +class RBI::Index < ::RBI::Visitor + # source://rbi//lib/rbi/index.rb#21 + sig { void } + def initialize; end + + # source://rbi//lib/rbi/index.rb#32 + sig { params(id: ::String).returns(T::Array[::RBI::Node]) } + def [](id); end + + # source://rbi//lib/rbi/index.rb#37 + sig { params(nodes: ::RBI::Node).void } + def index(*nodes); end + + # source://rbi//lib/rbi/index.rb#27 + sig { returns(T::Array[::String]) } + def keys; end + + # source://rbi//lib/rbi/index.rb#42 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + private + + # source://rbi//lib/rbi/index.rb#59 + sig { params(node: T.all(::RBI::Indexable, ::RBI::Node)).void } + def index_node(node); end + + class << self + # source://rbi//lib/rbi/index.rb#13 + 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 +# +# @abstract Subclasses must implement the `abstract` methods below. +# +# source://rbi//lib/rbi/index.rb#74 +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 + # + # source://rbi//lib/rbi/index.rb#85 + sig { abstract.returns(T::Array[::String]) } + def index_ids; end +end + +# source://rbi//lib/rbi/model.rb#1071 +class RBI::KwArg < ::RBI::Arg + # source://rbi//lib/rbi/model.rb#1084 + sig { params(keyword: ::String, value: ::String, loc: T.nilable(::RBI::Loc)).void } + def initialize(keyword, value, loc: T.unsafe(nil)); end + + # source://rbi//lib/rbi/model.rb#1090 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/model.rb#1075 + sig { returns(::String) } + def keyword; end + + # source://rbi//lib/rbi/model.rb#1095 + sig { returns(::String) } + def to_s; end +end + +# source://rbi//lib/rbi/model.rb#757 +class RBI::KwOptParam < ::RBI::Param + # source://rbi//lib/rbi/model.rb#772 + sig do + params( + name: ::String, + value: ::String, + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/model.rb#784 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/model.rb#779 + sig { override.returns(::String) } + def to_s; end + + # source://rbi//lib/rbi/model.rb#761 + sig { returns(::String) } + def value; end +end + +# source://rbi//lib/rbi/model.rb#730 +class RBI::KwParam < ::RBI::Param + # source://rbi//lib/rbi/model.rb#741 + sig do + params( + name: ::String, + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/model.rb#752 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/model.rb#747 + sig { override.returns(::String) } + def to_s; end +end + +# source://rbi//lib/rbi/model.rb#789 +class RBI::KwRestParam < ::RBI::Param + # source://rbi//lib/rbi/model.rb#800 + sig do + params( + name: ::String, + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/model.rb#811 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/model.rb#806 + sig { override.returns(::String) } + def to_s; end +end + +# source://rbi//lib/rbi/loc.rb#5 +class RBI::Loc + # source://rbi//lib/rbi/loc.rb#38 + 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 + + # @return [Integer, nil] + # + # source://rbi//lib/rbi/loc.rb#27 + def begin_column; end + + # source://rbi//lib/rbi/loc.rb#27 + sig { returns(T.nilable(::Integer)) } + def begin_line; end + + # @return [Integer, nil] + # + # source://rbi//lib/rbi/loc.rb#27 + def end_column; end + + # @return [Integer, nil] + # + # source://rbi//lib/rbi/loc.rb#27 + def end_line; end + + # source://rbi//lib/rbi/loc.rb#24 + sig { returns(T.nilable(::String)) } + def file; end + + # source://rbi//lib/rbi/loc.rb#56 + sig { returns(T.nilable(::String)) } + def source; end + + # source://rbi//lib/rbi/loc.rb#47 + sig { returns(::String) } + def to_s; end + + class << self + # source://rbi//lib/rbi/loc.rb#12 + 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 +# +# source://rbi//lib/rbi/rewriters/merge_trees.rb#330 +class RBI::MergeTree < ::RBI::Tree + # source://rbi//lib/rbi/rewriters/merge_trees.rb#344 + 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#334 + sig { returns(T::Array[::RBI::Rewriters::Merge::Conflict]) } + def conflicts; end +end + +# Methods and args +# +# source://rbi//lib/rbi/model.rb#485 +class RBI::Method < ::RBI::NodeWithComments + include ::RBI::Indexable + + # source://rbi//lib/rbi/model.rb#515 + sig do + params( + name: ::String, + params: T::Array[::RBI::Param], + is_singleton: T::Boolean, + visibility: ::RBI::Visibility, + sigs: T::Array[::RBI::Sig], + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/model.rb#535 + sig { params(param: ::RBI::Param).void } + def <<(param); end + + # source://rbi//lib/rbi/model.rb#570 + sig { params(name: ::String).void } + def add_block_param(name); end + + # source://rbi//lib/rbi/model.rb#560 + sig { params(name: ::String, default_value: ::String).void } + def add_kw_opt_param(name, default_value); end + + # source://rbi//lib/rbi/model.rb#555 + sig { params(name: ::String).void } + def add_kw_param(name); end + + # source://rbi//lib/rbi/model.rb#565 + sig { params(name: ::String).void } + def add_kw_rest_param(name); end + + # source://rbi//lib/rbi/model.rb#545 + sig { params(name: ::String, default_value: ::String).void } + def add_opt_param(name, default_value); end + + # source://rbi//lib/rbi/model.rb#540 + sig { params(name: ::String).void } + def add_param(name); end + + # source://rbi//lib/rbi/model.rb#550 + sig { params(name: ::String).void } + def add_rest_param(name); end + + # source://rbi//lib/rbi/model.rb#587 + sig do + params( + params: T::Array[::RBI::SigParam], + return_type: T.nilable(::String), + is_abstract: T::Boolean, + is_override: T::Boolean, + is_overridable: T::Boolean, + is_final: T::Boolean, + type_params: T::Array[::String], + checked: T.nilable(::Symbol), + block: 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#463 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # source://rbi//lib/rbi/model.rb#613 + sig { returns(::String) } + def fully_qualified_name; end + + # source://rbi//lib/rbi/index.rb#123 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # source://rbi//lib/rbi/model.rb#495 + sig { returns(T::Boolean) } + def is_singleton; end + + # @return [Boolean] + # + # source://rbi//lib/rbi/model.rb#495 + def is_singleton=(_arg0); end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#472 + sig { override.params(other: ::RBI::Node).void } + def merge_with(other); end + + # source://rbi//lib/rbi/model.rb#489 + sig { returns(::String) } + def name; end + + # @return [String] + # + # source://rbi//lib/rbi/model.rb#489 + def name=(_arg0); end + + # source://rbi//lib/rbi/model.rb#492 + sig { returns(T::Array[::RBI::Param]) } + def params; end + + # source://rbi//lib/rbi/model.rb#501 + sig { returns(T::Array[::RBI::Sig]) } + def sigs; end + + # @return [Array] + # + # source://rbi//lib/rbi/model.rb#501 + def sigs=(_arg0); end + + # source://rbi//lib/rbi/model.rb#622 + sig { override.returns(::String) } + def to_s; end + + # source://rbi//lib/rbi/model.rb#498 + sig { returns(::RBI::Visibility) } + def visibility; end + + # @return [Visibility] + # + # source://rbi//lib/rbi/model.rb#498 + def visibility=(_arg0); end +end + +# source://rbi//lib/rbi/model.rb#1435 +class RBI::MixesInClassMethods < ::RBI::Mixin + include ::RBI::Indexable + + # source://rbi//lib/rbi/model.rb#1447 + sig do + params( + name: ::String, + names: ::String, + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#513 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # source://rbi//lib/rbi/index.rb#153 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # source://rbi//lib/rbi/model.rb#1453 + sig { override.returns(::String) } + def to_s; end +end + +# Mixins +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://rbi//lib/rbi/model.rb#845 +class RBI::Mixin < ::RBI::NodeWithComments + abstract! + + # source://rbi//lib/rbi/model.rb#862 + sig do + params( + name: ::String, + names: T::Array[::String], + loc: T.nilable(::RBI::Loc), + comments: T::Array[::RBI::Comment] + ).void + end + def initialize(name, names, loc: T.unsafe(nil), comments: T.unsafe(nil)); end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#486 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # source://rbi//lib/rbi/model.rb#852 + sig { returns(T::Array[::String]) } + def names; end +end + +# source://rbi//lib/rbi/model.rb#192 +class RBI::Module < ::RBI::Scope + # source://rbi//lib/rbi/model.rb#206 + sig do + params( + name: ::String, + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#387 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # source://rbi//lib/rbi/model.rb#213 + sig { override.returns(::String) } + def fully_qualified_name; end + + # source://rbi//lib/rbi/model.rb#196 + sig { returns(::String) } + def name; end + + # @return [String] + # + # source://rbi//lib/rbi/model.rb#196 + def name=(_arg0); end +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://rbi//lib/rbi/model.rb#7 +class RBI::Node + abstract! + + # source://rbi//lib/rbi/model.rb#20 + 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? + # + # source://rbi//lib/rbi/rewriters/merge_trees.rb#287 + sig { params(_other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(_other); end + + # source://rbi//lib/rbi/model.rb#26 + sig { void } + def detach; end + + # source://rbi//lib/rbi/model.rb#17 + sig { returns(T.nilable(::RBI::Loc)) } + def loc; end + + # @return [Loc, nil] + # + # source://rbi//lib/rbi/model.rb#17 + def loc=(_arg0); end + + # Merge `self` and `other` into a single definition + # + # source://rbi//lib/rbi/rewriters/merge_trees.rb#293 + sig { params(other: ::RBI::Node).void } + def merge_with(other); end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#296 + sig { returns(T.nilable(::RBI::ConflictTree)) } + def parent_conflict_tree; end + + # source://rbi//lib/rbi/model.rb#48 + sig { returns(T.nilable(::RBI::Scope)) } + def parent_scope; end + + # source://rbi//lib/rbi/model.rb#14 + sig { returns(T.nilable(::RBI::Tree)) } + def parent_tree; end + + # @return [Tree, nil] + # + # source://rbi//lib/rbi/model.rb#14 + def parent_tree=(_arg0); end + + # source://rbi//lib/rbi/printer.rb#768 + 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 + + # @raise [ReplaceNodeError] + # + # source://rbi//lib/rbi/model.rb#35 + sig { params(node: ::RBI::Node).void } + def replace(node); end + + # source://rbi//lib/rbi/rewriters/filter_versions.rb#94 + sig { params(version: ::Gem::Version).returns(T::Boolean) } + def satisfies_version?(version); end + + # source://rbi//lib/rbi/printer.rb#774 + 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 It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://rbi//lib/rbi/model.rb#85 +class RBI::NodeWithComments < ::RBI::Node + abstract! + + # source://rbi//lib/rbi/model.rb#95 + sig { params(loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void } + def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil)); end + + # source://rbi//lib/rbi/model.rb#101 + sig { returns(T::Array[::String]) } + def annotations; end + + # source://rbi//lib/rbi/model.rb#92 + sig { returns(T::Array[::RBI::Comment]) } + def comments; end + + # @return [Array] + # + # source://rbi//lib/rbi/model.rb#92 + def comments=(_arg0); end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#311 + sig { override.params(other: ::RBI::Node).void } + def merge_with(other); end + + # source://rbi//lib/rbi/rewriters/filter_versions.rb#104 + sig { returns(T::Array[::Gem::Requirement]) } + def version_requirements; end +end + +# source://rbi//lib/rbi/model.rb#676 +class RBI::OptParam < ::RBI::Param + # source://rbi//lib/rbi/model.rb#691 + sig do + params( + name: ::String, + value: ::String, + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/model.rb#698 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/model.rb#680 + sig { returns(::String) } + def value; end +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://rbi//lib/rbi/model.rb#627 +class RBI::Param < ::RBI::NodeWithComments + abstract! + + # source://rbi//lib/rbi/model.rb#643 + sig { params(name: ::String, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void } + def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil)); end + + # source://rbi//lib/rbi/model.rb#634 + sig { returns(::String) } + def name; end + + # source://rbi//lib/rbi/model.rb#649 + sig { override.returns(::String) } + def to_s; end +end + +# source://rbi//lib/rbi/parser.rb#7 +class RBI::ParseError < ::RBI::Error + # source://rbi//lib/rbi/parser.rb#14 + sig { params(message: ::String, location: ::RBI::Loc).void } + def initialize(message, location); end + + # source://rbi//lib/rbi/parser.rb#11 + sig { returns(::RBI::Loc) } + def location; end +end + +# source://rbi//lib/rbi/parser.rb#53 +class RBI::Parser + # source://rbi//lib/rbi/parser.rb#88 + sig { params(path: ::String).returns(::RBI::Tree) } + def parse_file(path); end + + # source://rbi//lib/rbi/parser.rb#83 + sig { params(string: ::String).returns(::RBI::Tree) } + def parse_string(string); end + + private + + # source://rbi//lib/rbi/parser.rb#95 + sig { params(source: ::String, file: ::String).returns(::RBI::Tree) } + def parse(source, file:); end + + class << self + # source://rbi//lib/rbi/parser.rb#65 + sig { params(path: ::String).returns(::RBI::Tree) } + def parse_file(path); end + + # source://rbi//lib/rbi/parser.rb#70 + sig { params(paths: T::Array[::String]).returns(T::Array[::RBI::Tree]) } + def parse_files(paths); end + + # source://rbi//lib/rbi/parser.rb#60 + sig { params(string: ::String).returns(::RBI::Tree) } + def parse_string(string); end + + # source://rbi//lib/rbi/parser.rb#76 + sig { params(strings: T::Array[::String]).returns(T::Array[::RBI::Tree]) } + def parse_strings(strings); end + end +end + +# source://rbi//lib/rbi/parser.rb#791 +class RBI::Parser::SigBuilder < ::RBI::Parser::Visitor + # source://rbi//lib/rbi/parser.rb#798 + sig { params(content: ::String, file: ::String).void } + def initialize(content, file:); end + + # source://rbi//lib/rbi/parser.rb#795 + sig { returns(::RBI::Sig) } + def current; end + + # source://rbi//lib/rbi/parser.rb#850 + sig { override.params(node: ::Prism::AssocNode).void } + def visit_assoc_node(node); end + + # source://rbi//lib/rbi/parser.rb#805 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end +end + +# source://rbi//lib/rbi/parser.rb#153 +class RBI::Parser::TreeBuilder < ::RBI::Parser::Visitor + # source://rbi//lib/rbi/parser.rb#163 + sig { params(source: ::String, comments: T::Array[::Prism::Comment], file: ::String).void } + def initialize(source, comments:, file:); end + + # source://rbi//lib/rbi/parser.rb#160 + sig { returns(T.nilable(::Prism::Node)) } + def last_node; end + + # source://rbi//lib/rbi/parser.rb#157 + sig { returns(::RBI::Tree) } + def tree; end + + # source://rbi//lib/rbi/parser.rb#299 + sig { params(node: ::Prism::CallNode).void } + def visit_call_node(node); end + + # source://rbi//lib/rbi/parser.rb#176 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end + + # source://rbi//lib/rbi/parser.rb#208 + sig { params(node: T.any(::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode)).void } + def visit_constant_assign(node); end + + # source://rbi//lib/rbi/parser.rb#201 + sig { override.params(node: ::Prism::ConstantPathWriteNode).void } + def visit_constant_path_write_node(node); end + + # source://rbi//lib/rbi/parser.rb#194 + sig { override.params(node: ::Prism::ConstantWriteNode).void } + def visit_constant_write_node(node); end + + # source://rbi//lib/rbi/parser.rb#241 + sig { override.params(node: ::Prism::DefNode).void } + def visit_def_node(node); end + + # source://rbi//lib/rbi/parser.rb#255 + sig { override.params(node: ::Prism::ModuleNode).void } + def visit_module_node(node); end + + # source://rbi//lib/rbi/parser.rb#272 + sig { override.params(node: ::Prism::ProgramNode).void } + def visit_program_node(node); end + + # source://rbi//lib/rbi/parser.rb#283 + sig { override.params(node: ::Prism::SingletonClassNode).void } + def visit_singleton_class_node(node); end + + private + + # Collect all the remaining comments within a node + # + # source://rbi//lib/rbi/parser.rb#467 + sig { params(node: ::Prism::Node).void } + def collect_dangling_comments(node); end + + # Collect all the remaining comments after visiting the tree + # + # source://rbi//lib/rbi/parser.rb#485 + sig { void } + def collect_orphan_comments; end + + # source://rbi//lib/rbi/parser.rb#508 + sig { returns(::RBI::Tree) } + def current_scope; end + + # source://rbi//lib/rbi/parser.rb#513 + sig { returns(T::Array[::RBI::Sig]) } + def current_sigs; end + + # source://rbi//lib/rbi/parser.rb#520 + sig { returns(T::Array[::RBI::Comment]) } + def current_sigs_comments; end + + # source://rbi//lib/rbi/parser.rb#527 + sig { params(node: ::Prism::Node).returns(T::Array[::RBI::Comment]) } + def node_comments(node); end + + # source://rbi//lib/rbi/parser.rb#545 + sig { params(node: ::Prism::Comment).returns(::RBI::Comment) } + def parse_comment(node); end + + # source://rbi//lib/rbi/parser.rb#574 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Array[::RBI::Param]) } + def parse_params(node); end + + # source://rbi//lib/rbi/parser.rb#550 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Array[::RBI::Arg]) } + def parse_send_args(node); end + + # source://rbi//lib/rbi/parser.rb#648 + sig { params(node: ::Prism::CallNode).returns(::RBI::Sig) } + def parse_sig(node); end + + # source://rbi//lib/rbi/parser.rb#658 + sig do + params( + node: T.any(::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode) + ).returns(T.nilable(::RBI::Struct)) + end + def parse_struct(node); end + + # source://rbi//lib/rbi/parser.rb#708 + sig { params(send: ::Prism::CallNode).void } + def parse_tstruct_field(send); end + + # source://rbi//lib/rbi/parser.rb#745 + sig { params(name: ::String, node: ::Prism::Node).returns(::RBI::Visibility) } + def parse_visibility(name, node); end + + # source://rbi//lib/rbi/parser.rb#759 + sig { void } + def separate_header_comments; end + + # source://rbi//lib/rbi/parser.rb#769 + sig { void } + def set_root_tree_loc; end + + # source://rbi//lib/rbi/parser.rb#783 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def type_variable_definition?(node); end +end + +# source://rbi//lib/rbi/parser.rb#122 +class RBI::Parser::Visitor < ::Prism::Visitor + # source://rbi//lib/rbi/parser.rb#126 + sig { params(source: ::String, file: ::String).void } + def initialize(source, file:); end + + private + + # source://rbi//lib/rbi/parser.rb#136 + sig { params(node: ::Prism::Node).returns(::RBI::Loc) } + def node_loc(node); end + + # source://rbi//lib/rbi/parser.rb#141 + sig { params(node: T.nilable(::Prism::Node)).returns(T.nilable(::String)) } + def node_string(node); end + + # source://rbi//lib/rbi/parser.rb#148 + sig { params(node: ::Prism::Node).returns(::String) } + def node_string!(node); end +end + +# source://rbi//lib/rbi/printer.rb#7 +class RBI::Printer < ::RBI::Visitor + # source://rbi//lib/rbi/printer.rb#30 + sig do + params( + out: T.any(::IO, ::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 + + # source://rbi//lib/rbi/printer.rb#17 + sig { returns(::Integer) } + def current_indent; end + + # source://rbi//lib/rbi/printer.rb#48 + sig { void } + def dedent; end + + # @return [Boolean] + # + # source://rbi//lib/rbi/printer.rb#11 + def in_visibility_group; end + + # @return [Boolean] + # + # source://rbi//lib/rbi/printer.rb#11 + def in_visibility_group=(_arg0); end + + # Printing + # + # source://rbi//lib/rbi/printer.rb#43 + sig { void } + def indent; end + + # source://rbi//lib/rbi/printer.rb#20 + sig { returns(T.nilable(::Integer)) } + def max_line_length; end + + # source://rbi//lib/rbi/printer.rb#14 + sig { returns(T.nilable(::RBI::Node)) } + def previous_node; end + + # Print a string without indentation nor `\n` at the end. + # + # source://rbi//lib/rbi/printer.rb#54 + sig { params(string: ::String).void } + def print(string); end + + # source://rbi//lib/rbi/printer.rb#11 + sig { returns(T::Boolean) } + def print_locs; end + + # @return [Boolean] + # + # source://rbi//lib/rbi/printer.rb#11 + def print_locs=(_arg0); end + + # Print a string with indentation and `\n` at the end. + # + # source://rbi//lib/rbi/printer.rb#74 + sig { params(string: ::String).void } + def printl(string); end + + # Print a string without indentation but with a `\n` at the end. + # + # source://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. + # + # source://rbi//lib/rbi/printer.rb#67 + sig { params(string: T.nilable(::String)).void } + def printt(string = T.unsafe(nil)); end + + # source://rbi//lib/rbi/printer.rb#80 + sig { override.params(nodes: T::Array[::RBI::Node]).void } + def visit_all(nodes); end + + # source://rbi//lib/rbi/printer.rb#91 + sig { override.params(file: ::RBI::File).void } + def visit_file(file); end + + private + + # source://rbi//lib/rbi/printer.rb#619 + sig { params(node: ::RBI::Node).returns(T::Boolean) } + def oneline?(node); end + + # source://rbi//lib/rbi/printer.rb#577 + sig { params(node: ::RBI::Node).void } + def print_blank_line_before(node); end + + # source://rbi//lib/rbi/printer.rb#587 + sig { params(node: ::RBI::Node).void } + def print_loc(node); end + + # source://rbi//lib/rbi/printer.rb#593 + sig { params(node: ::RBI::Param, last: T::Boolean).void } + def print_param_comment_leading_space(node, last:); end + + # source://rbi//lib/rbi/printer.rb#666 + sig { params(node: ::RBI::Sig).void } + def print_sig_as_block(node); end + + # source://rbi//lib/rbi/printer.rb#641 + sig { params(node: ::RBI::Sig).void } + def print_sig_as_line(node); end + + # source://rbi//lib/rbi/printer.rb#611 + sig { params(node: ::RBI::SigParam, last: T::Boolean).void } + def print_sig_param_comment_leading_space(node, last:); end + + # source://rbi//lib/rbi/printer.rb#722 + sig { params(node: ::RBI::Sig).returns(T::Array[::String]) } + def sig_modifiers(node); end + + # source://rbi//lib/rbi/printer.rb#417 + sig { override.params(node: ::RBI::Arg).void } + def visit_arg(node); end + + # source://rbi//lib/rbi/printer.rb#237 + sig { params(node: ::RBI::Attr).void } + def visit_attr(node); end + + # source://rbi//lib/rbi/printer.rb#222 + sig { override.params(node: ::RBI::AttrAccessor).void } + def visit_attr_accessor(node); end + + # source://rbi//lib/rbi/printer.rb#227 + sig { override.params(node: ::RBI::AttrReader).void } + def visit_attr_reader(node); end + + # source://rbi//lib/rbi/printer.rb#232 + sig { override.params(node: ::RBI::AttrWriter).void } + def visit_attr_writer(node); end + + # source://rbi//lib/rbi/printer.rb#126 + sig { override.params(node: ::RBI::BlankLine).void } + def visit_blank_line(node); end + + # source://rbi//lib/rbi/printer.rb#344 + sig { override.params(node: ::RBI::BlockParam).void } + def visit_block_param(node); end + + # source://rbi//lib/rbi/printer.rb#143 + sig { override.params(node: ::RBI::Class).void } + def visit_class(node); end + + # source://rbi//lib/rbi/printer.rb#110 + sig { override.params(node: ::RBI::Comment).void } + def visit_comment(node); end + + # source://rbi//lib/rbi/printer.rb#554 + sig { override.params(node: ::RBI::ConflictTree).void } + def visit_conflict_tree(node); end + + # source://rbi//lib/rbi/printer.rb#213 + sig { override.params(node: ::RBI::Const).void } + def visit_const(node); end + + # source://rbi//lib/rbi/printer.rb#354 + sig { override.params(node: ::RBI::Extend).void } + def visit_extend(node); end + + # source://rbi//lib/rbi/printer.rb#526 + sig { override.params(node: ::RBI::Group).void } + def visit_group(node); end + + # source://rbi//lib/rbi/printer.rb#512 + sig { override.params(node: ::RBI::Helper).void } + def visit_helper(node); end + + # source://rbi//lib/rbi/printer.rb#349 + sig { override.params(node: ::RBI::Include).void } + def visit_include(node); end + + # source://rbi//lib/rbi/printer.rb#422 + sig { override.params(node: ::RBI::KwArg).void } + def visit_kw_arg(node); end + + # source://rbi//lib/rbi/printer.rb#334 + sig { override.params(node: ::RBI::KwOptParam).void } + def visit_kw_opt_param(node); end + + # source://rbi//lib/rbi/printer.rb#329 + sig { override.params(node: ::RBI::KwParam).void } + def visit_kw_param(node); end + + # source://rbi//lib/rbi/printer.rb#339 + sig { override.params(node: ::RBI::KwRestParam).void } + def visit_kw_rest_param(node); end + + # source://rbi//lib/rbi/printer.rb#265 + sig { override.params(node: ::RBI::Method).void } + def visit_method(node); end + + # source://rbi//lib/rbi/printer.rb#521 + sig { override.params(node: ::RBI::MixesInClassMethods).void } + def visit_mixes_in_class_methods(node); end + + # source://rbi//lib/rbi/printer.rb#359 + sig { params(node: ::RBI::Mixin).void } + def visit_mixin(node); end + + # source://rbi//lib/rbi/printer.rb#138 + sig { override.params(node: ::RBI::Module).void } + def visit_module(node); end + + # source://rbi//lib/rbi/printer.rb#319 + sig { override.params(node: ::RBI::OptParam).void } + def visit_opt_param(node); end + + # source://rbi//lib/rbi/printer.rb#386 + sig { override.params(node: ::RBI::Private).void } + def visit_private(node); end + + # source://rbi//lib/rbi/printer.rb#381 + sig { override.params(node: ::RBI::Protected).void } + def visit_protected(node); end + + # source://rbi//lib/rbi/printer.rb#376 + sig { override.params(node: ::RBI::Public).void } + def visit_public(node); end + + # source://rbi//lib/rbi/printer.rb#314 + sig { override.params(node: ::RBI::ReqParam).void } + def visit_req_param(node); end + + # source://rbi//lib/rbi/printer.rb#545 + sig { override.params(node: ::RBI::RequiresAncestor).void } + def visit_requires_ancestor(node); end + + # source://rbi//lib/rbi/printer.rb#324 + sig { override.params(node: ::RBI::RestParam).void } + def visit_rest_param(node); end + + # source://rbi//lib/rbi/printer.rb#158 + sig { params(node: ::RBI::Scope).void } + def visit_scope(node); end + + # source://rbi//lib/rbi/printer.rb#203 + sig { params(node: ::RBI::Scope).void } + def visit_scope_body(node); end + + # source://rbi//lib/rbi/printer.rb#563 + sig { override.params(node: ::RBI::ScopeConflict).void } + def visit_scope_conflict(node); end + + # source://rbi//lib/rbi/printer.rb#168 + sig { params(node: ::RBI::Scope).void } + def visit_scope_header(node); end + + # source://rbi//lib/rbi/printer.rb#400 + sig { override.params(node: ::RBI::Send).void } + def visit_send(node); end + + # source://rbi//lib/rbi/printer.rb#427 + sig { override.params(node: ::RBI::Sig).void } + def visit_sig(node); end + + # source://rbi//lib/rbi/printer.rb#446 + sig { override.params(node: ::RBI::SigParam).void } + def visit_sig_param(node); end + + # source://rbi//lib/rbi/printer.rb#153 + sig { override.params(node: ::RBI::SingletonClass).void } + def visit_singleton_class(node); end + + # source://rbi//lib/rbi/printer.rb#148 + sig { override.params(node: ::RBI::Struct).void } + def visit_struct(node); end + + # source://rbi//lib/rbi/printer.rb#466 + sig { params(node: ::RBI::TStructField).void } + def visit_t_struct_field(node); end + + # source://rbi//lib/rbi/printer.rb#484 + sig { override.params(node: ::RBI::TEnum).void } + def visit_tenum(node); end + + # source://rbi//lib/rbi/printer.rb#489 + sig { override.params(node: ::RBI::TEnumBlock).void } + def visit_tenum_block(node); end + + # source://rbi//lib/rbi/printer.rb#131 + sig { override.params(node: ::RBI::Tree).void } + def visit_tree(node); end + + # source://rbi//lib/rbi/printer.rb#451 + sig { override.params(node: ::RBI::TStruct).void } + def visit_tstruct(node); end + + # source://rbi//lib/rbi/printer.rb#456 + sig { override.params(node: ::RBI::TStructConst).void } + def visit_tstruct_const(node); end + + # source://rbi//lib/rbi/printer.rb#461 + sig { override.params(node: ::RBI::TStructProp).void } + def visit_tstruct_prop(node); end + + # source://rbi//lib/rbi/printer.rb#503 + sig { override.params(node: ::RBI::TypeMember).void } + def visit_type_member(node); end + + # source://rbi//lib/rbi/printer.rb#391 + sig { params(node: ::RBI::Visibility).void } + def visit_visibility(node); end + + # source://rbi//lib/rbi/printer.rb#532 + sig { override.params(node: ::RBI::VisibilityGroup).void } + def visit_visibility_group(node); end +end + +# source://rbi//lib/rbi/printer.rb#5 +class RBI::PrinterError < ::RBI::Error; end + +# source://rbi//lib/rbi/model.rb#984 +class RBI::Private < ::RBI::Visibility + # source://rbi//lib/rbi/model.rb#994 + sig do + params( + loc: T.nilable(::RBI::Loc), + comments: 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 + +# source://rbi//lib/rbi/model.rb#968 +class RBI::Protected < ::RBI::Visibility + # source://rbi//lib/rbi/model.rb#978 + sig do + params( + loc: T.nilable(::RBI::Loc), + comments: 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 + +# source://rbi//lib/rbi/model.rb#952 +class RBI::Public < ::RBI::Visibility + # source://rbi//lib/rbi/model.rb#962 + sig do + params( + loc: T.nilable(::RBI::Loc), + comments: 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 + +# source://rbi//lib/rbi/model.rb#5 +class RBI::ReplaceNodeError < ::RBI::Error; end + +# source://rbi//lib/rbi/model.rb#654 +class RBI::ReqParam < ::RBI::Param + # source://rbi//lib/rbi/model.rb#665 + sig do + params( + name: ::String, + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/model.rb#671 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end +end + +# source://rbi//lib/rbi/model.rb#1458 +class RBI::RequiresAncestor < ::RBI::NodeWithComments + include ::RBI::Indexable + + # source://rbi//lib/rbi/model.rb#1471 + sig { params(name: ::String, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void } + def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil)); end + + # source://rbi//lib/rbi/index.rb#163 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # source://rbi//lib/rbi/model.rb#1462 + sig { returns(::String) } + def name; end + + # source://rbi//lib/rbi/model.rb#1477 + sig { override.returns(::String) } + def to_s; end +end + +# source://rbi//lib/rbi/model.rb#703 +class RBI::RestParam < ::RBI::Param + # source://rbi//lib/rbi/model.rb#714 + sig do + params( + name: ::String, + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/model.rb#725 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/model.rb#720 + sig { override.returns(::String) } + def to_s; end +end + +# source://rbi//lib/rbi/rewriters/add_sig_templates.rb#5 +module RBI::Rewriters; end + +# source://rbi//lib/rbi/rewriters/add_sig_templates.rb#6 +class RBI::Rewriters::AddSigTemplates < ::RBI::Visitor + # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#10 + sig { params(with_todo_comment: T::Boolean).void } + def initialize(with_todo_comment: T.unsafe(nil)); end + + # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#16 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + private + + # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#30 + sig { params(attr: ::RBI::Attr).void } + def add_attr_sig(attr); end + + # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#45 + sig { params(method: ::RBI::Method).void } + def add_method_sig(method); end + + # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#56 + sig { params(node: ::RBI::NodeWithComments).void } + def add_todo_comment(node); end +end + +# source://rbi//lib/rbi/rewriters/annotate.rb#6 +class RBI::Rewriters::Annotate < ::RBI::Visitor + # source://rbi//lib/rbi/rewriters/annotate.rb#10 + 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 + + # source://rbi//lib/rbi/rewriters/annotate.rb#18 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + private + + # source://rbi//lib/rbi/rewriters/annotate.rb#31 + sig { params(node: ::RBI::NodeWithComments).void } + def annotate_node(node); end + + # source://rbi//lib/rbi/rewriters/annotate.rb#38 + sig { params(node: ::RBI::Node).returns(T::Boolean) } + def root?(node); end +end + +# source://rbi//lib/rbi/rewriters/attr_to_methods.rb#22 +class RBI::Rewriters::AttrToMethods < ::RBI::Visitor + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#26 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + private + + # @raise [ReplaceNodeError] + # + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#39 + sig { params(node: ::RBI::Node, with: T::Array[::RBI::Node]).void } + def replace(node, with:); end +end + +# source://rbi//lib/rbi/rewriters/deannotate.rb#6 +class RBI::Rewriters::Deannotate < ::RBI::Visitor + # source://rbi//lib/rbi/rewriters/deannotate.rb#10 + sig { params(annotation: ::String).void } + def initialize(annotation); end + + # source://rbi//lib/rbi/rewriters/deannotate.rb#16 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + private + + # source://rbi//lib/rbi/rewriters/deannotate.rb#27 + 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 +# +# source://rbi//lib/rbi/rewriters/filter_versions.rb#57 +class RBI::Rewriters::FilterVersions < ::RBI::Visitor + # source://rbi//lib/rbi/rewriters/filter_versions.rb#73 + sig { params(version: ::Gem::Version).void } + def initialize(version); end + + # source://rbi//lib/rbi/rewriters/filter_versions.rb#79 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + class << self + # source://rbi//lib/rbi/rewriters/filter_versions.rb#66 + sig { params(tree: ::RBI::Tree, version: ::Gem::Version).void } + def filter(tree, version); end + end +end + +# source://rbi//lib/rbi/rewriters/filter_versions.rb#60 +RBI::Rewriters::FilterVersions::VERSION_PREFIX = T.let(T.unsafe(nil), String) + +# source://rbi//lib/rbi/rewriters/group_nodes.rb#8 +class RBI::Rewriters::GroupNodes < ::RBI::Visitor + # source://rbi//lib/rbi/rewriters/group_nodes.rb#12 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + private + + # source://rbi//lib/rbi/rewriters/group_nodes.rb#36 + 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 +# ~~~ +# +# source://rbi//lib/rbi/rewriters/merge_trees.rb#39 +class RBI::Rewriters::Merge + # source://rbi//lib/rbi/rewriters/merge_trees.rb#70 + 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#79 + sig { params(tree: ::RBI::Tree).void } + def merge(tree); end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#67 + sig { returns(::RBI::MergeTree) } + def tree; end + + class << self + # source://rbi//lib/rbi/rewriters/merge_trees.rb#54 + 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 +# +# source://rbi//lib/rbi/rewriters/merge_trees.rb#86 +class RBI::Rewriters::Merge::Conflict < ::T::Struct + const :left, ::RBI::Node + const :right, ::RBI::Node + const :left_name, ::String + const :right_name, ::String + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#95 + sig { returns(::String) } + def to_s; end + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + 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 +# ~~~ +# +# source://rbi//lib/rbi/rewriters/merge_trees.rb#245 +class RBI::Rewriters::Merge::ConflictTreeMerger < ::RBI::Visitor + # source://rbi//lib/rbi/rewriters/merge_trees.rb#247 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#252 + sig { override.params(nodes: T::Array[::RBI::Node]).void } + def visit_all(nodes); end + + private + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#273 + sig { params(left: ::RBI::Tree, right: ::RBI::Tree).void } + def merge_conflict_trees(left, right); end +end + +# source://rbi//lib/rbi/rewriters/merge_trees.rb#42 +class RBI::Rewriters::Merge::Keep < ::T::Enum + enums do + NONE = new + LEFT = new + RIGHT = new + end +end + +# source://rbi//lib/rbi/rewriters/merge_trees.rb#100 +class RBI::Rewriters::Merge::TreeMerger < ::RBI::Visitor + # source://rbi//lib/rbi/rewriters/merge_trees.rb#107 + 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#104 + sig { returns(T::Array[::RBI::Rewriters::Merge::Conflict]) } + def conflicts; end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#119 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + private + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#168 + sig { returns(::RBI::Tree) } + def current_scope; end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#185 + sig { params(left: ::RBI::Scope, right: ::RBI::Scope).void } + def make_conflict_scope(left, right); end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#192 + sig { params(left: ::RBI::Node, right: ::RBI::Node).void } + def make_conflict_tree(left, right); end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#173 + sig { params(node: ::RBI::Node).returns(T.nilable(::RBI::Node)) } + def previous_definition(node); end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#204 + sig { params(left: ::RBI::Scope, right: ::RBI::Scope).returns(::RBI::Scope) } + def replace_scope_header(left, right); end +end + +# source://rbi//lib/rbi/rewriters/nest_non_public_methods.rb#6 +class RBI::Rewriters::NestNonPublicMethods < ::RBI::Visitor + # source://rbi//lib/rbi/rewriters/nest_non_public_methods.rb#10 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end +end + +# source://rbi//lib/rbi/rewriters/nest_singleton_methods.rb#6 +class RBI::Rewriters::NestSingletonMethods < ::RBI::Visitor + # source://rbi//lib/rbi/rewriters/nest_singleton_methods.rb#10 + 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 +# ~~~ +# +# source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#48 +class RBI::Rewriters::RemoveKnownDefinitions < ::RBI::Visitor + # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#55 + sig { params(index: ::RBI::Index).void } + def initialize(index); end + + # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#52 + sig { returns(T::Array[::RBI::Rewriters::RemoveKnownDefinitions::Operation]) } + def operations; end + + # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#83 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#78 + sig { params(nodes: T::Array[::RBI::Node]).void } + def visit_all(nodes); end + + private + + # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#111 + sig { params(node: ::RBI::Node, previous: ::RBI::Node).returns(T::Boolean) } + def can_delete_node?(node, previous); end + + # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#129 + sig { params(node: ::RBI::Node, previous: ::RBI::Node).void } + def delete_node(node, previous); end + + # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#102 + sig { params(node: ::RBI::Indexable).returns(T.nilable(::RBI::Node)) } + def previous_definition_for(node); end + + class << self + # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#70 + 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 + +# source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#134 +class RBI::Rewriters::RemoveKnownDefinitions::Operation < ::T::Struct + const :deleted_node, ::RBI::Node + const :duplicate_of, ::RBI::Node + + # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#141 + sig { returns(::String) } + def to_s; end + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://rbi//lib/rbi/rewriters/sort_nodes.rb#6 +class RBI::Rewriters::SortNodes < ::RBI::Visitor + # source://rbi//lib/rbi/rewriters/sort_nodes.rb#10 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + private + + # source://rbi//lib/rbi/rewriters/sort_nodes.rb#73 + sig { params(kind: ::RBI::Group::Kind).returns(::Integer) } + def group_rank(kind); end + + # source://rbi//lib/rbi/rewriters/sort_nodes.rb#94 + sig { params(node: ::RBI::Node).returns(T.nilable(::String)) } + def node_name(node); end + + # source://rbi//lib/rbi/rewriters/sort_nodes.rb#45 + sig { params(node: ::RBI::Node).returns(::Integer) } + def node_rank(node); end + + # source://rbi//lib/rbi/rewriters/sort_nodes.rb#106 + sig { params(node: ::RBI::Node).void } + def sort_node_names!(node); end +end + +# Scopes +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://rbi//lib/rbi/model.rb#178 +class RBI::Scope < ::RBI::Tree + include ::RBI::Indexable + + abstract! + + # Duplicate `self` scope without its body + # + # source://rbi//lib/rbi/rewriters/merge_trees.rb#358 + sig { returns(T.self_type) } + def dup_empty; end + + # @abstract + # + # source://rbi//lib/rbi/model.rb#184 + sig { abstract.returns(::String) } + def fully_qualified_name; end + + # source://rbi//lib/rbi/index.rb#93 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # source://rbi//lib/rbi/model.rb#187 + 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 +# ~~~ +# +# source://rbi//lib/rbi/rewriters/merge_trees.rb#624 +class RBI::ScopeConflict < ::RBI::Tree + # source://rbi//lib/rbi/rewriters/merge_trees.rb#641 + 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#628 + sig { returns(::RBI::Scope) } + def left; end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#631 + sig { returns(::String) } + def left_name; end + + # @return [Scope] + # + # source://rbi//lib/rbi/rewriters/merge_trees.rb#628 + def right; end + + # @return [String] + # + # source://rbi//lib/rbi/rewriters/merge_trees.rb#631 + def right_name; end +end + +# Sends +# +# source://rbi//lib/rbi/model.rb#1002 +class RBI::Send < ::RBI::NodeWithComments + include ::RBI::Indexable + + # source://rbi//lib/rbi/model.rb#1020 + sig do + params( + method: ::String, + args: T::Array[::RBI::Arg], + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/model.rb#1028 + sig { params(arg: ::RBI::Arg).void } + def <<(arg); end + + # source://rbi//lib/rbi/model.rb#1033 + sig { params(other: T.nilable(::Object)).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/model.rb#1009 + sig { returns(T::Array[::RBI::Arg]) } + def args; end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#531 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # source://rbi//lib/rbi/index.rb#193 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # source://rbi//lib/rbi/model.rb#1006 + sig { returns(::String) } + def method; end + + # source://rbi//lib/rbi/model.rb#1038 + sig { returns(::String) } + def to_s; end +end + +# Sorbet's sigs +# +# source://rbi//lib/rbi/model.rb#1102 +class RBI::Sig < ::RBI::Node + # source://rbi//lib/rbi/model.rb#1134 + sig do + params( + params: T::Array[::RBI::SigParam], + return_type: T.nilable(::String), + is_abstract: T::Boolean, + is_override: T::Boolean, + is_overridable: T::Boolean, + is_final: T::Boolean, + type_params: T::Array[::String], + checked: T.nilable(::Symbol), + loc: T.nilable(::RBI::Loc), + 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), type_params: T.unsafe(nil), checked: T.unsafe(nil), loc: T.unsafe(nil), &block); end + + # source://rbi//lib/rbi/model.rb#1159 + sig { params(param: ::RBI::SigParam).void } + def <<(param); end + + # source://rbi//lib/rbi/model.rb#1169 + sig { params(other: ::Object).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/model.rb#1164 + sig { params(name: ::String, type: ::String).void } + def add_param(name, type); end + + # source://rbi//lib/rbi/model.rb#1118 + sig { returns(T.nilable(::Symbol)) } + def checked; end + + # @return [Symbol, nil] + # + # source://rbi//lib/rbi/model.rb#1118 + def checked=(_arg0); end + + # source://rbi//lib/rbi/model.rb#1112 + sig { returns(T::Boolean) } + def is_abstract; end + + # @return [Boolean] + # + # source://rbi//lib/rbi/model.rb#1112 + def is_abstract=(_arg0); end + + # @return [Boolean] + # + # source://rbi//lib/rbi/model.rb#1112 + def is_final; end + + # @return [Boolean] + # + # source://rbi//lib/rbi/model.rb#1112 + def is_final=(_arg0); end + + # @return [Boolean] + # + # source://rbi//lib/rbi/model.rb#1112 + def is_overridable; end + + # @return [Boolean] + # + # source://rbi//lib/rbi/model.rb#1112 + def is_overridable=(_arg0); end + + # @return [Boolean] + # + # source://rbi//lib/rbi/model.rb#1112 + def is_override; end + + # @return [Boolean] + # + # source://rbi//lib/rbi/model.rb#1112 + def is_override=(_arg0); end + + # source://rbi//lib/rbi/model.rb#1106 + sig { returns(T::Array[::RBI::SigParam]) } + def params; end + + # source://rbi//lib/rbi/model.rb#1109 + sig { returns(T.nilable(::String)) } + def return_type; end + + # @return [String, nil] + # + # source://rbi//lib/rbi/model.rb#1109 + def return_type=(_arg0); end + + # source://rbi//lib/rbi/model.rb#1115 + sig { returns(T::Array[::String]) } + def type_params; end +end + +# source://rbi//lib/rbi/model.rb#1178 +class RBI::SigParam < ::RBI::NodeWithComments + # source://rbi//lib/rbi/model.rb#1193 + sig do + params( + name: ::String, + type: ::String, + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/model.rb#1201 + sig { params(other: ::Object).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/model.rb#1182 + sig { returns(::String) } + def name; end + + # @return [String] + # + # source://rbi//lib/rbi/model.rb#1182 + def type; end +end + +# source://rbi//lib/rbi/model.rb#253 +class RBI::SingletonClass < ::RBI::Scope + # source://rbi//lib/rbi/model.rb#263 + sig do + params( + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/model.rb#269 + sig { override.returns(::String) } + def fully_qualified_name; end +end + +# source://rbi//lib/rbi/model.rb#274 +class RBI::Struct < ::RBI::Scope + # source://rbi//lib/rbi/model.rb#296 + sig do + params( + name: ::String, + members: T::Array[::Symbol], + keyword_init: T::Boolean, + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#396 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # source://rbi//lib/rbi/model.rb#305 + sig { override.returns(::String) } + def fully_qualified_name; end + + # source://rbi//lib/rbi/model.rb#284 + sig { returns(T::Boolean) } + def keyword_init; end + + # @return [Boolean] + # + # source://rbi//lib/rbi/model.rb#284 + def keyword_init=(_arg0); end + + # source://rbi//lib/rbi/model.rb#281 + sig { returns(T::Array[::Symbol]) } + def members; end + + # @return [Array] + # + # source://rbi//lib/rbi/model.rb#281 + def members=(_arg0); end + + # source://rbi//lib/rbi/model.rb#278 + sig { returns(::String) } + def name; end + + # @return [String] + # + # source://rbi//lib/rbi/model.rb#278 + def name=(_arg0); end +end + +# Sorbet's T::Enum +# +# source://rbi//lib/rbi/model.rb#1319 +class RBI::TEnum < ::RBI::Class + # source://rbi//lib/rbi/model.rb#1330 + sig do + params( + name: ::String, + loc: T.nilable(::RBI::Loc), + comments: 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 + +# source://rbi//lib/rbi/model.rb#1336 +class RBI::TEnumBlock < ::RBI::NodeWithComments + include ::RBI::Indexable + + # source://rbi//lib/rbi/model.rb#1350 + sig do + params( + names: T::Array[::String], + loc: T.nilable(::RBI::Loc), + comments: T::Array[::RBI::Comment], + block: T.nilable(T.proc.params(node: ::RBI::TEnumBlock).void) + ).void + end + def initialize(names = T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end + + # source://rbi//lib/rbi/model.rb#1362 + sig { params(name: ::String).void } + def <<(name); end + + # source://rbi//lib/rbi/model.rb#1357 + sig { returns(T::Boolean) } + def empty?; end + + # source://rbi//lib/rbi/index.rb#223 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#558 + sig { override.params(other: ::RBI::Node).void } + def merge_with(other); end + + # source://rbi//lib/rbi/model.rb#1340 + sig { returns(T::Array[::String]) } + def names; end + + # source://rbi//lib/rbi/model.rb#1367 + sig { override.returns(::String) } + def to_s; end +end + +# Sorbet's T::Struct +# +# source://rbi//lib/rbi/model.rb#1208 +class RBI::TStruct < ::RBI::Class + # source://rbi//lib/rbi/model.rb#1219 + sig do + params( + name: ::String, + loc: T.nilable(::RBI::Loc), + comments: 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 + +# source://rbi//lib/rbi/model.rb#1257 +class RBI::TStructConst < ::RBI::TStructField + include ::RBI::Indexable + + # source://rbi//lib/rbi/model.rb#1270 + sig do + params( + name: ::String, + type: ::String, + default: T.nilable(::String), + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#549 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # source://rbi//lib/rbi/model.rb#1276 + sig { override.returns(T::Array[::String]) } + def fully_qualified_names; end + + # source://rbi//lib/rbi/index.rb#203 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # source://rbi//lib/rbi/model.rb#1282 + sig { override.returns(::String) } + def to_s; end +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://rbi//lib/rbi/model.rb#1225 +class RBI::TStructField < ::RBI::NodeWithComments + abstract! + + # source://rbi//lib/rbi/model.rb#1246 + sig do + params( + name: ::String, + type: ::String, + default: T.nilable(::String), + loc: T.nilable(::RBI::Loc), + comments: T::Array[::RBI::Comment] + ).void + end + def initialize(name, type, default: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil)); end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#540 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # source://rbi//lib/rbi/model.rb#1235 + sig { returns(T.nilable(::String)) } + def default; end + + # @return [String, nil] + # + # source://rbi//lib/rbi/model.rb#1235 + def default=(_arg0); end + + # @abstract + # + # source://rbi//lib/rbi/model.rb#1254 + sig { abstract.returns(T::Array[::String]) } + def fully_qualified_names; end + + # source://rbi//lib/rbi/model.rb#1232 + sig { returns(::String) } + def name; end + + # @return [String] + # + # source://rbi//lib/rbi/model.rb#1232 + def name=(_arg0); end + + # @return [String] + # + # source://rbi//lib/rbi/model.rb#1232 + def type; end + + # @return [String] + # + # source://rbi//lib/rbi/model.rb#1232 + def type=(_arg0); end +end + +# source://rbi//lib/rbi/model.rb#1287 +class RBI::TStructProp < ::RBI::TStructField + include ::RBI::Indexable + + # source://rbi//lib/rbi/model.rb#1300 + sig do + params( + name: ::String, + type: ::String, + default: T.nilable(::String), + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#572 + sig { override.params(other: ::RBI::Node).returns(T::Boolean) } + def compatible_with?(other); end + + # source://rbi//lib/rbi/model.rb#1306 + sig { override.returns(T::Array[::String]) } + def fully_qualified_names; end + + # source://rbi//lib/rbi/index.rb#213 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # source://rbi//lib/rbi/model.rb#1312 + sig { override.returns(::String) } + def to_s; end +end + +# source://rbi//lib/rbi/model.rb#108 +class RBI::Tree < ::RBI::NodeWithComments + # source://rbi//lib/rbi/model.rb#121 + sig do + params( + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/model.rb#128 + sig { params(node: ::RBI::Node).void } + def <<(node); end + + # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#66 + sig { params(with_todo_comment: T::Boolean).void } + def add_sig_templates!(with_todo_comment: T.unsafe(nil)); end + + # source://rbi//lib/rbi/rewriters/annotate.rb#49 + 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 + + # source://tapioca/0.15.1/lib/tapioca/rbi_ext/model.rb#38 + sig do + params( + name: ::String, + superclass_name: T.nilable(::String), + block: T.nilable(T.proc.params(scope: ::RBI::Scope).void) + ).returns(::RBI::Scope) + end + def create_class(name, superclass_name: T.unsafe(nil), &block); end + + # source://tapioca/0.15.1/lib/tapioca/rbi_ext/model.rb#45 + sig { params(name: ::String, value: ::String).void } + def create_constant(name, value:); end + + # source://tapioca/0.15.1/lib/tapioca/rbi_ext/model.rb#55 + sig { params(name: ::String).void } + def create_extend(name); end + + # source://tapioca/0.15.1/lib/tapioca/rbi_ext/model.rb#50 + sig { params(name: ::String).void } + def create_include(name); end + + # source://tapioca/0.15.1/lib/tapioca/rbi_ext/model.rb#89 + sig do + params( + name: ::String, + parameters: T::Array[::RBI::TypedParam], + return_type: ::String, + class_method: T::Boolean, + visibility: ::RBI::Visibility, + comments: T::Array[::RBI::Comment] + ).void + end + def create_method(name, parameters: T.unsafe(nil), return_type: T.unsafe(nil), class_method: T.unsafe(nil), visibility: T.unsafe(nil), comments: T.unsafe(nil)); end + + # source://tapioca/0.15.1/lib/tapioca/rbi_ext/model.rb#113 + sig do + params( + name: ::String, + sigs: T::Array[::RBI::Sig], + parameters: T::Array[::RBI::Param], + class_method: T::Boolean, + visibility: ::RBI::Visibility, + comments: T::Array[::RBI::Comment] + ).void + end + def create_method_with_sigs(name, sigs:, parameters: T.unsafe(nil), class_method: T.unsafe(nil), visibility: T.unsafe(nil), comments: T.unsafe(nil)); end + + # source://tapioca/0.15.1/lib/tapioca/rbi_ext/model.rb#60 + sig { params(name: ::String).void } + def create_mixes_in_class_methods(name); end + + # source://tapioca/0.15.1/lib/tapioca/rbi_ext/model.rb#25 + sig { params(name: ::String, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) } + def create_module(name, &block); end + + # source://tapioca/0.15.1/lib/tapioca/rbi_ext/model.rb#9 + sig { params(constant: ::Module, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) } + def create_path(constant, &block); end + + # source://tapioca/0.15.1/lib/tapioca/rbi_ext/model.rb#135 + sig do + params( + parameters: T::Hash[T.any(::String, ::Symbol), ::String], + type_parameters: T::Array[::String], + return_type: ::String + ).returns(::RBI::Sig) + end + def create_sig(parameters:, type_parameters: T.unsafe(nil), return_type: T.unsafe(nil)); end + + # source://tapioca/0.15.1/lib/tapioca/rbi_ext/model.rb#74 + sig do + params( + name: ::String, + type: ::String, + variance: ::Symbol, + fixed: T.nilable(::String), + upper: T.nilable(::String), + lower: T.nilable(::String) + ).void + end + def create_type_variable(name, type:, variance: T.unsafe(nil), fixed: T.unsafe(nil), upper: T.unsafe(nil), lower: T.unsafe(nil)); end + + # source://rbi//lib/rbi/rewriters/deannotate.rb#41 + sig { params(annotation: ::String).void } + def deannotate!(annotation); end + + # source://rbi//lib/rbi/model.rb#134 + sig { returns(T::Boolean) } + def empty?; end + + # source://rbi//lib/rbi/rewriters/filter_versions.rb#118 + sig { params(version: ::Gem::Version).void } + def filter_versions!(version); end + + # source://rbi//lib/rbi/rewriters/group_nodes.rb#81 + sig { void } + def group_nodes!; end + + # source://rbi//lib/rbi/index.rb#68 + sig { returns(::RBI::Index) } + def index; end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#324 + 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 + + # source://rbi//lib/rbi/rewriters/nest_non_public_methods.rb#46 + sig { void } + def nest_non_public_methods!; end + + # source://rbi//lib/rbi/rewriters/nest_singleton_methods.rb#36 + sig { void } + def nest_singleton_methods!; end + + # source://rbi//lib/rbi/model.rb#112 + sig { returns(T::Array[::RBI::Node]) } + def nodes; end + + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#53 + sig { void } + def replace_attributes_with_methods!; end + + # source://rbi//lib/rbi/rewriters/sort_nodes.rb#119 + sig { void } + def sort_nodes!; end + + private + + # source://tapioca/0.15.1/lib/tapioca/rbi_ext/model.rb#150 + sig { params(node: ::RBI::Node).returns(::RBI::Node) } + def create_node(node); end + + # source://tapioca/0.15.1/lib/tapioca/rbi_ext/model.rb#145 + sig { returns(T::Hash[::String, ::RBI::Node]) } + def nodes_cache; end +end + +# source://rbi//lib/rbi/model.rb#1400 +class RBI::TypeMember < ::RBI::NodeWithComments + include ::RBI::Indexable + + # source://rbi//lib/rbi/model.rb#1415 + sig do + params( + name: ::String, + value: ::String, + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi//lib/rbi/model.rb#1423 + sig { returns(::String) } + def fully_qualified_name; end + + # source://rbi//lib/rbi/index.rb#183 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # source://rbi//lib/rbi/model.rb#1404 + sig { returns(::String) } + def name; end + + # source://rbi//lib/rbi/model.rb#1430 + sig { override.returns(::String) } + def to_s; end + + # @return [String] + # + # source://rbi//lib/rbi/model.rb#1404 + def value; end +end + +# source://rbi//lib/rbi/rewriters/attr_to_methods.rb#5 +class RBI::UnexpectedMultipleSigsError < ::RBI::Error + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#10 + sig { params(node: ::RBI::Node).void } + def initialize(node); end + + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#7 + sig { returns(::RBI::Node) } + def node; end +end + +# source://rbi//lib/rbi/parser.rb#20 +class RBI::UnexpectedParserError < ::RBI::Error + # source://rbi//lib/rbi/parser.rb#27 + sig { params(parent_exception: ::Exception, last_location: ::RBI::Loc).void } + def initialize(parent_exception, last_location); end + + # source://rbi//lib/rbi/parser.rb#24 + sig { returns(::RBI::Loc) } + def last_location; end + + # source://rbi//lib/rbi/parser.rb#34 + sig { params(io: T.any(::IO, ::StringIO)).void } + def print_debug(io: T.unsafe(nil)); end +end + +# source://rbi//lib/rbi/version.rb#5 +RBI::VERSION = T.let(T.unsafe(nil), String) + +# Visibility +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://rbi//lib/rbi/model.rb#916 +class RBI::Visibility < ::RBI::NodeWithComments + abstract! + + # source://rbi//lib/rbi/model.rb#926 + sig { params(visibility: ::Symbol, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void } + def initialize(visibility, loc: T.unsafe(nil), comments: T.unsafe(nil)); end + + # source://rbi//lib/rbi/model.rb#932 + sig { params(other: ::RBI::Visibility).returns(T::Boolean) } + def ==(other); end + + # source://rbi//lib/rbi/model.rb#947 + sig { returns(T::Boolean) } + def private?; end + + # source://rbi//lib/rbi/model.rb#942 + sig { returns(T::Boolean) } + def protected?; end + + # source://rbi//lib/rbi/model.rb#937 + sig { returns(T::Boolean) } + def public?; end + + # source://rbi//lib/rbi/model.rb#923 + sig { returns(::Symbol) } + def visibility; end +end + +# source://rbi//lib/rbi/rewriters/nest_non_public_methods.rb#52 +class RBI::VisibilityGroup < ::RBI::Tree + # source://rbi//lib/rbi/rewriters/nest_non_public_methods.rb#59 + sig { params(visibility: ::RBI::Visibility).void } + def initialize(visibility); end + + # source://rbi//lib/rbi/rewriters/nest_non_public_methods.rb#56 + sig { returns(::RBI::Visibility) } + def visibility; end +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://rbi//lib/rbi/visitor.rb#7 +class RBI::Visitor + abstract! + + # source://rbi//lib/rbi/visitor.rb#14 + sig { params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + # source://rbi//lib/rbi/visitor.rb#108 + sig { params(nodes: T::Array[::RBI::Node]).void } + def visit_all(nodes); end + + # source://rbi//lib/rbi/visitor.rb#113 + sig { params(file: ::RBI::File).void } + def visit_file(file); end + + private + + # source://rbi//lib/rbi/visitor.rb#195 + sig { params(node: ::RBI::Arg).void } + def visit_arg(node); end + + # source://rbi//lib/rbi/visitor.rb#144 + sig { params(node: ::RBI::AttrAccessor).void } + def visit_attr_accessor(node); end + + # source://rbi//lib/rbi/visitor.rb#147 + sig { params(node: ::RBI::AttrReader).void } + def visit_attr_reader(node); end + + # source://rbi//lib/rbi/visitor.rb#150 + sig { params(node: ::RBI::AttrWriter).void } + def visit_attr_writer(node); end + + # source://rbi//lib/rbi/visitor.rb#123 + sig { params(node: ::RBI::BlankLine).void } + def visit_blank_line(node); end + + # source://rbi//lib/rbi/visitor.rb#174 + sig { params(node: ::RBI::BlockParam).void } + def visit_block_param(node); end + + # source://rbi//lib/rbi/visitor.rb#129 + sig { params(node: ::RBI::Class).void } + def visit_class(node); end + + # source://rbi//lib/rbi/visitor.rb#120 + sig { params(node: ::RBI::Comment).void } + def visit_comment(node); end + + # source://rbi//lib/rbi/visitor.rb#240 + sig { params(node: ::RBI::ConflictTree).void } + def visit_conflict_tree(node); end + + # source://rbi//lib/rbi/visitor.rb#141 + sig { params(node: ::RBI::Const).void } + def visit_const(node); end + + # source://rbi//lib/rbi/visitor.rb#180 + sig { params(node: ::RBI::Extend).void } + def visit_extend(node); end + + # source://rbi//lib/rbi/visitor.rb#234 + sig { params(node: ::RBI::Group).void } + def visit_group(node); end + + # source://rbi//lib/rbi/visitor.rb#222 + sig { params(node: ::RBI::Helper).void } + def visit_helper(node); end + + # source://rbi//lib/rbi/visitor.rb#177 + sig { params(node: ::RBI::Include).void } + def visit_include(node); end + + # source://rbi//lib/rbi/visitor.rb#198 + sig { params(node: ::RBI::KwArg).void } + def visit_kw_arg(node); end + + # source://rbi//lib/rbi/visitor.rb#168 + sig { params(node: ::RBI::KwOptParam).void } + def visit_kw_opt_param(node); end + + # source://rbi//lib/rbi/visitor.rb#165 + sig { params(node: ::RBI::KwParam).void } + def visit_kw_param(node); end + + # source://rbi//lib/rbi/visitor.rb#171 + sig { params(node: ::RBI::KwRestParam).void } + def visit_kw_rest_param(node); end + + # source://rbi//lib/rbi/visitor.rb#153 + sig { params(node: ::RBI::Method).void } + def visit_method(node); end + + # source://rbi//lib/rbi/visitor.rb#228 + sig { params(node: ::RBI::MixesInClassMethods).void } + def visit_mixes_in_class_methods(node); end + + # source://rbi//lib/rbi/visitor.rb#126 + sig { params(node: ::RBI::Module).void } + def visit_module(node); end + + # source://rbi//lib/rbi/visitor.rb#159 + sig { params(node: ::RBI::OptParam).void } + def visit_opt_param(node); end + + # source://rbi//lib/rbi/visitor.rb#189 + sig { params(node: ::RBI::Private).void } + def visit_private(node); end + + # source://rbi//lib/rbi/visitor.rb#186 + sig { params(node: ::RBI::Protected).void } + def visit_protected(node); end + + # source://rbi//lib/rbi/visitor.rb#183 + sig { params(node: ::RBI::Public).void } + def visit_public(node); end + + # source://rbi//lib/rbi/visitor.rb#156 + sig { params(node: ::RBI::ReqParam).void } + def visit_req_param(node); end + + # source://rbi//lib/rbi/visitor.rb#231 + sig { params(node: ::RBI::RequiresAncestor).void } + def visit_requires_ancestor(node); end + + # source://rbi//lib/rbi/visitor.rb#162 + sig { params(node: ::RBI::RestParam).void } + def visit_rest_param(node); end + + # source://rbi//lib/rbi/visitor.rb#243 + sig { params(node: ::RBI::ScopeConflict).void } + def visit_scope_conflict(node); end + + # source://rbi//lib/rbi/visitor.rb#192 + sig { params(node: ::RBI::Send).void } + def visit_send(node); end + + # source://rbi//lib/rbi/visitor.rb#201 + sig { params(node: ::RBI::Sig).void } + def visit_sig(node); end + + # source://rbi//lib/rbi/visitor.rb#204 + sig { params(node: ::RBI::SigParam).void } + def visit_sig_param(node); end + + # source://rbi//lib/rbi/visitor.rb#132 + sig { params(node: ::RBI::SingletonClass).void } + def visit_singleton_class(node); end + + # source://rbi//lib/rbi/visitor.rb#135 + sig { params(node: ::RBI::Struct).void } + def visit_struct(node); end + + # source://rbi//lib/rbi/visitor.rb#216 + sig { params(node: ::RBI::TEnum).void } + def visit_tenum(node); end + + # source://rbi//lib/rbi/visitor.rb#219 + sig { params(node: ::RBI::TEnumBlock).void } + def visit_tenum_block(node); end + + # source://rbi//lib/rbi/visitor.rb#138 + sig { params(node: ::RBI::Tree).void } + def visit_tree(node); end + + # source://rbi//lib/rbi/visitor.rb#207 + sig { params(node: ::RBI::TStruct).void } + def visit_tstruct(node); end + + # source://rbi//lib/rbi/visitor.rb#210 + sig { params(node: ::RBI::TStructConst).void } + def visit_tstruct_const(node); end + + # source://rbi//lib/rbi/visitor.rb#213 + sig { params(node: ::RBI::TStructProp).void } + def visit_tstruct_prop(node); end + + # source://rbi//lib/rbi/visitor.rb#225 + sig { params(node: ::RBI::TypeMember).void } + def visit_type_member(node); end + + # source://rbi//lib/rbi/visitor.rb#237 + sig { params(node: ::RBI::VisibilityGroup).void } + def visit_visibility_group(node); end +end + +# source://rbi//lib/rbi/visitor.rb#5 +class RBI::VisitorError < ::RBI::Error; end diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/resource_registry@0.0.0-2b73ddd272417ca8026e5f13e1103b4c72897824.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/resource_registry@0.0.0-2b73ddd272417ca8026e5f13e1103b4c72897824.rbi new file mode 100644 index 0000000..64e218b --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/resource_registry@0.0.0-2b73ddd272417ca8026e5f13e1103b4c72897824.rbi @@ -0,0 +1,1895 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `resource_registry` gem. +# Please instead update this file by running `bin/tapioca gem resource_registry`. + + +# typed: true + +# Picked from active_support: +# +# source://resource_registry//lib/public/registry.rb#8 +module Enumerable + # source://resource_registry//lib/public/registry.rb#9 + def index_by; end + + def to_set(klass = T.unsafe(nil), *args, &block); end +end + +# Represents an instance of an object that may or may not be present. This can be useful in certain +# cases where `nil` represents a valid value instead of an absent value, i.e. update DTOs. +# +# An useful way to think about `Maybe` is as a collection, like `Array` or `Set` but that can only +# hold a maximum of 1 elements at a time. +# +# @abstract Subclasses must implement the `abstract` methods below. +# +# source://resource_registry//lib/schema_registry/maybe/absent.rb#4 +module Maybe + extend T::Generic + include ::Kernel + extend ::RuntimeGeneric + + interface! + + Value = type_member(:out) { { upper: BasicObject } } + + # @abstract + # + # source://resource_registry//lib/schema_registry/maybe.rb#107 + sig { abstract.returns(T::Boolean) } + def absent?; end + + # @abstract + # + # source://resource_registry//lib/schema_registry/maybe.rb#113 + sig { abstract.returns(T::Boolean) } + def empty?; end + + # @abstract + # + # source://resource_registry//lib/schema_registry/maybe.rb#155 + sig { abstract.params(_block: T.proc.params(value: Value).returns(T::Boolean)).returns(Maybe[Value]) } + def filter(&_block); end + + # @abstract + # + # source://resource_registry//lib/schema_registry/maybe.rb#170 + sig do + abstract + .type_parameters(:Default) + .params( + _block: T.proc.params(value: Value).returns(T.all(::BasicObject, T.type_parameter(:Default))) + ).returns(Maybe[T.all(::BasicObject, T.type_parameter(:Default))]) + end + def map(&_block); end + + # @abstract + # + # source://resource_registry//lib/schema_registry/maybe.rb#122 + sig do + abstract + .type_parameters(:Default) + .params( + default: T.type_parameter(:Default) + ).returns(T.any(T.type_parameter(:Default), Value)) + end + def or_default(default); end + + # @abstract + # + # source://resource_registry//lib/schema_registry/maybe.rb#103 + sig { abstract.returns(T::Boolean) } + def present?; end + + # @abstract + # + # source://resource_registry//lib/schema_registry/maybe.rb#143 + sig do + abstract + .type_parameters(:Return) + .params( + _block: T.proc.returns(T.type_parameter(:Return)) + ).returns(T.nilable(T.type_parameter(:Return))) + end + def when_absent(&_block); end + + # @abstract + # + # source://resource_registry//lib/schema_registry/maybe.rb#133 + sig do + abstract + .type_parameters(:Return) + .params( + _block: T.proc.params(v: Value).returns(T.type_parameter(:Return)) + ).returns(T.nilable(T.type_parameter(:Return))) + end + def when_present(&_block); end + + class << self + # source://resource_registry//lib/schema_registry/maybe.rb#76 + sig { returns(Maybe::Absent) } + def absent; end + + # source://resource_registry//lib/schema_registry/maybe.rb#62 + sig { returns(Maybe::Absent) } + def empty; end + + # source://resource_registry//lib/schema_registry/maybe.rb#97 + sig do + type_parameters(:Value) + .params( + value: T.all(::BasicObject, T.type_parameter(:Value)) + ).returns(Maybe[T.all(::BasicObject, T.type_parameter(:Value))]) + end + def from(value); end + + sig do + type_parameters(:Value) + .params( + value: T.all(BasicObject, T.type_parameter(:Value)) + ).returns(Maybe[T.all(BasicObject, T.type_parameter(:Value))]) + end + def new( + value # Creates an instance containing the specified value. + # Necessary to make this work with sorbet-coerce +); end + + # source://resource_registry//lib/schema_registry/maybe.rb#69 + sig { returns(Maybe::Absent) } + def none; end + + # source://resource_registry//lib/schema_registry/maybe.rb#42 + sig do + type_parameters(:Key) + .params( + input: T::Hash[T.type_parameter(:Key), T.untyped] + ).returns(T::Hash[T.type_parameter(:Key), T.untyped]) + end + def strip(input); end + end +end + +# Class used to represent the empty case +# +# source://resource_registry//lib/schema_registry/maybe/absent.rb#6 +class Maybe::Absent + extend T::Generic + include ::Maybe + + Value = type_member { { fixed: T.noreturn } } + + # source://resource_registry//lib/schema_registry/maybe/absent.rb#77 + sig(:final) { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://resource_registry//lib/schema_registry/maybe/absent.rb#20 + sig(:final) { override.returns(::TrueClass) } + def absent?; end + + # source://resource_registry//lib/schema_registry/maybe/absent.rb#25 + sig(:final) { override.returns(::TrueClass) } + def empty?; end + + # source://resource_registry//lib/schema_registry/maybe/absent.rb#62 + sig(:final) { override.params(_block: T.proc.params(value: Value).returns(T::Boolean)).returns(Maybe[Value]) } + def filter(&_block); end + + # source://resource_registry//lib/schema_registry/maybe/absent.rb#72 + sig(:final) do + override + .type_parameters(:Default) + .params( + _block: T.proc.params(value: Value).returns(T.type_parameter(:Default)) + ).returns(Maybe[T.all(::BasicObject, T.type_parameter(:Default))]) + end + def map(&_block); end + + # source://resource_registry//lib/schema_registry/maybe/absent.rb#35 + sig(:final) do + override + .type_parameters(:Default) + .params( + default: T.type_parameter(:Default) + ).returns(T.type_parameter(:Default)) + end + def or_default(default); end + + # source://resource_registry//lib/schema_registry/maybe/absent.rb#15 + sig(:final) { override.returns(::FalseClass) } + def present?; end + + # source://resource_registry//lib/schema_registry/maybe/absent.rb#55 + sig(:final) do + override + .type_parameters(:Return) + .params( + _block: T.proc.returns(T.type_parameter(:Return)) + ).returns(T.nilable(T.type_parameter(:Return))) + end + def when_absent(&_block); end + + # source://resource_registry//lib/schema_registry/maybe/absent.rb#45 + sig(:final) do + override + .type_parameters(:Return) + .params( + _block: T.proc.params(v: Value).returns(T.type_parameter(:Return)) + ).returns(T.nilable(T.type_parameter(:Return))) + end + def when_present(&_block); end +end + +# Class used to represent the case when a value is available +# +# source://resource_registry//lib/schema_registry/maybe/present.rb#6 +class Maybe::Present + extend T::Generic + include ::Maybe + + Value = type_member(:out) { { upper: BasicObject } } + + # source://resource_registry//lib/schema_registry/maybe/present.rb#15 + sig(:final) { params(value: Value).void } + def initialize(value); end + + # source://resource_registry//lib/schema_registry/maybe/present.rb#85 + sig(:final) { override.params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://resource_registry//lib/schema_registry/maybe/present.rb#25 + sig(:final) { override.returns(::FalseClass) } + def absent?; end + + # source://resource_registry//lib/schema_registry/maybe/present.rb#30 + sig(:final) { override.returns(::FalseClass) } + def empty?; end + + # source://resource_registry//lib/schema_registry/maybe/present.rb#64 + sig(:final) { override.params(_block: T.proc.params(value: Value).returns(T::Boolean)).returns(Maybe[Value]) } + def filter(&_block); end + + # source://resource_registry//lib/schema_registry/maybe/present.rb#79 + sig(:final) do + override + .type_parameters(:Default) + .params( + _block: T.proc.params(value: Value).returns(T.all(::BasicObject, T.type_parameter(:Default))) + ).returns(Maybe[T.all(::BasicObject, T.type_parameter(:Default))]) + end + def map(&_block); end + + # source://resource_registry//lib/schema_registry/maybe/present.rb#37 + sig(:final) { override.type_parameters(:Default).params(_default: T.type_parameter(:Default)).returns(Value) } + def or_default(_default); end + + # source://resource_registry//lib/schema_registry/maybe/present.rb#20 + sig(:final) { override.returns(::TrueClass) } + def present?; end + + # source://resource_registry//lib/schema_registry/maybe/present.rb#92 + sig(:final) { returns(Value) } + def value; end + + # source://resource_registry//lib/schema_registry/maybe/present.rb#57 + sig(:final) do + override + .type_parameters(:Return) + .params( + _block: T.proc.returns(T.type_parameter(:Return)) + ).returns(T.nilable(T.type_parameter(:Return))) + end + def when_absent(&_block); end + + # @yield [value] + # + # source://resource_registry//lib/schema_registry/maybe/present.rb#47 + sig(:final) do + override + .type_parameters(:Return) + .params( + _block: T.proc.params(v: Value).returns(T.type_parameter(:Return)) + ).returns(T.nilable(T.type_parameter(:Return))) + end + def when_present(&_block); end +end + +class Object < ::BasicObject + include ::Kernel + include ::PP::ObjectMixin + + private + + # source://resource_registry//lib/public/resource.rb#13 + def parameterize(string); end +end + +# The criteria for considering something as a resource in the Resource +# Registry is dictated by the presence of its repository which has +# a specific ancestor. +# This class effectively eager loads repositories which is needed when +# assessing the code to generate a schematic view of the state of resources +# +# source://resource_registry//lib/public/repository_warmer.rb#8 +class RepositoryWarmer + # source://resource_registry//lib/public/repository_warmer.rb#12 + sig { void } + def call; end +end + +# Entry point for ResourceRegistry +# +# source://resource_registry//lib/schema_generator.rb#5 +module ResourceRegistry + class << self + # source://resource_registry//lib/resource_registry.rb#22 + sig { returns(::ResourceRegistry::Configuration) } + def configuration; end + + # @yield [configuration] + # + # source://resource_registry//lib/resource_registry.rb#27 + sig { void } + def configure; end + end +end + +# source://resource_registry//lib/public/capabilities/capability_config.rb#5 +module ResourceRegistry::Capabilities; end + +# Represents configuration for a specific resource capability +# +# @abstract Subclasses must implement the `abstract` methods below. +# +# source://resource_registry//lib/public/capabilities/capability_config.rb#7 +module ResourceRegistry::Capabilities::CapabilityConfig + include ::Kernel + + requires_ancestor { Object } + + interface! + + mixes_in_class_methods ::ResourceRegistry::Capabilities::CapabilityConfig::ClassMethods + + # @abstract + # + # source://resource_registry//lib/public/capabilities/capability_config.rb#30 + sig { abstract.returns(T::Hash[::String, T.untyped]) } + def serialize; end +end + +# Class methods interface for capability configuration +# +# @abstract Subclasses must implement the `abstract` methods below. +# +# source://resource_registry//lib/public/capabilities/capability_config.rb#15 +module ResourceRegistry::Capabilities::CapabilityConfig::ClassMethods + abstract! + + # The key of the capability, this key will be used to take it from yaml configuration + # + # @abstract + # + # source://resource_registry//lib/public/capabilities/capability_config.rb#22 + sig { abstract.returns(::Symbol) } + def key; end +end + +# This class enumerates features that are available to a resource. Each +# resource knows which subset of these it needs to be used with. +# +# source://resource_registry//lib/public/capability_factory.rb#6 +class ResourceRegistry::CapabilityFactory + class << self + # source://resource_registry//lib/public/capability_factory.rb#23 + sig do + params( + capability: ::ResourceRegistry::Capabilities::CapabilityConfig + ).returns(T::Hash[::String, T.untyped]) + end + def dump(capability); end + + # source://resource_registry//lib/public/capability_factory.rb#15 + sig do + params( + data: T::Hash[::String, T.untyped], + capabilities: T::Hash[::Symbol, T.all(T.class_of(T::Struct), T::Class[::ResourceRegistry::Capabilities::CapabilityConfig])] + ).returns(::ResourceRegistry::Capabilities::CapabilityConfig) + end + def load(data, capabilities: T.unsafe(nil)); end + end +end + +# source://resource_registry//lib/public/configuration.rb#10 +class ResourceRegistry::Configuration + # source://resource_registry//lib/public/configuration.rb#21 + sig { void } + def initialize; end + + # source://resource_registry//lib/public/configuration.rb#44 + sig do + returns(T::Hash[::Symbol, T.all(T.class_of(T::Struct), T::Class[::ResourceRegistry::Capabilities::CapabilityConfig])]) + end + def capabilities; end + + # source://resource_registry//lib/public/configuration.rb#32 + sig { params(capability: ::Symbol, klass: T.class_of(ResourceRegistry::Capabilities::CapabilityConfig)).void } + def register_capability(capability, klass); end + + # source://resource_registry//lib/public/configuration.rb#27 + sig { params(type: ::String, klass: T.class_of(ResourceRegistry::RelationshipType)).void } + def register_relationship_type(type, klass); end + + # source://resource_registry//lib/public/configuration.rb#37 + sig { returns(T::Hash[::String, T::Class[::ResourceRegistry::RelationshipType]]) } + def relationship_types; end +end + +# source://resource_registry//lib/public/configuration.rb#13 +ResourceRegistry::Configuration::DEFAULT_RELATIONSHIP_TYPES = T.let(T.unsafe(nil), Hash) + +# source://resource_registry//lib/public/entity_finder.rb#4 +class ResourceRegistry::EntityFinder + class << self + # source://resource_registry//lib/public/entity_finder.rb#10 + sig do + params( + repository: T.class_of(ResourceRegistry::Repositories::Base) + ).returns(T.nilable(T.class_of(T::Struct))) + end + def call(repository:); end + end +end + +# source://resource_registry//lib/public/infer_resources.rb#8 +class ResourceRegistry::InferResources + # source://resource_registry//lib/public/infer_resources.rb#12 + sig { void } + def initialize; end + + # source://resource_registry//lib/public/infer_resources.rb#17 + sig do + params( + repositories: T::Array[ResourceRegistry::Repositories::Base[T.untyped]] + ).returns(T::Array[::ResourceRegistry::Resource]) + end + def call(repositories:); end + + private + + # source://resource_registry//lib/public/infer_resources.rb#28 + sig do + params( + repository: T.class_of(ResourceRegistry::Repositories::Base) + ).returns(T.nilable(::ResourceRegistry::Resource)) + end + def generate_resource_from_repository(repository); end + + # source://resource_registry//lib/public/infer_resources.rb#24 + sig { returns(::ResourceRegistry::SchemaGenerator) } + def schema_generator; end +end + +# source://resource_registry//lib/public/initializer.rb#13 +class ResourceRegistry::Initializer + # source://resource_registry//lib/public/initializer.rb#17 + sig { params(repository_base_klass: T::Class[ResourceRegistry::Repositories::Base[T.untyped]]).void } + def initialize(repository_base_klass: T.unsafe(nil)); end + + # source://resource_registry//lib/public/initializer.rb#26 + sig { returns([::ResourceRegistry::Registry, ::SchemaRegistry::Registry, ::ResourceRegistry::OverridesLoader]) } + def call; end + + # source://resource_registry//lib/public/initializer.rb#32 + sig { void } + def warm!; end + + private + + # source://resource_registry//lib/public/initializer.rb#92 + sig { params(resource: T::Hash[::String, T.untyped]).returns(T::Hash[::String, T.untyped]) } + def apply_override(resource); end + + # source://resource_registry//lib/public/initializer.rb#104 + sig { returns(::ResourceRegistry::OverridesLoader) } + def overrides_loader; end + + # source://resource_registry//lib/public/initializer.rb#57 + sig { void } + def register_resources!; end + + # Returns the value of attribute repository_base_klass. + # + # source://resource_registry//lib/public/initializer.rb#39 + def repository_base_klass; end + + # source://resource_registry//lib/public/initializer.rb#42 + sig { returns(::ResourceRegistry::Registry) } + def resource_registry; end + + # source://resource_registry//lib/public/initializer.rb#68 + sig { returns(T::Array[::ResourceRegistry::Resource]) } + def resources; end + + # source://resource_registry//lib/public/initializer.rb#51 + sig { returns(::SchemaRegistry::Registry) } + def schema_registry; end +end + +# source://resource_registry//lib/public/overrides_loader.rb#4 +class ResourceRegistry::OverridesLoader + # source://resource_registry//lib/public/overrides_loader.rb#8 + sig { returns(T::Array[T::Hash[::String, T.untyped]]) } + def overrides; end + + private + + # source://resource_registry//lib/public/overrides_loader.rb#38 + sig { params(path: ::String).returns(T::Array[T::Hash[::String, T.untyped]]) } + def load_path_files(path); end + + # FIXME + # + # source://resource_registry//lib/public/overrides_loader.rb#22 + sig { returns(T.untyped) } + def paths; end +end + +# source://resource_registry//lib/public/registry.rb#21 +class ResourceRegistry::Registry + # source://resource_registry//lib/public/registry.rb#31 + sig { params(resources: T::Array[::ResourceRegistry::Resource]).void } + def initialize(resources:); end + + # source://resource_registry//lib/public/registry.rb#42 + sig { params(identifier: ::String).returns(T.nilable(::ResourceRegistry::Resource)) } + def fetch(identifier); end + + # @raise [UnableToFindResourceError] + # + # source://resource_registry//lib/public/registry.rb#47 + sig { params(identifier: ::String).returns(::ResourceRegistry::Resource) } + def fetch!(identifier); end + + # source://resource_registry//lib/public/registry.rb#63 + sig { returns(T::Hash[::String, ::ResourceRegistry::Resource]) } + def fetch_all; end + + # source://resource_registry//lib/public/registry.rb#58 + sig do + params( + repository_class: T::Class[ResourceRegistry::Repositories::Base[T.untyped]] + ).returns(T.nilable(::ResourceRegistry::Resource)) + end + def fetch_for_repository(repository_class); end + + # source://resource_registry//lib/public/registry.rb#70 + sig do + params( + capabilities: T::Class[::ResourceRegistry::Capabilities::CapabilityConfig] + ).returns(T::Array[::ResourceRegistry::Resource]) + end + def fetch_with_capabilities(*capabilities); end + + # source://resource_registry//lib/public/registry.rb#78 + sig do + params( + repository: T::Class[ResourceRegistry::Repositories::Base[T.untyped]] + ).returns(T.nilable(::ResourceRegistry::Resource)) + end + def find_by_repository(repository); end + + private + + # source://resource_registry//lib/public/registry.rb#88 + sig { params(resources: T::Array[::ResourceRegistry::Resource]).returns(T::Boolean) } + def duplicated_identifier?(resources); end + + # source://resource_registry//lib/public/registry.rb#85 + sig { returns(T::Hash[::String, ::ResourceRegistry::Resource]) } + def resources; end + + # @return [Hash{String => Resource}] + # + # source://resource_registry//lib/public/registry.rb#85 + def resources=(_arg0); end +end + +# source://resource_registry//lib/public/registry.rb#27 +class ResourceRegistry::Registry::DuplicatedIdentifierError < ::StandardError; end + +# source://resource_registry//lib/public/registry.rb#24 +class ResourceRegistry::Registry::UnableToFindResourceError < ::StandardError; end + +# source://resource_registry//lib/public/relationship.rb#8 +class ResourceRegistry::Relationship < ::T::Struct + const :name, ::String + const :resource_id, ::Symbol + const :field, ::Symbol + const :primary_key, ::Symbol, default: T.unsafe(nil) + const :type, ::ResourceRegistry::RelationshipType + const :fixed_dto_params, T.nilable(T::Hash[::String, T.untyped]) + const :optional, T::Boolean + + # source://resource_registry//lib/public/relationship.rb#26 + sig { returns(T::Hash[::String, T.untyped]) } + def dump; end + + # Are there multiple resources in the other side of the relationship? + # + # source://resource_registry//lib/public/relationship.rb#21 + sig { returns(T::Boolean) } + def many_cardinality?; end + + # source://resource_registry//lib/public/relationship.rb#71 + sig { returns(T::Boolean) } + def optional?; end + + # The field used to define the left side of a relationship. This is the + # field that it will be passed to the next resolver to fetch the data. + # + # source://resource_registry//lib/public/relationship.rb#66 + sig { returns(T.nilable(::Symbol)) } + def reference_id; end + + # We provide this in the dataloader, we encourage not to perform joins in + # frontend, so we skip ids to be exposed. + # FIXME: Review if this belongs to this layer or is coupled to GraphQL + # + # source://resource_registry//lib/public/relationship.rb#57 + sig { params(argument: ::String).returns(T::Boolean) } + def should_skip_argument?(argument); end + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + + # source://resource_registry//lib/public/relationship.rb#39 + sig { params(spec: T::Hash[::String, T.untyped]).returns(::ResourceRegistry::Relationship) } + def load(spec); end + end +end + +# @abstract Subclasses must implement the `abstract` methods below. +# +# source://resource_registry//lib/public/relationship_type.rb#4 +module ResourceRegistry::RelationshipType + requires_ancestor { Object } + + abstract! + + # source://resource_registry//lib/public/relationship_type.rb#19 + sig { params(spec: T::Hash[::String, T.untyped]).void } + def initialize(spec); end + + # @abstract + # + # source://resource_registry//lib/public/relationship_type.rb#48 + sig { abstract.returns(::Integer) } + def complexity; end + + # source://resource_registry//lib/public/relationship_type.rb#89 + sig { returns(::Symbol) } + def field; end + + # source://resource_registry//lib/public/relationship_type.rb#51 + sig { returns(T::Boolean) } + def forward_entities?; end + + # source://resource_registry//lib/public/relationship_type.rb#57 + sig { returns(T::Boolean) } + def forward_selected_fields?; end + + # @abstract + # + # source://resource_registry//lib/public/relationship_type.rb#30 + sig { abstract.returns(T::Boolean) } + def many_cardinality?; end + + # source://resource_registry//lib/public/relationship_type.rb#79 + sig { returns(::String) } + def name; end + + # source://resource_registry//lib/public/relationship_type.rb#74 + sig { returns(T::Array[T::Hash[::String, T.untyped]]) } + def nested_fields; end + + # @abstract + # + # source://resource_registry//lib/public/relationship_type.rb#71 + sig do + abstract + .params( + dto: T::Hash[::Symbol, T.untyped], + ids: T::Array[T.any(::Integer, ::String)], + rel: ::ResourceRegistry::Relationship, + parent_resource: T.nilable(::ResourceRegistry::Resource) + ).returns(T::Hash[::Symbol, T.untyped]) + end + def prepare_dto(dto, ids, rel, parent_resource); end + + # source://resource_registry//lib/public/relationship_type.rb#94 + sig { returns(::Symbol) } + def primary_key; end + + # The field defined to resolve the other side of the relationship, it can be field or primary_key + # + # @abstract + # + # source://resource_registry//lib/public/relationship_type.rb#34 + sig { abstract.params(relationship: ::ResourceRegistry::Relationship).returns(::Symbol) } + def reference_id(relationship); end + + # source://resource_registry//lib/public/relationship_type.rb#106 + sig { overridable.returns(T.nilable(::Symbol)) } + def relationship_field_name; end + + # source://resource_registry//lib/public/relationship_type.rb#84 + sig { returns(::Symbol) } + def resource_id; end + + # @abstract + # + # source://resource_registry//lib/public/relationship_type.rb#24 + sig { abstract.returns(::String) } + def serialize; end + + # @abstract + # + # source://resource_registry//lib/public/relationship_type.rb#45 + sig do + abstract + .params( + loaded_data: T::Array[T::Hash[::String, T.untyped]], + ids: T.untyped, + relationship: ::ResourceRegistry::Relationship + ).returns(T::Array[T.nilable(T.any(T::Array[T::Hash[::String, T.untyped]], T::Hash[::String, T.untyped]))]) + end + def shape_result(loaded_data, ids, relationship); end + + # @abstract + # + # source://resource_registry//lib/public/relationship_type.rb#27 + sig { abstract.params(argument: ::String, relationship: ::ResourceRegistry::Relationship).returns(T::Boolean) } + def should_skip_argument?(argument, relationship); end + + # source://resource_registry//lib/public/relationship_type.rb#99 + sig { overridable.params(read_dto: T.nilable(T.class_of(T::Struct))).returns(T::Boolean) } + def valid_relationship_field?(read_dto); end +end + +# source://resource_registry//lib/public/relationship_type.rb#13 +ResourceRegistry::RelationshipType::ResultShape = T.type_alias { T::Array[T.nilable(T.any(T::Array[T::Hash[::String, T.untyped]], T::Hash[::String, T.untyped]))] } + +# source://resource_registry//lib/public/relationship_type_factory.rb#4 +module ResourceRegistry::RelationshipTypeFactory + class << self + # FIXME: Allow a more dynamic and future proof way to register relationship types + # + # source://resource_registry//lib/public/relationship_type_factory.rb#9 + sig { params(spec: T.untyped).returns(::ResourceRegistry::RelationshipType) } + def from_spec(spec); end + end +end + +# source://resource_registry//lib/public/relationship_types/has_many.rb#7 +module ResourceRegistry::RelationshipTypes; end + +# source://resource_registry//lib/public/relationship_types/belongs_to.rb#8 +class ResourceRegistry::RelationshipTypes::BelongsTo + include ::ResourceRegistry::RelationshipType + + # source://resource_registry//lib/public/relationship_types/belongs_to.rb#52 + sig { override.returns(::Integer) } + def complexity; end + + # source://resource_registry//lib/public/relationship_types/belongs_to.rb#24 + sig { override.returns(T::Boolean) } + def many_cardinality?; end + + # source://resource_registry//lib/public/relationship_types/belongs_to.rb#66 + sig do + override + .params( + dto: T::Hash[::Symbol, T.untyped], + ids: T::Array[T.any(::Integer, ::String)], + rel: ::ResourceRegistry::Relationship, + _parent_resource: T.nilable(::ResourceRegistry::Resource) + ).returns(T::Hash[::Symbol, T.untyped]) + end + def prepare_dto(dto, ids, rel, _parent_resource); end + + # source://resource_registry//lib/public/relationship_types/belongs_to.rb#29 + sig { override.params(relationship: ::ResourceRegistry::Relationship).returns(::Symbol) } + def reference_id(relationship); end + + # source://resource_registry//lib/public/relationship_types/belongs_to.rb#72 + sig { override.returns(::Symbol) } + def relationship_field_name; end + + # source://resource_registry//lib/public/relationship_types/belongs_to.rb#14 + sig { override.returns(::String) } + def serialize; end + + # source://resource_registry//lib/public/relationship_types/belongs_to.rb#46 + sig do + override + .params( + loaded_data: T::Array[T::Hash[::String, T.untyped]], + ids: T.untyped, + relationship: ::ResourceRegistry::Relationship + ).returns(T::Array[T.nilable(T.any(T::Array[T::Hash[::String, T.untyped]], T::Hash[::String, T.untyped]))]) + end + def shape_result(loaded_data, ids, relationship); end + + # source://resource_registry//lib/public/relationship_types/belongs_to.rb#19 + sig { override.params(argument: ::String, relationship: ::ResourceRegistry::Relationship).returns(T::Boolean) } + def should_skip_argument?(argument, relationship); end +end + +# source://resource_registry//lib/public/relationship_types/has_many.rb#8 +class ResourceRegistry::RelationshipTypes::HasMany + include ::ResourceRegistry::RelationshipType + + # source://resource_registry//lib/public/relationship_types/has_many.rb#52 + sig { override.returns(::Integer) } + def complexity; end + + # source://resource_registry//lib/public/relationship_types/has_many.rb#24 + sig { override.returns(T::Boolean) } + def many_cardinality?; end + + # source://resource_registry//lib/public/relationship_types/has_many.rb#66 + sig do + override + .params( + dto: T::Hash[::Symbol, T.untyped], + ids: T::Array[T.any(::Integer, ::String)], + rel: ::ResourceRegistry::Relationship, + _parent_resource: T.nilable(::ResourceRegistry::Resource) + ).returns(T::Hash[::Symbol, T.untyped]) + end + def prepare_dto(dto, ids, rel, _parent_resource); end + + # source://resource_registry//lib/public/relationship_types/has_many.rb#29 + sig { override.params(relationship: ::ResourceRegistry::Relationship).returns(::Symbol) } + def reference_id(relationship); end + + # source://resource_registry//lib/public/relationship_types/has_many.rb#72 + sig { override.returns(::Symbol) } + def relationship_field_name; end + + # source://resource_registry//lib/public/relationship_types/has_many.rb#14 + sig { override.returns(::String) } + def serialize; end + + # source://resource_registry//lib/public/relationship_types/has_many.rb#46 + sig do + override + .params( + loaded_data: T::Array[T::Hash[::String, T.untyped]], + ids: T.untyped, + relationship: ::ResourceRegistry::Relationship + ).returns(T::Array[T.nilable(T.any(T::Array[T::Hash[::String, T.untyped]], T::Hash[::String, T.untyped]))]) + end + def shape_result(loaded_data, ids, relationship); end + + # source://resource_registry//lib/public/relationship_types/has_many.rb#19 + sig { override.params(argument: ::String, relationship: ::ResourceRegistry::Relationship).returns(T::Boolean) } + def should_skip_argument?(argument, relationship); end +end + +# source://resource_registry//lib/public/relationship_types/has_many_through.rb#8 +class ResourceRegistry::RelationshipTypes::HasManyThrough + include ::ResourceRegistry::RelationshipType + + # source://resource_registry//lib/public/relationship_types/has_many_through.rb#51 + sig { override.returns(::Integer) } + def complexity; end + + # source://resource_registry//lib/public/relationship_types/has_many_through.rb#24 + sig { override.returns(T::Boolean) } + def many_cardinality?; end + + # source://resource_registry//lib/public/relationship_types/has_many_through.rb#65 + sig do + override + .params( + dto: T::Hash[::Symbol, T.untyped], + ids: T::Array[T.any(::Integer, ::String)], + _rel: ::ResourceRegistry::Relationship, + _parent_resource: T.nilable(::ResourceRegistry::Resource) + ).returns(T::Hash[::Symbol, T.untyped]) + end + def prepare_dto(dto, ids, _rel, _parent_resource); end + + # source://resource_registry//lib/public/relationship_types/has_many_through.rb#29 + sig { override.params(relationship: ::ResourceRegistry::Relationship).returns(::Symbol) } + def reference_id(relationship); end + + # source://resource_registry//lib/public/relationship_types/has_many_through.rb#71 + sig { override.returns(::Symbol) } + def relationship_field_name; end + + # source://resource_registry//lib/public/relationship_types/has_many_through.rb#14 + sig { override.returns(::String) } + def serialize; end + + # source://resource_registry//lib/public/relationship_types/has_many_through.rb#46 + sig do + override + .params( + loaded_data: T::Array[T::Hash[::String, T.untyped]], + ids: T.untyped, + _relationship: ::ResourceRegistry::Relationship + ).returns(T::Array[T.nilable(T.any(T::Array[T::Hash[::String, T.untyped]], T::Hash[::String, T.untyped]))]) + end + def shape_result(loaded_data, ids, _relationship); end + + # source://resource_registry//lib/public/relationship_types/has_many_through.rb#19 + sig { override.params(argument: ::String, relationship: ::ResourceRegistry::Relationship).returns(T::Boolean) } + def should_skip_argument?(argument, relationship); end +end + +# source://resource_registry//lib/public/relationship_types/has_one.rb#8 +class ResourceRegistry::RelationshipTypes::HasOne + include ::ResourceRegistry::RelationshipType + + # source://resource_registry//lib/public/relationship_types/has_one.rb#53 + sig { override.returns(::Integer) } + def complexity; end + + # source://resource_registry//lib/public/relationship_types/has_one.rb#24 + sig { override.returns(T::Boolean) } + def many_cardinality?; end + + # source://resource_registry//lib/public/relationship_types/has_one.rb#67 + sig do + override + .params( + dto: T::Hash[::Symbol, T.untyped], + ids: T::Array[T.any(::Integer, ::String)], + rel: ::ResourceRegistry::Relationship, + _parent_resource: T.nilable(::ResourceRegistry::Resource) + ).returns(T::Hash[::Symbol, T.untyped]) + end + def prepare_dto(dto, ids, rel, _parent_resource); end + + # FIXME: Review if this is actually reference_id + # + # source://resource_registry//lib/public/relationship_types/has_one.rb#30 + sig { override.params(relationship: ::ResourceRegistry::Relationship).returns(::Symbol) } + def reference_id(relationship); end + + # source://resource_registry//lib/public/relationship_types/has_one.rb#73 + sig { override.returns(::Symbol) } + def relationship_field_name; end + + # source://resource_registry//lib/public/relationship_types/has_one.rb#14 + sig { override.returns(::String) } + def serialize; end + + # source://resource_registry//lib/public/relationship_types/has_one.rb#47 + sig do + override + .params( + loaded_data: T::Array[T::Hash[::String, T.untyped]], + ids: T.untyped, + relationship: ::ResourceRegistry::Relationship + ).returns(T::Array[T.nilable(T.any(T::Array[T::Hash[::String, T.untyped]], T::Hash[::String, T.untyped]))]) + end + def shape_result(loaded_data, ids, relationship); end + + # source://resource_registry//lib/public/relationship_types/has_one.rb#19 + sig { override.params(argument: ::String, relationship: ::ResourceRegistry::Relationship).returns(T::Boolean) } + def should_skip_argument?(argument, relationship); end +end + +# source://resource_registry//lib/public/repositories/output_contexts/page_info_dto.rb#4 +module ResourceRegistry::Repositories; end + +# @abstract Subclasses must implement the `abstract` methods below. +# +# source://resource_registry//lib/public/repositories/base.rb#10 +module ResourceRegistry::Repositories::Base + extend T::Generic + include ::Kernel + extend ::RuntimeGeneric + + abstract! + + Entity = type_member { { upper: T::Struct } } + + # source://resource_registry//lib/public/repositories/base.rb#36 + sig { overridable.params(dto: T.untyped, context: T.untyped).returns(T.untyped) } + def read(dto:, context:); end + + # source://resource_registry//lib/public/repositories/base.rb#41 + sig { overridable.params(entity: Entity, tags: T::Set[T.untyped]).returns(T::Hash[::Symbol, T.untyped]) } + def serialize(entity:, tags: T.unsafe(nil)); end + + private + + # @raise [NotImplementedError] + # + # source://resource_registry//lib/public/repositories/base.rb#70 + sig { params(method: T.nilable(::Symbol)).returns(T.noreturn) } + def raise_error(method); end + + # source://resource_registry//lib/public/repositories/base.rb#61 + sig { returns(::ResourceRegistry::Serializer) } + def serializer; end + + class << self + # source://resource_registry//lib/public/repositories/base.rb#25 + sig { returns(T.untyped) } + def entity; end + + # source://resource_registry//lib/public/repositories/base.rb#46 + sig(:final) { returns(::String) } + def namespace; end + + # source://resource_registry//lib/public/repositories/base.rb#54 + sig(:final) { returns(::String) } + def resource_name; end + end +end + +# source://resource_registry//lib/public/repositories/output_contexts/page_info_dto.rb#5 +module ResourceRegistry::Repositories::OutputContexts; end + +# source://resource_registry//lib/public/repositories/output_contexts/page_info_dto.rb#6 +class ResourceRegistry::Repositories::OutputContexts::PageInfoDto < ::T::Struct + const :has_next_page, T::Boolean, default: T.unsafe(nil) + const :has_previous_page, T::Boolean, default: T.unsafe(nil) + const :start_cursor, T.nilable(::String), default: T.unsafe(nil) + const :end_cursor, T.nilable(::String), default: T.unsafe(nil) + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# @abstract Subclasses must implement the `abstract` methods below. +# +# source://resource_registry//lib/public/repositories/read_result.rb#7 +module ResourceRegistry::Repositories::ReadResult + extend T::Generic + + interface! + + Entity = type_member { { upper: T::Struct } } + + # @abstract + # + # source://resource_registry//lib/public/repositories/read_result.rb#17 + sig { abstract.returns(T.untyped) } + def entities; end + + # @abstract + # + # source://resource_registry//lib/public/repositories/read_result.rb#23 + sig { abstract.returns(::ResourceRegistry::Repositories::OutputContexts::PageInfoDto) } + def page_info; end + + # @abstract + # + # source://resource_registry//lib/public/repositories/read_result.rb#20 + sig { abstract.returns(T.untyped) } + def projections; end + + # @abstract + # + # source://resource_registry//lib/public/repositories/read_result.rb#26 + sig { abstract.returns(T.nilable(::Integer)) } + def total_count; end +end + +# The main class that represents a resource in the system. +# +# source://resource_registry//lib/public/resource.rb#20 +class ResourceRegistry::Resource < ::T::Struct + const :repository_raw, ::String + const :description, ::String, default: T.unsafe(nil) + const :capabilities, T::Hash[::Symbol, ::ResourceRegistry::Capabilities::CapabilityConfig], default: T.unsafe(nil) + const :relationships, T::Hash[::Symbol, ::ResourceRegistry::Relationship], default: T.unsafe(nil) + const :schema, ::SchemaRegistry::Schema + const :verbs, T::Hash[::Symbol, ::ResourceRegistry::Verb] + const :paginateable, T::Boolean, default: T.unsafe(nil) + + # @raise [VerbNotFound] + # + # source://resource_registry//lib/public/resource.rb#108 + sig { params(verb: ::Symbol, parameters: T.untyped).returns(::T::Struct) } + def build_dto(verb, **parameters); end + + # source://resource_registry//lib/public/resource.rb#97 + sig { returns(::String) } + def camelize; end + + # At first glance this method signature appears funkier than a James Brown record. + # + # We declare a generic `CapabilityConfig` type parameter, which we then combine + # in a type union with the public methods declared by the `Capabilities::CapabilityConfig` + # interface. As such, the `capability` parameter is typed to be any class that includes + # the `Capabilities::CapabilityConfig` interface. + # Then, we declare the return type to be a nullable instance of the `CapabilityConfig` + # type parameter. The result is Sorbet knows that the return type of the method is + # always the same as the type of the `capability` parameter that the method is called + # with, so we never need to cast the result. For example, can can do + # + # capability = resource.capability(Comments::Capabilities::Commentable) + # + # and Sorbet will know that `capability` is an instance of `Comments::Capabilities::Commentable` + # + # source://resource_registry//lib/public/resource.rb#144 + sig do + type_parameters(:CapabilityConfig) + .params( + capability: T.all(::ResourceRegistry::Capabilities::CapabilityConfig::ClassMethods, T::Class[::ResourceRegistry::Capabilities::CapabilityConfig], T::Class[T.type_parameter(:CapabilityConfig)]) + ).returns(T.nilable(T.type_parameter(:CapabilityConfig))) + end + def capability(capability); end + + # source://resource_registry//lib/public/resource.rb#180 + sig do + type_parameters(:CapabilityConfig) + .params( + feature: T.all(::ResourceRegistry::Capabilities::CapabilityConfig::ClassMethods, T::Class[::ResourceRegistry::Capabilities::CapabilityConfig], T::Class[T.type_parameter(:CapabilityConfig)]) + ).returns(T.type_parameter(:CapabilityConfig)) + end + def capability!(feature); end + + # source://resource_registry//lib/public/resource.rb#162 + sig do + params( + feature: T.all(::ResourceRegistry::Capabilities::CapabilityConfig::ClassMethods, T::Class[::ResourceRegistry::Capabilities::CapabilityConfig]) + ).returns(T::Boolean) + end + def capability?(feature); end + + # source://resource_registry//lib/public/resource.rb#149 + sig { params(key: ::Symbol).returns(T.nilable(::ResourceRegistry::Capabilities::CapabilityConfig)) } + def capability_by_key(key); end + + # source://resource_registry//lib/public/resource.rb#61 + sig { returns(::String) } + def collection_name; end + + # source://resource_registry//lib/public/resource.rb#202 + sig { returns(T::Hash[::String, T.untyped]) } + def dump; end + + # source://resource_registry//lib/public/resource.rb#102 + sig { returns(::String) } + def humanize; end + + # source://resource_registry//lib/public/resource.rb#56 + sig { returns(::Symbol) } + def identifier; end + + # source://resource_registry//lib/public/resource.rb#192 + sig { returns(T::Array[::ResourceRegistry::Verb]) } + def mutation_verbs; end + + # source://resource_registry//lib/public/resource.rb#66 + sig { returns(::Symbol) } + def name; end + + # source://resource_registry//lib/public/resource.rb#84 + sig(:final) { returns(::String) } + def namespace; end + + # source://resource_registry//lib/public/resource.rb#45 + sig { returns(::String) } + def path; end + + # @raise [ArgumentError] + # + # source://resource_registry//lib/public/resource.rb#76 + sig { returns(T::Class[ResourceRegistry::Repositories::Base[T.untyped]]) } + def repository; end + + # source://resource_registry//lib/public/resource.rb#71 + sig { returns(::String) } + def resource_name; end + + # source://resource_registry//lib/public/resource.rb#187 + sig { returns(T::Array[::ResourceRegistry::Verb]) } + def rpc_verbs; end + + # source://resource_registry//lib/public/resource.rb#51 + sig { returns(::String) } + def slug; end + + # source://resource_registry//lib/public/resource.rb#92 + sig { returns(::String) } + def underscore; end + + # source://resource_registry//lib/public/resource.rb#197 + sig { params(except: T::Array[::Symbol]).returns(T::Array[::ResourceRegistry::Verb]) } + def verbs_except(except); end + + private + + # source://resource_registry//lib/public/resource.rb#251 + sig { returns(::Dry::Inflector) } + def inflector; end + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + + # source://resource_registry//lib/public/resource.rb#220 + sig do + params( + spec: T::Hash[::String, T.untyped], + configuration: ::ResourceRegistry::Configuration + ).returns(::ResourceRegistry::Resource) + end + def load(spec, configuration: T.unsafe(nil)); end + end +end + +# source://resource_registry//lib/public/resource.rb#26 +class ResourceRegistry::Resource::SchemaNotFound < ::StandardError; end + +# source://resource_registry//lib/public/resource.rb#23 +class ResourceRegistry::Resource::VerbNotFound < ::StandardError; end + +# source://resource_registry//lib/schema_generator.rb#6 +class ResourceRegistry::SchemaGenerator + # source://resource_registry//lib/schema_generator.rb#12 + sig do + params( + repository: T.class_of(ResourceRegistry::Repositories::Base) + ).returns(T.nilable(::SchemaRegistry::Schema)) + end + def generate(repository:); end + + private + + # source://resource_registry//lib/schema_generator.rb#26 + sig { params(repo: T.class_of(ResourceRegistry::Repositories::Base)).returns(::Symbol) } + def identifier_from_repo(repo); end +end + +# source://resource_registry//lib/schema_generator.rb#9 +ResourceRegistry::SchemaGenerator::Repository = T.type_alias { T.class_of(ResourceRegistry::Repositories::Base) } + +# source://resource_registry//lib/public/serializer.rb#4 +class ResourceRegistry::Serializer + # Maybe this should be a generic? + # + # source://resource_registry//lib/public/serializer.rb#9 + sig { params(resource: ::ResourceRegistry::Resource).void } + def initialize(resource:); end + + # source://resource_registry//lib/public/serializer.rb#14 + sig { params(entity: ::T::Struct, tags: T::Set[::Symbol]).returns(T::Hash[::Symbol, T.untyped]) } + def serialize(entity:, tags:); end + + private + + # source://resource_registry//lib/public/serializer.rb#40 + sig { params(property_value: T.untyped).returns(T.untyped) } + def recursive_serialization(property_value); end + + # source://resource_registry//lib/public/serializer.rb#47 + sig { returns(::SchemaRegistry::Schema) } + def resource_schema; end +end + +# This is the representation of a verb over a resource. Each resource can +# have multiple verbs that should be exposed by its repository +# +# source://resource_registry//lib/public/verb.rb#9 +class ResourceRegistry::Verb < ::T::Struct + const :id, ::Symbol + const :dto_raw, ::String + const :summary, T.nilable(::String), default: T.unsafe(nil) + const :description, T.nilable(::String), default: T.unsafe(nil) + const :deprecated_on, T.nilable(::Date), default: T.unsafe(nil) + const :webhook_description, T.nilable(::String), default: T.unsafe(nil) + const :schema, ::SchemaRegistry::Schema + const :return_many, T::Boolean, default: T.unsafe(nil) + + # source://resource_registry//lib/public/verb.rb#56 + sig { returns(T::Boolean) } + def create?; end + + # source://resource_registry//lib/public/verb.rb#29 + sig { returns(T::Boolean) } + def deprecated?; end + + # source://resource_registry//lib/public/verb.rb#46 + sig { returns(T::Boolean) } + def destroy?; end + + # @raise [DtoClassNotFound] + # + # source://resource_registry//lib/public/verb.rb#61 + sig { returns(T.class_of(T::Struct)) } + def dto; end + + # source://resource_registry//lib/public/verb.rb#70 + sig { returns(T::Hash[::Symbol, T.untyped]) } + def dump; end + + # source://resource_registry//lib/public/verb.rb#41 + sig { returns(T::Boolean) } + def get?; end + + # source://resource_registry//lib/public/verb.rb#36 + sig { returns(T::Boolean) } + def mutation?; end + + # source://resource_registry//lib/public/verb.rb#24 + sig { returns(::Symbol) } + def schema_identifier; end + + # source://resource_registry//lib/public/verb.rb#51 + sig { returns(T::Boolean) } + def update?; end + + private + + # source://resource_registry//lib/public/verb.rb#101 + sig { returns(::Dry::Inflector) } + def inflector; end + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + + # @raise [ArgumentError] + # + # source://resource_registry//lib/public/verb.rb#80 + sig { params(spec: T.untyped).returns(::ResourceRegistry::Verb) } + def load(spec); end + end +end + +# source://resource_registry//lib/public/verb.rb#12 +class ResourceRegistry::Verb::DtoClassNotFound < ::StandardError; end + +# source://resource_registry//lib/public/versions/version.rb#4 +class ResourceRegistry::Versions + # source://resource_registry//lib/public/versions.rb#9 + sig { params(versions: T::Array[::ResourceRegistry::Versions::Version]).void } + def initialize(versions:); end + + # source://resource_registry//lib/public/versions.rb#14 + sig { params(name: T.nilable(::String)).returns(T.nilable(::ResourceRegistry::Versions::Version)) } + def find(name); end + + # source://resource_registry//lib/public/versions.rb#21 + sig { params(name: ::String).returns(::ResourceRegistry::Versions::Version) } + def find!(name); end + + # source://resource_registry//lib/public/versions.rb#26 + sig { params(name: ::String).returns(T.nilable(::ResourceRegistry::Versions::Version)) } + def find_next(name); end + + # source://resource_registry//lib/public/versions.rb#43 + sig do + params( + from: T.nilable(::String), + to: T.nilable(::String) + ).returns(T::Array[::ResourceRegistry::Versions::Version]) + end + def in_range(from, to); end + + # source://resource_registry//lib/public/versions.rb#34 + sig { returns(T::Array[::ResourceRegistry::Versions::Version]) } + def sorted_versions; end + + private + + # source://resource_registry//lib/public/versions.rb#52 + sig { returns(T::Array[::ResourceRegistry::Versions::Version]) } + def versions; end +end + +# source://resource_registry//lib/public/versions/version.rb#5 +class ResourceRegistry::Versions::Version + # source://resource_registry//lib/public/versions/version.rb#9 + sig { params(name: ::String, aliases: T.nilable(T.any(::String, T::Array[::String]))).void } + def initialize(name, aliases: T.unsafe(nil)); end + + # source://resource_registry//lib/public/versions/version.rb#41 + sig { params(other: ::ResourceRegistry::Versions::Version).returns(T::Boolean) } + def <=(other); end + + # source://resource_registry//lib/public/versions/version.rb#31 + sig { params(other: ::ResourceRegistry::Versions::Version).returns(T.nilable(::Integer)) } + def <=>(other); end + + # source://resource_registry//lib/public/versions/version.rb#36 + sig { params(other: ::ResourceRegistry::Versions::Version).returns(T::Boolean) } + def >=(other); end + + # source://resource_registry//lib/public/versions/version.rb#18 + sig { returns(T::Array[::String]) } + def aliases; end + + # source://resource_registry//lib/public/versions/version.rb#26 + sig { params(str: ::String).returns(T::Boolean) } + def matches?(str); end + + # source://resource_registry//lib/public/versions/version.rb#15 + sig { returns(::String) } + def name; end + + # source://resource_registry//lib/public/versions/version.rb#21 + sig { returns(::String) } + def to_s; end +end + +# This module allows using type introspection to serialize/deserialize custom generics in +# T::Structs. +# +# While Sorbet can answer questions about types in T::Structs and arrays, it erases generic types +# at runtime. To support custom generics, we must manually preserve the type information with +# which they were declared. +# +# Use this module instead of `T::Generic` to create generic types with runtime type information. +# +# source://resource_registry//lib/runtime_generic.rb#11 +module RuntimeGeneric + include ::Kernel + + # source://resource_registry//lib/runtime_generic.rb#42 + def [](inner_type); end + + # source://resource_registry//lib/runtime_generic.rb#46 + def type_member(variance = T.unsafe(nil), &blk); end +end + +# source://resource_registry//lib/runtime_generic.rb#31 +class RuntimeGeneric::MyTypeMember < ::T::Types::TypeMember + # @return [MyTypeMember] a new instance of MyTypeMember + # + # source://resource_registry//lib/runtime_generic.rb#32 + def initialize(variance, &type_proc); end + + # source://resource_registry//lib/runtime_generic.rb#37 + def inner_type; end +end + +# source://resource_registry//lib/runtime_generic.rb#16 +class RuntimeGeneric::TypedGeneric < ::T::Types::Simple + # @return [TypedGeneric] a new instance of TypedGeneric + # + # source://resource_registry//lib/runtime_generic.rb#23 + def initialize(raw_type, inner_type); end + + # Returns the value of attribute inner_type. + # + # source://resource_registry//lib/runtime_generic.rb#28 + def inner_type; end + + # source://resource_registry//lib/runtime_generic.rb#19 + def name; end +end + +# source://resource_registry//lib/schema_registry/generate_from_struct.rb#3 +module SchemaRegistry; end + +# source://resource_registry//lib/schema_registry/filter_field.rb#4 +class SchemaRegistry::FilterField < ::T::Struct + const :name, ::String + const :resolver, T.nilable(T::Hash[::Symbol, ::String]) + const :type, ::SchemaRegistry::PropertyType + const :in_memory, T::Boolean, default: T.unsafe(nil) + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://resource_registry//lib/schema_registry/generate_from_struct.rb#4 +class SchemaRegistry::GenerateFromStruct + # source://resource_registry//lib/schema_registry/generate_from_struct.rb#16 + sig { params(struct_klass: T.class_of(T::Struct)).void } + def initialize(struct_klass:); end + + # source://resource_registry//lib/schema_registry/generate_from_struct.rb#21 + sig { returns(T::Hash[::Symbol, T.untyped]) } + def call; end + + private + + # source://resource_registry//lib/schema_registry/generate_from_struct.rb#74 + sig { params(klass: T.untyped).returns(T.nilable(T::Array[::String])) } + def calculate_required(klass); end + + # source://resource_registry//lib/schema_registry/generate_from_struct.rb#122 + sig { params(typedef: T.untyped).returns(T::Boolean) } + def can_resolve_type?(typedef); end + + # source://resource_registry//lib/schema_registry/generate_from_struct.rb#129 + sig do + params( + prop: T.untyped + ).returns(T.nilable(T.any(::BigDecimal, ::Date, ::DateTime, ::Float, ::Integer, ::ResourceRegistry::Versions::Version, ::String, ::Time, Maybe[T.untyped], T::Array[T.untyped], T::Boolean, T::Hash[::String, T.untyped]))) + end + def compute_default(prop); end + + # source://resource_registry//lib/schema_registry/generate_from_struct.rb#87 + sig { params(typedef: T.untyped, prop: T.untyped).returns(T::Hash[T.untyped, T.untyped]) } + def deep_generate_array(typedef, prop); end + + # source://resource_registry//lib/schema_registry/generate_from_struct.rb#107 + sig do + params( + array_type: T.any(::String, T::Array[::String]), + typedef: T.untyped + ).returns(T::Hash[T.untyped, T.untyped]) + end + def deep_generate_items(array_type, typedef); end + + # source://resource_registry//lib/schema_registry/generate_from_struct.rb#40 + sig { params(klass: T.class_of(T::Struct)).returns(T::Hash[::Symbol, T.untyped]) } + def deep_generate_properties(klass); end + + # source://resource_registry//lib/schema_registry/generate_from_struct.rb#181 + sig { params(type: T.untyped).returns(T::Boolean) } + def enum?(type); end + + # source://resource_registry//lib/schema_registry/generate_from_struct.rb#167 + sig do + params( + type: T.any(::Integer, ::T::Types::Union, T.untyped), + type_object: T.untyped + ).returns(T::Array[::String]) + end + def nilable_sorbet_type_to_json(type:, type_object: T.unsafe(nil)); end + + # source://resource_registry//lib/schema_registry/generate_from_struct.rb#174 + sig { params(type: T.untyped).returns(T::Boolean) } + def represented_as_string?(type); end + + # source://resource_registry//lib/schema_registry/generate_from_struct.rb#81 + sig { params(definition: T.untyped).returns(T::Boolean) } + def required?(definition); end + + # source://resource_registry//lib/schema_registry/generate_from_struct.rb#149 + sig do + params( + type: T.any(::Integer, ::T::Types::Union, T.untyped), + type_object: T.untyped, + nilable: T::Boolean + ).returns(T.any(::String, T::Array[::String])) + end + def sorbet_type_to_json(type:, type_object: T.unsafe(nil), nilable: T.unsafe(nil)); end + + # source://resource_registry//lib/schema_registry/generate_from_struct.rb#188 + sig { params(type: T.untyped).returns(T.nilable(::String)) } + def sorbet_type_to_json_format(type:); end + + # source://resource_registry//lib/schema_registry/generate_from_struct.rb#37 + sig { returns(T.class_of(T::Struct)) } + def struct_klass; end + + # source://resource_registry//lib/schema_registry/generate_from_struct.rb#200 + sig { params(definition: T.untyped, type_object: T.untyped).returns(T.untyped) } + def type_definition(definition, type_object); end + + # source://resource_registry//lib/schema_registry/generate_from_struct.rb#214 + sig { params(type: T.untyped).returns(T.untyped) } + def union_type_definition(type); end +end + +# source://resource_registry//lib/schema_registry/generate_from_struct.rb#7 +class SchemaRegistry::GenerateFromStruct::SolvableNestedTypes < ::T::Enum + enums do + Dtos = new + Entities = new + ValueObjects = new + end +end + +# source://resource_registry//lib/schema_registry/json_schema_mapper.rb#4 +class SchemaRegistry::JsonSchemaMapper + # TODO: Proper type json-schema + # + # source://resource_registry//lib/schema_registry/json_schema_mapper.rb#14 + sig { params(namespace: ::String, definition: T.untyped).void } + def initialize(namespace:, definition:); end + + # source://resource_registry//lib/schema_registry/json_schema_mapper.rb#20 + sig { returns(::SchemaRegistry::Schema) } + def call; end + + private + + # source://resource_registry//lib/schema_registry/json_schema_mapper.rb#37 + sig { returns(T.untyped) } + def definition; end + + # source://resource_registry//lib/schema_registry/json_schema_mapper.rb#69 + sig do + params( + input: T.nilable(T::Array[T::Hash[::String, T.untyped]]) + ).returns(T::Array[::SchemaRegistry::FilterField]) + end + def handle_fields(input); end + + # source://resource_registry//lib/schema_registry/json_schema_mapper.rb#47 + sig { params(items: T.nilable(T::Hash[T.untyped, T.untyped])).returns(T::Array[::SchemaRegistry::Property]) } + def handle_items(items); end + + # source://resource_registry//lib/schema_registry/json_schema_mapper.rb#88 + sig do + params( + properties: T.nilable(T::Hash[T.untyped, T.untyped]), + required: T.nilable(T::Array[::String]) + ).returns(T.nilable(T::Array[::SchemaRegistry::Property])) + end + def handle_properties(properties, required); end + + # source://resource_registry//lib/schema_registry/json_schema_mapper.rb#148 + sig do + params( + resolver: T.nilable(T.any(::String, T::Hash[::Symbol, ::String])) + ).returns(T.nilable(T::Hash[::Symbol, ::String])) + end + def handle_resolver(resolver); end + + # source://resource_registry//lib/schema_registry/json_schema_mapper.rb#157 + sig { params(serialization_groups: T.nilable(T::Array[::String])).returns(T::Set[::Symbol]) } + def handle_serialization_groups(serialization_groups); end + + # source://resource_registry//lib/schema_registry/json_schema_mapper.rb#132 + sig do + params( + prop_type: T.any(::String, T::Array[::String]), + format: T.nilable(::String) + ).returns(T::Array[::SchemaRegistry::PropertyType]) + end + def handle_types(prop_type, format); end + + # source://resource_registry//lib/schema_registry/json_schema_mapper.rb#40 + sig { returns(::String) } + def namespace; end + + # source://resource_registry//lib/schema_registry/json_schema_mapper.rb#137 + sig { params(prop_type: T.any(::String, T::Array[::String])).returns(T::Boolean) } + def nilable?(prop_type); end + + # source://resource_registry//lib/schema_registry/json_schema_mapper.rb#192 + sig { params(format: T.nilable(::String)).returns(::SchemaRegistry::PropertyType) } + def string_format_to_sorbet(format); end + + # source://resource_registry//lib/schema_registry/json_schema_mapper.rb#166 + sig do + params( + json_schema_type: T.nilable(::String), + format: T.nilable(::String) + ).returns(::SchemaRegistry::PropertyType) + end + def type_to_sorbet(json_schema_type, format); end +end + +# source://resource_registry//lib/schema_registry/json_schema_mapper.rb#10 +SchemaRegistry::JsonSchemaMapper::DATE_FIELDS = T.let(T.unsafe(nil), Array) + +# source://resource_registry//lib/schema_registry/json_schema_mapper.rb#7 +class SchemaRegistry::JsonSchemaMapper::UnrecognizedJsonSchemaTypeError < ::StandardError; end + +# source://resource_registry//lib/schema_registry/property.rb#11 +class SchemaRegistry::Property < ::T::Struct + const :name, ::String + const :types, T::Array[::SchemaRegistry::PropertyType] + const :type_name, T.nilable(::String) + const :items, T::Array[::SchemaRegistry::Property], default: T.unsafe(nil) + const :properties, T::Array[::SchemaRegistry::Property], default: T.unsafe(nil) + const :description, T.nilable(::String), default: T.unsafe(nil) + const :resolver, T.nilable(T::Hash[::Symbol, ::String]), default: T.unsafe(nil) + const :resolvable, T::Boolean, default: T.unsafe(nil) + const :deprecated, T::Boolean, default: T.unsafe(nil) + const :deprecated_on, T.nilable(::Date), default: T.unsafe(nil) + const :example, T.nilable(T.any(::BigDecimal, ::Date, ::DateTime, ::Float, ::Integer, ::ResourceRegistry::Versions::Version, ::String, ::Time, Maybe[T.untyped], T::Array[T.untyped], T::Boolean, T::Hash[::String, T.untyped])), default: T.unsafe(nil) + const :enum_values, T.nilable(T::Array[::String]), default: T.unsafe(nil) + const :required, T::Boolean + const :default, T.nilable(T.any(::BigDecimal, ::Date, ::DateTime, ::Float, ::Integer, ::ResourceRegistry::Versions::Version, ::String, ::Time, Maybe[T.untyped], T::Array[T.untyped], T::Boolean, T::Hash[::String, T.untyped])), default: T.unsafe(nil) + const :serialization_groups, T::Set[::Symbol], default: T.unsafe(nil) + + # source://resource_registry//lib/schema_registry/property.rb#51 + sig { returns(T::Boolean) } + def deprecated?; end + + # source://resource_registry//lib/schema_registry/property.rb#70 + sig { returns(T::Boolean) } + def nilable?; end + + # source://resource_registry//lib/schema_registry/property.rb#58 + sig { returns(T::Boolean) } + def null?; end + + # source://resource_registry//lib/schema_registry/property.rb#77 + sig { returns(T::Boolean) } + def required?; end + + # source://resource_registry//lib/schema_registry/property.rb#87 + sig { params(group: ::Symbol).returns(T::Boolean) } + def serialization_group?(group); end + + # source://resource_registry//lib/schema_registry/property.rb#82 + sig { returns(T::Boolean) } + def value_object?; end + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://resource_registry//lib/schema_registry/property.rb#14 +SchemaRegistry::Property::ValueType = T.type_alias { T.nilable(T.any(::BigDecimal, ::Date, ::DateTime, ::Float, ::Integer, ::ResourceRegistry::Versions::Version, ::String, ::Time, Maybe[T.untyped], T::Array[T.untyped], T::Boolean, T::Hash[::String, T.untyped])) } + +# source://resource_registry//lib/schema_registry/property_mapper.rb#4 +class SchemaRegistry::PropertyMapper + # TODO: Proper type json-schema + # + # source://resource_registry//lib/schema_registry/property_mapper.rb#9 + sig { params(schema: ::SchemaRegistry::Schema).void } + def initialize(schema:); end + + # source://resource_registry//lib/schema_registry/property_mapper.rb#14 + sig { returns(T::Hash[::String, T.untyped]) } + def call; end + + private + + # source://resource_registry//lib/schema_registry/property_mapper.rb#28 + sig { returns(::SchemaRegistry::Schema) } + def schema; end + + # source://resource_registry//lib/schema_registry/property_mapper.rb#31 + sig { params(property: ::SchemaRegistry::Property).returns(T.untyped) } + def sorbet_to_json_schema(property); end +end + +# source://resource_registry//lib/schema_registry/property_type.rb#6 +class SchemaRegistry::PropertyType < ::T::Enum + enums do + String = new + Number = new + Integer = new + BigInteger = new + Object = new + Array = new + Boolean = new + Null = new + DateTime = new + Time = new + Date = new + Duration = new + Email = new + Uri = new + Regex = new + File = new + end + + # source://resource_registry//lib/schema_registry/property_type.rb#35 + sig { returns(T.nilable(::String)) } + def sorbet_type; end +end + +# source://resource_registry//lib/schema_registry/registry.rb#4 +class SchemaRegistry::Registry + # source://resource_registry//lib/schema_registry/registry.rb#10 + sig { void } + def initialize; end + + # source://resource_registry//lib/schema_registry/registry.rb#39 + sig { returns(::SchemaRegistry::Registry) } + def cleanup; end + + # source://resource_registry//lib/schema_registry/registry.rb#29 + sig { params(identifier: ::Symbol).returns(T.nilable(::SchemaRegistry::Schema)) } + def fetch(identifier); end + + # @raise [SchemaNotFound] + # + # source://resource_registry//lib/schema_registry/registry.rb#22 + sig { params(identifier: ::Symbol).returns(T.nilable(::SchemaRegistry::Schema)) } + def fetch!(identifier); end + + # source://resource_registry//lib/schema_registry/registry.rb#34 + sig { returns(T::Hash[::Symbol, ::SchemaRegistry::Schema]) } + def fetch_all; end + + # source://resource_registry//lib/schema_registry/registry.rb#15 + sig { params(schema: ::SchemaRegistry::Schema).returns(::SchemaRegistry::Registry) } + def register(schema); end +end + +# source://resource_registry//lib/schema_registry/registry.rb#7 +class SchemaRegistry::Registry::SchemaNotFound < ::StandardError; end + +# source://resource_registry//lib/schema_registry/schema.rb#9 +class SchemaRegistry::Schema < ::T::Struct + const :name, ::String + const :namespace, ::String + const :properties, T::Array[::SchemaRegistry::Property] + const :raw_json_schema, T::Hash[::String, T.untyped], default: T.unsafe(nil) + const :additional_filter_fields, T::Array[::SchemaRegistry::FilterField], default: T.unsafe(nil) + + # source://resource_registry//lib/schema_registry/schema.rb#76 + sig { returns(T::Hash[::Symbol, T.untyped]) } + def dump; end + + # source://resource_registry//lib/schema_registry/schema.rb#44 + sig { params(name: ::String).returns(T.nilable(::SchemaRegistry::FilterField)) } + def find_additional_filter_field(name); end + + # source://resource_registry//lib/schema_registry/schema.rb#39 + sig { params(name: ::String).returns(T.nilable(::SchemaRegistry::Property)) } + def find_property(name); end + + # source://resource_registry//lib/schema_registry/schema.rb#59 + sig { params(name: ::String).returns(T.nilable(T::Hash[::Symbol, ::String])) } + def get_resolver(name); end + + # source://resource_registry//lib/schema_registry/schema.rb#49 + sig { params(name: ::String).returns(T::Boolean) } + def has_property?(name); end + + # source://resource_registry//lib/schema_registry/schema.rb#29 + sig { returns(::Symbol) } + def identifier; end + + # source://resource_registry//lib/schema_registry/schema.rb#54 + sig { returns(::String) } + def namespace_with_slug; end + + # source://resource_registry//lib/schema_registry/schema.rb#19 + sig { returns(::String) } + def schema_module_name; end + + # source://resource_registry//lib/schema_registry/schema.rb#24 + sig { returns(::String) } + def slug; end + + private + + # source://resource_registry//lib/schema_registry/schema.rb#91 + sig { returns(::Dry::Inflector) } + def inflector; end + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + + # source://resource_registry//lib/schema_registry/schema.rb#84 + sig { params(spec: T.untyped).returns(::SchemaRegistry::Schema) } + def load(spec); end + end +end + +# source://resource_registry//lib/schema_registry/schema_loader.rb#4 +class SchemaRegistry::SchemaLoader + # source://resource_registry//lib/schema_registry/schema_loader.rb#8 + sig { params(schema_registry: ::SchemaRegistry::Registry).void } + def initialize(schema_registry:); end + + # source://resource_registry//lib/schema_registry/schema_loader.rb#13 + sig { params(paths: T::Array[[::String, ::String]]).void } + def load(paths); end + + private + + # source://resource_registry//lib/schema_registry/schema_loader.rb#29 + sig { params(namespace: ::String, path: ::String).returns(T::Array[::SchemaRegistry::Schema]) } + def load_path_files(namespace, path); end + + # source://resource_registry//lib/schema_registry/schema_loader.rb#26 + sig { returns(::SchemaRegistry::Registry) } + def schema_registry; end +end diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec-core@3.13.1.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec-core@3.13.1.rbi new file mode 100644 index 0000000..6a840cc --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec-core@3.13.1.rbi @@ -0,0 +1,10887 @@ +# 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`. + + +module ERB::Escape + private + + def html_escape(_arg0); end + + class << self + def html_escape(_arg0); end + end +end + +# Namespace for all core RSpec code. +# +# source://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. + # + # source://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 + # + # source://rspec-core//lib/rspec/core.rb#85 + def configuration; end + + # Setters for shared global objects + # + # @api private + # + # source://rspec-core//lib/rspec/core.rb#49 + def configuration=(_arg0); end + + # Yields the global configuration to a block. + # + # @example + # RSpec.configure do |config| + # config.add_formatter 'documentation' + # end + # @see Core::Configuration + # @yield [Configuration] global configuration + # + # source://rspec-core//lib/rspec/core.rb#97 + def configure; end + + # @private + # + # source://rspec-core//lib/rspec/core.rb#194 + def const_missing(name); end + + # source://rspec-core//lib/rspec/core/dsl.rb#42 + 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 + # + # source://rspec-core//lib/rspec/core.rb#122 + def current_example; end + + # Set the current example being executed. + # + # @api private + # + # source://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] + # + # source://rspec-core//lib/rspec/core.rb#154 + def current_scope; end + + # Set the current scope rspec is executing in + # + # @api private + # + # source://rspec-core//lib/rspec/core.rb#134 + def current_scope=(scope); end + + # source://rspec-core//lib/rspec/core/dsl.rb#42 + def describe(*args, &example_group_block); end + + # source://rspec-core//lib/rspec/core/dsl.rb#42 + def example_group(*args, &example_group_block); end + + # source://rspec-core//lib/rspec/core/dsl.rb#42 + def fcontext(*args, &example_group_block); end + + # source://rspec-core//lib/rspec/core/dsl.rb#42 + 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. + # + # source://rspec-core//lib/rspec/core.rb#58 + def reset; end + + # source://rspec-core//lib/rspec/core/shared_example_group.rb#110 + def shared_context(name, *args, &block); end + + # source://rspec-core//lib/rspec/core/shared_example_group.rb#110 + def shared_examples(name, *args, &block); end + + # source://rspec-core//lib/rspec/core/shared_example_group.rb#110 + def shared_examples_for(name, *args, &block); end + + # Internal container for global non-configuration data. + # + # @private + # + # source://rspec-core//lib/rspec/core.rb#160 + def world; end + + # Setters for shared global objects + # + # @api private + # + # source://rspec-core//lib/rspec/core.rb#49 + def world=(_arg0); end + + # source://rspec-core//lib/rspec/core/dsl.rb#42 + def xcontext(*args, &example_group_block); end + + # source://rspec-core//lib/rspec/core/dsl.rb#42 + def xdescribe(*args, &example_group_block); end + end +end + +# Namespace for the rspec-core code. +# +# source://rspec-core//lib/rspec/core/version.rb#2 +module RSpec::Core + class << self + # @private path to executable file. + # + # source://rspec-core//lib/rspec/core.rb#181 + def path_to_executable; end + end +end + +# Unnamed example group used by `SuiteHookContext`. +# +# @private +# +# source://rspec-core//lib/rspec/core/example_group.rb#775 +class RSpec::Core::AnonymousExampleGroup < ::RSpec::Core::ExampleGroup + class << self + # source://rspec-core//lib/rspec/core/example_group.rb#776 + def metadata; end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/backtrace_formatter.rb#4 +class RSpec::Core::BacktraceFormatter + # @return [BacktraceFormatter] a new instance of BacktraceFormatter + # + # source://rspec-core//lib/rspec/core/backtrace_formatter.rb#8 + def initialize; end + + # source://rspec-core//lib/rspec/core/backtrace_formatter.rb#49 + def backtrace_line(line); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/backtrace_formatter.rb#53 + def exclude?(line); end + + # @private + # + # source://rspec-core//lib/rspec/core/backtrace_formatter.rb#6 + def exclusion_patterns; end + + # @private + # + # source://rspec-core//lib/rspec/core/backtrace_formatter.rb#6 + def exclusion_patterns=(_arg0); end + + # source://rspec-core//lib/rspec/core/backtrace_formatter.rb#28 + def filter_gem(gem_name); end + + # source://rspec-core//lib/rspec/core/backtrace_formatter.rb#33 + def format_backtrace(backtrace, options = T.unsafe(nil)); end + + # Sets the attribute full_backtrace + # + # @param value the value to set the attribute full_backtrace to. + # + # source://rspec-core//lib/rspec/core/backtrace_formatter.rb#22 + def full_backtrace=(_arg0); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/backtrace_formatter.rb#24 + def full_backtrace?; end + + # @private + # + # source://rspec-core//lib/rspec/core/backtrace_formatter.rb#6 + def inclusion_patterns; end + + # @private + # + # source://rspec-core//lib/rspec/core/backtrace_formatter.rb#6 + def inclusion_patterns=(_arg0); end + + private + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/backtrace_formatter.rb#60 + def matches?(patterns, line); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/bisect/utilities.rb#3 +module RSpec::Core::Bisect; end + +# @private +# +# source://rspec-core//lib/rspec/core/bisect/utilities.rb#8 +class RSpec::Core::Bisect::BisectFailedError < ::StandardError + class << self + # source://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 +# +# source://rspec-core//lib/rspec/core/bisect/utilities.rb#36 +class RSpec::Core::Bisect::Channel + # @return [Channel] a new instance of Channel + # + # source://rspec-core//lib/rspec/core/bisect/utilities.rb#41 + def initialize; end + + # source://rspec-core//lib/rspec/core/bisect/utilities.rb#62 + def close; end + + # source://rspec-core//lib/rspec/core/bisect/utilities.rb#56 + def receive; end + + # source://rspec-core//lib/rspec/core/bisect/utilities.rb#50 + def send(message); end +end + +# source://rspec-core//lib/rspec/core/bisect/utilities.rb#38 +RSpec::Core::Bisect::Channel::MARSHAL_DUMP_ENCODING = T.let(T.unsafe(nil), Encoding) + +# @private +# +# source://rspec-core//lib/rspec/core/bisect/utilities.rb#5 +class RSpec::Core::Bisect::ExampleSetDescriptor < ::Struct + # Returns the value of attribute all_example_ids + # + # @return [Object] the current value of all_example_ids + def all_example_ids; end + + # Sets the attribute all_example_ids + # + # @param value [Object] the value to set the attribute all_example_ids to. + # @return [Object] the newly set value + def all_example_ids=(_); end + + # Returns the value of attribute failed_example_ids + # + # @return [Object] the current value of failed_example_ids + def failed_example_ids; end + + # Sets the attribute failed_example_ids + # + # @param value [Object] the value to set the attribute failed_example_ids to. + # @return [Object] the newly set value + def failed_example_ids=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + 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 +# +# source://rspec-core//lib/rspec/core/bisect/utilities.rb#19 +class RSpec::Core::Bisect::Notifier + # @return [Notifier] a new instance of Notifier + # + # source://rspec-core//lib/rspec/core/bisect/utilities.rb#20 + def initialize(formatter); end + + # source://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 +# +# source://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 + # + # @return [Configuration] a new instance of Configuration + # + # source://rspec-core//lib/rspec/core/configuration.rb#528 + def initialize; end + + # Adds a formatter to the set RSpec will use for this run. + # + # @overload add_formatter + # @overload add_formatter + # @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. + # @see RSpec::Core::Formatters::Protocol + # + # source://rspec-core//lib/rspec/core/configuration.rb#996 + def add_formatter(formatter, output = T.unsafe(nil)); end + + # 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. + # + # @option opts + # @option opts + # @overload add_setting + # @overload add_setting + # @param opts [Hash] a customizable set of options + # + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#2026 + 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= + # + # source://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`: + # + # @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 + # @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. + # @param name [String] example name alias + # @param args [Array, Hash] metadata for the generated example + # + # source://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. + # + # source://rspec-core//lib/rspec/core/configuration.rb#1240 + def alias_it_behaves_like_to(new_name, report_label = T.unsafe(nil)); 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. + # + # source://rspec-core//lib/rspec/core/configuration.rb#1240 + 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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#2056 + def append_after(scope = T.unsafe(nil), *meta, &block); 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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#1971 + def append_before(scope = T.unsafe(nil), *meta, &block); end + + # @private + # @raise [SystemStackError] + # + # source://rspec-core//lib/rspec/core/configuration.rb#1936 + def apply_derived_metadata_to(metadata); end + + # Registers `block` as an `around` hook. + # + # See {Hooks#around} for full `around` hook docs. + # + # source://rspec-core//lib/rspec/core/configuration.rb#2074 + 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] + # + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#703 + def backtrace_exclusion_patterns=(patterns); end + + # @private + # + # source://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] + # + # source://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 + # + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#1971 + 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] + # + # source://rspec-core//lib/rspec/core/configuration.rb#499 + def bisect_runner; end + + # source://rspec-core//lib/rspec/core/configuration.rb#500 + def bisect_runner=(value); end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#2120 + 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. + # @return [Boolean] + # @see color_mode + # @see color_enabled? + # + # source://rspec-core//lib/rspec/core/configuration.rb#922 + def color; end + + # 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. + # + # source://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] + # + # source://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 + # + # @return [Boolean] + # @see color_enabled? + # + # source://rspec-core//lib/rspec/core/configuration.rb#935 + def color_mode; end + + # Set the color mode. + # + # source://rspec-core//lib/rspec/core/configuration.rb#953 + def color_mode=(_arg0); end + + # Used internally to extend the singleton class of a single example's + # example group instance with modules using `include` and/or `extend`. + # + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#1577 + def configure_example(example, example_hooks); end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#1617 + def configure_expectation_framework; end + + # Used internally to extend a group with modules using `include`, `prepend` and/or + # `extend`. + # + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#1565 + def configure_group(group); end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#1611 + def configure_mock_framework; end + + # The default output color. Defaults to `:white` but can be set to one of + # the following: `[:black, :white, :red, :green, :yellow, :blue, + # :magenta, :cyan]` + # + # @return [Symbol] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def default_color; end + + # The default output color. Defaults to `:white` but can be set to one of + # the following: `[:black, :white, :red, :green, :yellow, :blue, + # :magenta, :cyan]` + # + # @return [Symbol] + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def default_color=(_arg0); end + + # source://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'. + # + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#1014 + def default_formatter=(value); end + + # Path to use if no path is provided to the `rspec` command (default: + # `"spec"`). Allows you to just type `rspec` instead of `rspec spec` to + # run all the examples in the `spec` directory. + # + # @note Other scripts invoking `rspec` indirectly will ignore this + # setting. + # @return [String] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def default_path; end + + # Path to use if no path is provided to the `rspec` command (default: + # `"spec"`). Allows you to just type `rspec` instead of `rspec spec` to + # run all the examples in the `spec` directory. + # + # @note Other scripts invoking `rspec` indirectly will ignore this + # setting. + # @return [String] + # + # source://rspec-core//lib/rspec/core/configuration.rb#121 + def default_path=(path); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def default_path?; end + + # Defines a callback that can assign derived metadata values. + # + # @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 + # @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. + # + # source://rspec-core//lib/rspec/core/configuration.rb#1895 + def define_derived_metadata(*filters, &block); end + + # Determines where deprecation warnings are printed. + # Defaults to `$stderr`. + # + # @return [IO, String] IO or filename to write to + # + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#168 + def deprecation_stream=(value); end + + # Color used to print details. Defaults to `:cyan` but can be set to one + # of the following: `[:black, :white, :red, :green, :yellow, :blue, + # :magenta, :cyan]` + # + # @return [Symbol] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def detail_color; end + + # Color used to print details. Defaults to `:cyan` but can be set to one + # of the following: `[:black, :white, :red, :green, :yellow, :blue, + # :magenta, :cyan]` + # + # @return [Symbol] + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def detail_color=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def detail_color?; end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#1876 + 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. + # + # @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 + # @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. + # + # source://rspec-core//lib/rspec/core/configuration.rb#1868 + def disable_monkey_patching!; end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#1876 + def disable_monkey_patching=(_arg0); end + + # Run examples over DRb (default: `false`). RSpec doesn't supply the DRb + # server, but you can use tools like spork. + # + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def drb; end + + # Run examples over DRb (default: `false`). RSpec doesn't supply the DRb + # server, but you can use tools like spork. + # + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def drb=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def drb?; end + + # The drb_port (default: nil). + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def drb_port; end + + # The drb_port (default: nil). + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def drb_port=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def drb_port?; end + + # Prints the formatter output of your suite without running any + # examples or hooks. + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def dry_run; end + + # Prints the formatter output of your suite without running any + # examples or hooks. + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def dry_run=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def dry_run?; end + + # The exit code to return if there are any errors outside examples (default: failure_exit_code) + # + # @return [Integer] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def error_exit_code; end + + # The exit code to return if there are any errors outside examples (default: failure_exit_code) + # + # @return [Integer] + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def error_exit_code=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def error_exit_code?; end + + # Default: `$stderr`. + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def error_stream; end + + # Default: `$stderr`. + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def error_stream=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def error_stream?; end + + # The file path to use for persisting example statuses. Necessary for the + # `--only-failures` and `--next-failure` CLI options. + # + # @overload example_status_persistence_file_path + # @overload example_status_persistence_file_path= + # + # source://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. + # + # source://rspec-core//lib/rspec/core/configuration.rb#192 + def example_status_persistence_file_path=(value); end + + # Exclude files matching this pattern. + # + # @return [String] + # + # source://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 + # + # source://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. + # + # source://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. + # + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#858 + def expect_with(*frameworks); end + + # Delegates to expect_with(framework). + # + # source://rspec-core//lib/rspec/core/configuration.rb#831 + def expectation_framework=(framework); end + + # Returns the configured expectation framework adapter module(s) + # + # source://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. + # + # @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 + # @param method_name [Symbol] the name of the helper method + # + # source://rspec-core//lib/rspec/core/configuration.rb#1806 + 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 + # + # source://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] + # + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#1515 + def extend(mod, *filters); end + + # If specified, indicates the number of failures required before cleaning + # up and exit (default: `nil`). Can also be `true` to fail and exit on first + # failure + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def fail_fast; end + + # @see fail_fast + # + # source://rspec-core//lib/rspec/core/configuration.rb#214 + def fail_fast=(value); end + + # Whether or not to fail when there are no RSpec examples (default: false). + # + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def fail_if_no_examples; end + + # Whether or not to fail when there are no RSpec examples (default: false). + # + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def fail_if_no_examples=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def fail_if_no_examples?; end + + # Color to use to indicate failure. Defaults to `:red` but can be set to + # one of the following: `[:black, :white, :red, :green, :yellow, :blue, + # :magenta, :cyan]` + # + # @return [Symbol] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def failure_color; end + + # Color to use to indicate failure. Defaults to `:red` but can be set to + # one of the following: `[:black, :white, :red, :green, :yellow, :blue, + # :magenta, :cyan]` + # + # @return [Symbol] + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def failure_color=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def failure_color?; end + + # The exit code to return if there are any failures (default: 1). + # + # @return [Integer] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def failure_exit_code; end + + # The exit code to return if there are any failures (default: 1). + # + # @return [Integer] + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def failure_exit_code=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def failure_exit_code?; end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#1083 + def files_or_directories_to_run=(*files); end + + # The spec files RSpec will run. + # + # @return [Array] specified files about to run + # + # source://rspec-core//lib/rspec/core/configuration.rb#1096 + def files_to_run; end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#516 + def files_to_run=(_arg0); end + + # Returns the `inclusion_filter`. If none has been set, returns an empty + # hash. + # + # source://rspec-core//lib/rspec/core/configuration.rb#1313 + def 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. + # + # source://rspec-core//lib/rspec/core/configuration.rb#1304 + def filter=(filter); end + + # Adds {#backtrace_exclusion_patterns} that will filter lines from + # the named gems from backtraces. + # + # @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. + # @param gem_names [Array] Names of the gems to filter + # + # source://rspec-core//lib/rspec/core/configuration.rb#742 + def filter_gems_from_backtrace(*gem_names); end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#518 + def filter_manager; end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#518 + def filter_manager=(_arg0); 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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#1275 + 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 + # + # source://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 + # + # source://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. + # + # source://rspec-core//lib/rspec/core/configuration.rb#1291 + def filter_run_when_matching(*args); end + + # Color used when a pending example is fixed. Defaults to `:blue` but can + # be set to one of the following: `[:black, :white, :red, :green, + # :yellow, :blue, :magenta, :cyan]` + # + # @return [Symbol] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def fixed_color; end + + # Color used when a pending example is fixed. Defaults to `:blue` but can + # be set to one of the following: `[:black, :white, :red, :green, + # :yellow, :blue, :magenta, :cyan]` + # + # @return [Symbol] + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def fixed_color=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def fixed_color?; end + + # Used to set higher priority option values from the command line. + # + # @private + # + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#1656 + def format_docstrings(&block); end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#1661 + def format_docstrings_block; end + + # Adds a formatter to the set RSpec will use for this run. + # + # @overload add_formatter + # @overload add_formatter + # @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. + # @see RSpec::Core::Formatters::Protocol + # + # source://rspec-core//lib/rspec/core/configuration.rb#996 + def formatter=(formatter, output = T.unsafe(nil)); end + + # @private + # + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#1024 + def formatters; end + + # Toggle full backtrace. + # + # @attr true_or_false [Boolean] toggle full backtrace display + # + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#902 + def full_backtrace?; end + + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def full_cause_backtrace; end + + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def full_cause_backtrace=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def full_cause_backtrace?; end + + # @return [Array] full description filter + # + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#972 + def full_description=(description); end + + # Holds the various registered hooks. Here we use a FilterableItemRepository + # implementation that is specifically optimized for the read/write patterns + # of the config object. + # + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#2104 + def hooks; end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#1602 + 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) + # 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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#1425 + 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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#1472 + def include_context(shared_group_name, *filters); end + + # Returns the `inclusion_filter`. If none has been set, returns an empty + # hash. + # + # source://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. + # + # source://rspec-core//lib/rspec/core/configuration.rb#1304 + def inclusion_filter=(filter); end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#1101 + def last_run_statuses; end + + # Returns dirs that have been prepended to the load path by the `-I` + # command line option. + # + # @return [Array] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def libs; end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#963 + def libs=(libs); end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#1625 + def load_spec_files; end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#522 + def loaded_spec_files; end + + # Maximum count of failed source lines to display in the failure reports + # (defaults to `10`). + # return [Integer] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def max_displayed_failure_line_count; end + + # Maximum count of failed source lines to display in the failure reports + # (defaults to `10`). + # return [Integer] + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def max_displayed_failure_line_count=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def max_displayed_failure_line_count?; end + + # Returns the configured mock framework adapter module. + # + # @return [Symbol] + # + # source://rspec-core//lib/rspec/core/configuration.rb#669 + def mock_framework; end + + # Delegates to mock_framework=(framework). + # + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#786 + def mock_with(framework); end + + # Invokes block before defining an example group + # + # source://rspec-core//lib/rspec/core/configuration.rb#2109 + def on_example_group_definition(&block); end + + # Returns an array of blocks to call before defining an example group + # + # @api private + # + # source://rspec-core//lib/rspec/core/configuration.rb#2115 + def on_example_group_definition_callbacks; end + + # Indicates if the `--only-failures` (or `--next-failure`) flag is being used. + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def only_failures; end + + # Indicates if the `--only-failures` (or `--next-failure`) flag is being used. + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def only_failures?; end + + # @private + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/configuration.rb#203 + def only_failures_but_not_configured?; end + + # Sets the default global ordering strategy. By default this can be one + # of `:defined`, `:random`, but is customizable through the + # `register_ordering` API. If order is set to `'rand:'`, + # the seed will also be set. + # + # @see #register_ordering + # + # source://rspec-core//lib/rspec/core/configuration.rb#1668 + def order=(*args, &block); end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#522 + def ordering_manager; end + + # source://rspec-core//lib/rspec/core/configuration.rb#1668 + def ordering_registry(*args, &block); end + + # Determines where RSpec will send its output. + # Default: `$stdout`. + # + # @return [IO, String] + # + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#274 + def output_stream=(value); end + + # Load files matching this pattern (default: `'**{,/*/**}/*_spec.rb'`). + # + # @return [String] + # + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#293 + def pattern=(value); end + + # Color to use to print pending examples. Defaults to `:yellow` but can + # be set to one of the following: `[:black, :white, :red, :green, + # :yellow, :blue, :magenta, :cyan]` + # + # @return [Symbol] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def pending_color; end + + # Color to use to print pending examples. Defaults to `:yellow` but can + # be set to one of the following: `[:black, :white, :red, :green, + # :yellow, :blue, :magenta, :cyan]` + # + # @return [Symbol] + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def pending_color=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def pending_color?; end + + # Format the output for pending examples. Can be set to: + # - :full (default) - pending examples appear similarly to failures + # - :no_backtrace - same as above, but with no backtrace + # - :skip - do not show the section at all + # return [Symbol] + # + # @raise [ArgumentError] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def pending_failure_output; end + + # Format the output for pending examples. Can be set to: + # - :full (default) - pending examples appear similarly to failures + # - :no_backtrace - same as above, but with no backtrace + # - :skip - do not show the section at all + # return [Symbol] + # + # @raise [ArgumentError] + # + # source://rspec-core//lib/rspec/core/configuration.rb#473 + def pending_failure_output=(mode); end + + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#1554 + def prepend(mod, *filters); 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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#2026 + 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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#2001 + def prepend_before(scope = T.unsafe(nil), *meta, &block); end + + # Defaults `profile_examples` to 10 examples when `@profile_examples` is + # `true`. + # + # @api private + # + # source://rspec-core//lib/rspec/core/configuration.rb#1073 + def profile_examples; end + + # Report the times for the slowest examples (default: `false`). + # Use this to specify the number of examples to include in the profile. + # + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/configuration.rb#322 + def profile_examples=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def profile_examples?; end + + # Specifies which directories contain the source code for your project. + # When a failure occurs, RSpec looks through the backtrace to find a + # a line of source to print. It first looks for a line coming from + # one of the project source directories so that, for example, it prints + # the expectation or assertion call rather than the source code from + # the expectation or assertion framework. + # + # @return [Array] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def project_source_dirs; end + + # Specifies which directories contain the source code for your project. + # When a failure occurs, RSpec looks through the backtrace to find a + # a line of source to print. It first looks for a line coming from + # one of the project source directories so that, for example, it prints + # the expectation or assertion call rather than the source code from + # the expectation or assertion framework. + # + # @return [Array] + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def project_source_dirs=(_arg0); end + + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#1828 + 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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#1776 + def raise_on_warning=(value); end + + # Registers a named ordering strategy that can later be + # used to order an example group's subgroups by adding + # `:order => ` metadata to the example group. + # + # @example + # RSpec.configure do |rspec| + # rspec.register_ordering :reverse do |list| + # list.reverse + # end + # end + # + # RSpec.describe 'MyClass', :order => :reverse do + # # ... + # end + # @example + # RSpec.configure do |rspec| + # rspec.register_ordering :global do |examples| + # acceptance, other = examples.partition do |example| + # example.metadata[:type] == :acceptance + # end + # other + acceptance + # end + # end + # + # RSpec.describe 'MyClass', :type => :acceptance do + # # will run last + # end + # + # RSpec.describe 'MyClass' do + # # will run first + # end + # @note Pass the symbol `:global` to set the ordering strategy that + # will be used to order the top-level example groups and any example + # groups that do not have declared `:order` metadata. + # @param name [Symbol] The name of the ordering. + # @yield Block that will order the given examples or example groups + # @yieldparam list [Array, Array] The examples or groups to order + # @yieldreturn [Array, Array] The re-ordered examples or groups + # + # source://rspec-core//lib/rspec/core/configuration.rb#1668 + def register_ordering(*args, &block); end + + # @return [RSpec::Core::Reporter] the currently configured reporter + # + # source://rspec-core//lib/rspec/core/configuration.rb#1056 + def reporter; end + + # Indicates files configured to be required. + # + # @return [Array] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def requires; end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#1594 + def requires=(paths); end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#601 + def reset; end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#614 + def reset_filters; end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#607 + def reset_reporter; end + + # Run all examples if none match the configured filters + # (default: `false`). + # + # @deprecated Use {#filter_run_when_matching} instead for the specific + # filters that you want to be ignored if none match. + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def run_all_when_everything_filtered; end + + # Run all examples if none match the configured filters + # (default: `false`). + # + # @deprecated Use {#filter_run_when_matching} instead for the specific + # filters that you want to be ignored if none match. + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def run_all_when_everything_filtered=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def run_all_when_everything_filtered?; end + + # Seed for random ordering (default: generated randomly each run). + # + # When you run specs with `--order random`, RSpec generates a random seed + # for the randomization and prints it to the `output_stream` (assuming + # you're using RSpec's built-in formatters). If you discover an ordering + # dependency (i.e. examples fail intermittently depending on order), set + # this (on Configuration or on the command line with `--seed`) to run + # using the same seed while you debug the issue. + # + # We recommend, actually, that you use the command line approach so you + # don't accidentally leave the seed encoded. + # + # source://rspec-core//lib/rspec/core/configuration.rb#1668 + def seed(*args, &block); end + + # Sets the seed value and sets the default global ordering to random. + # + # source://rspec-core//lib/rspec/core/configuration.rb#1668 + def seed=(*args, &block); end + + # source://rspec-core//lib/rspec/core/configuration.rb#1668 + def seed_used?(*args, &block); end + + # Configures how RSpec treats metadata passed as part of a shared example + # group definition. For example, given this shared example group definition: + # + # RSpec.shared_context "uses DB", :db => true do + # around(:example) do |ex| + # MyORM.transaction(:rollback => true, &ex) + # end + # end + # + # ...there are two ways RSpec can treat the `:db => true` metadata, each + # of which has a corresponding config option: + # + # 1. `:trigger_inclusion`: this shared context will be implicitly included + # in any groups (or examples) that have `:db => true` metadata. + # 2. `:apply_to_host_groups`: the metadata will be inherited by the metadata + # hash of all host groups and examples. + # + # `:trigger_inclusion` is the legacy behavior from before RSpec 3.5 but should + # be considered deprecated. Instead, you can explicitly include a group with + # `include_context`: + # + # RSpec.describe "My model" do + # include_context "uses DB" + # end + # + # ...or you can configure RSpec to include the context based on matching metadata + # using an API that mirrors configured module inclusion: + # + # RSpec.configure do |rspec| + # rspec.include_context "uses DB", :db => true + # end + # + # `:apply_to_host_groups` is a new feature of RSpec 3.5 and will be the only + # supported behavior in RSpec 4. + # + # @overload shared_context_metadata_behavior + # @overload shared_context_metadata_behavior= + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def shared_context_metadata_behavior; end + + # @see shared_context_metadata_behavior + # + # source://rspec-core//lib/rspec/core/configuration.rb#434 + def shared_context_metadata_behavior=(value); end + + # Don't print filter info i.e. "Run options: include {:focus=>true}" + # (default `false`). + # return [Boolean] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def silence_filter_announcements; end + + # Don't print filter info i.e. "Run options: include {:focus=>true}" + # (default `false`). + # return [Boolean] + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def silence_filter_announcements=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def silence_filter_announcements?; end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#1138 + def spec_files_with_failures; end + + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def start_time; end + + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def start_time=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def start_time?; end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#520 + def static_config_filter_manager; end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#520 + def static_config_filter_manager=(_arg0); end + + # Color to use to indicate success. Defaults to `:green` but can be set + # to one of the following: `[:black, :white, :red, :green, :yellow, + # :blue, :magenta, :cyan]` + # + # @return [Symbol] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def success_color; end + + # Color to use to indicate success. Defaults to `:green` but can be set + # to one of the following: `[:black, :white, :red, :green, :yellow, + # :blue, :magenta, :cyan]` + # + # @return [Symbol] + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def success_color=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def success_color?; end + + # Use threadsafe options where available. + # Currently this will place a mutex around memoized values such as let blocks. + # return [Boolean] + # + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def threadsafe; end + + # Use threadsafe options where available. + # Currently this will place a mutex around memoized values such as let blocks. + # return [Boolean] + # + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def threadsafe=(_arg0); end + + # source://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. + # + # source://rspec-core//lib/rspec/core/configuration.rb#383 + def treat_symbols_as_metadata_keys_with_true_values=(_value); end + + # source://rspec-core//lib/rspec/core/configuration.rb#66 + def tty; end + + # source://rspec-core//lib/rspec/core/configuration.rb#89 + def tty=(_arg0); end + + # source://rspec-core//lib/rspec/core/configuration.rb#78 + def tty?; end + + # Set Ruby warnings on or off. + # + # source://rspec-core//lib/rspec/core/configuration.rb#1755 + def warnings=(value); end + + # @return [Boolean] Whether or not ruby warnings are enabled. + # + # source://rspec-core//lib/rspec/core/configuration.rb#1760 + 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 + # + # source://rspec-core//lib/rspec/core/configuration.rb#1918 + def when_first_matching_example_defined(*filters); end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#2086 + def with_suite_hooks; end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#518 + def world; end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#518 + def world=(_arg0); end + + private + + # :nocov: + # + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/configuration.rb#2249 + def absolute_pattern?(pattern); end + + # source://rspec-core//lib/rspec/core/configuration.rb#2350 + def add_hook_to_existing_matching_groups(meta, scope, &block); end + + # @raise [MustBeConfiguredBeforeExampleGroupsError] + # + # source://rspec-core//lib/rspec/core/configuration.rb#2289 + def assert_no_example_groups_defined(config_option); end + + # source://rspec-core//lib/rspec/core/configuration.rb#2339 + def clear_values_derived_from_example_status_persistence_file_path; end + + # source://rspec-core//lib/rspec/core/configuration.rb#2271 + def command; end + + # source://rspec-core//lib/rspec/core/configuration.rb#2315 + def conditionally_disable_expectations_monkey_patching; end + + # source://rspec-core//lib/rspec/core/configuration.rb#2306 + def conditionally_disable_mocks_monkey_patching; end + + # source://rspec-core//lib/rspec/core/configuration.rb#2344 + def configure_group_with(group, module_list, application_method); end + + # source://rspec-core//lib/rspec/core/configuration.rb#2279 + def define_built_in_hooks; end + + # source://rspec-core//lib/rspec/core/configuration.rb#2402 + def define_mixed_in_module(mod, filters, mod_list, config_method, &block); end + + # source://rspec-core//lib/rspec/core/configuration.rb#2254 + def extract_location(path); end + + # source://rspec-core//lib/rspec/core/configuration.rb#2231 + def file_glob_from(path, pattern); end + + # source://rspec-core//lib/rspec/core/configuration.rb#2220 + def gather_directories(path); end + + # source://rspec-core//lib/rspec/core/configuration.rb#2199 + def get_files_to_run(paths); end + + # source://rspec-core//lib/rspec/core/configuration.rb#2226 + def get_matching_files(path, pattern); end + + # source://rspec-core//lib/rspec/core/configuration.rb#2166 + def handle_suite_hook(scope, meta); end + + # source://rspec-core//lib/rspec/core/configuration.rb#2138 + def load_file_handling_errors(method, file); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/configuration.rb#2372 + def metadata_applies_to_group?(meta, group); end + + # source://rspec-core//lib/rspec/core/configuration.rb#2364 + def on_existing_matching_groups(meta); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/configuration.rb#2302 + def output_to_tty?(output = T.unsafe(nil)); end + + # source://rspec-core//lib/rspec/core/configuration.rb#2298 + def output_wrapper; end + + # source://rspec-core//lib/rspec/core/configuration.rb#2211 + def paths_to_check(paths); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/configuration.rb#2216 + def pattern_might_load_specs_from_vendored_dirs?; end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/configuration.rb#2325 + def rspec_expectations_loaded?; end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/configuration.rb#2321 + def rspec_mocks_loaded?; end + + # source://rspec-core//lib/rspec/core/configuration.rb#2181 + def run_suite_hooks(hook_description, hooks); end + + # source://rspec-core//lib/rspec/core/configuration.rb#2387 + def safe_extend(mod, host); end + + # :nocov: + # + # source://rspec-core//lib/rspec/core/configuration.rb#2383 + def safe_include(mod, host); end + + # source://rspec-core//lib/rspec/core/configuration.rb#2377 + def safe_prepend(mod, host); end + + # source://rspec-core//lib/rspec/core/configuration.rb#2329 + def update_pattern_attr(name, value); end + + # source://rspec-core//lib/rspec/core/configuration.rb#2275 + def value_for(key); end + + class << self + # As `add_setting` but only add the reader. + # + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#100 + def add_read_only_setting(name, opts = T.unsafe(nil)); end + + # Invoked by the `add_setting` instance method. Use that method on a + # `Configuration` instance rather than this class method. + # + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#87 + def add_setting(name, opts = T.unsafe(nil)); end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#70 + def define_alias(name, alias_name); end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#77 + def define_predicate(name); end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#60 + def define_reader(name); end + + # @private + # + # source://rspec-core//lib/rspec/core/configuration.rb#1666 + def delegate_to_ordering_manager(*methods); end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/configuration.rb#1646 +RSpec::Core::Configuration::DEFAULT_FORMATTER = T.let(T.unsafe(nil), Proc) + +# 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. +# +# @private +# +# source://rspec-core//lib/rspec/core/configuration.rb#1039 +class RSpec::Core::Configuration::DeprecationReporterBuffer + # @return [DeprecationReporterBuffer] a new instance of DeprecationReporterBuffer + # + # source://rspec-core//lib/rspec/core/configuration.rb#1040 + def initialize; end + + # source://rspec-core//lib/rspec/core/configuration.rb#1044 + def deprecation(*args); end + + # source://rspec-core//lib/rspec/core/configuration.rb#1048 + def play_onto(reporter); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/configuration.rb#1816 +module RSpec::Core::Configuration::ExposeCurrentExample; end + +# @private +# +# source://rspec-core//lib/rspec/core/configuration.rb#1126 +RSpec::Core::Configuration::FAILED_STATUS = T.let(T.unsafe(nil), String) + +# @private +# +# source://rspec-core//lib/rspec/core/configuration.rb#749 +RSpec::Core::Configuration::MOCKING_ADAPTERS = T.let(T.unsafe(nil), Hash) + +# @private +# +# source://rspec-core//lib/rspec/core/configuration.rb#57 +class RSpec::Core::Configuration::MustBeConfiguredBeforeExampleGroupsError < ::StandardError; end + +# @private +# +# source://rspec-core//lib/rspec/core/configuration.rb#1129 +RSpec::Core::Configuration::PASSED_STATUS = T.let(T.unsafe(nil), String) + +# @private +# +# source://rspec-core//lib/rspec/core/configuration.rb#1132 +RSpec::Core::Configuration::PENDING_STATUS = T.let(T.unsafe(nil), String) + +# @private +# +# source://rspec-core//lib/rspec/core/configuration.rb#1765 +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 +# +# source://rspec-core//lib/rspec/core/configuration.rb#53 +module RSpec::Core::Configuration::Readers + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def default_color; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def default_path; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def deprecation_stream; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def detail_color; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def drb; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def drb_port; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def dry_run; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def error_exit_code; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def error_stream; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def example_status_persistence_file_path; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def exclude_pattern; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def fail_fast; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def fail_if_no_examples; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def failure_color; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def failure_exit_code; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def fixed_color; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def full_cause_backtrace; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def libs; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def max_displayed_failure_line_count; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def only_failures; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def output_stream; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def pattern; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def pending_color; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def pending_failure_output; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def project_source_dirs; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def requires; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def run_all_when_everything_filtered; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def shared_context_metadata_behavior; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def silence_filter_announcements; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def start_time; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def success_color; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def threadsafe; end + + # source://rspec-core//lib/rspec/core/configuration.rb#63 + def tty; end +end + +# @private +# +# source://rspec-core//lib/rspec/core/configuration.rb#1123 +RSpec::Core::Configuration::UNKNOWN_STATUS = T.let(T.unsafe(nil), String) + +# @private +# +# source://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. +# +# source://rspec-core//lib/rspec/core/configuration_options.rb#10 +class RSpec::Core::ConfigurationOptions + # @param args [Array] command line arguments + # @return [ConfigurationOptions] a new instance of ConfigurationOptions + # + # source://rspec-core//lib/rspec/core/configuration_options.rb#12 + def initialize(args); end + + # @return [Array] the original command-line arguments + # + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration_options.rb#21 + def configure(config); end + + # Updates the provided {FilterManager} based on the filter options. + # + # @api private + # @param filter_manager [FilterManager] instance to update + # + # source://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 + # + # source://rspec-core//lib/rspec/core/configuration_options.rb#37 + def options; end + + private + + # source://rspec-core//lib/rspec/core/configuration_options.rb#173 + def args_from_options_file(path); end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#142 + def command_line_options; end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#146 + def custom_options; end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#188 + def custom_options_file; end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#133 + def env_options; end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#125 + def file_options; end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/configuration_options.rb#66 + def force?(key); end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#158 + def global_options; end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#200 + def global_options_file; end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#211 + def home_options_file_path; end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#121 + def load_formatters_into(config); end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#150 + def local_options; end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#196 + def local_options_file; end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#180 + def options_file_as_erb_string(path); end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#162 + def options_from(path); end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#70 + def order(keys); end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#44 + def organize_options; end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#167 + def parse_args_ignoring_files_or_dirs_to_run(args, source); end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#113 + def process_options_into(config); end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#154 + def project_options; end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#192 + def project_options_file; end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#227 + def resolve_xdg_config_home; end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#204 + def xdg_options_file_if_exists; end + + # source://rspec-core//lib/rspec/core/configuration_options.rb#220 + def xdg_options_file_path; end +end + +# source://rspec-core//lib/rspec/core/configuration_options.rb#77 +RSpec::Core::ConfigurationOptions::OPTIONS_ORDER = T.let(T.unsafe(nil), Array) + +# source://rspec-core//lib/rspec/core/configuration_options.rb#59 +RSpec::Core::ConfigurationOptions::UNFORCED_OPTIONS = T.let(T.unsafe(nil), RSpec::Core::Set) + +# source://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 +# +# source://rspec-core//lib/rspec/core/dsl.rb#25 +module RSpec::Core::DSL + class << self + # @private + # + # source://rspec-core//lib/rspec/core/dsl.rb#89 + def change_global_dsl(&changes); end + + # @private + # + # source://rspec-core//lib/rspec/core/dsl.rb#27 + def example_group_aliases; end + + # @private + # + # source://rspec-core//lib/rspec/core/dsl.rb#37 + def expose_example_group_alias(name); end + + # @private + # + # source://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 + # + # source://rspec-core//lib/rspec/core/dsl.rb#58 + def expose_globally!; end + + # @private + # @return [Boolean] + # + # source://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 + # + # source://rspec-core//lib/rspec/core/dsl.rb#70 + def remove_globally!; end + + # @private + # + # source://rspec-core//lib/rspec/core/dsl.rb#53 + def top_level; end + + # @private + # + # source://rspec-core//lib/rspec/core/dsl.rb#53 + def top_level=(_arg0); end + end +end + +# Deprecation Error. +# +# source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#221 +class RSpec::Core::DeprecationError < ::StandardError; end + +# Wrapper around Ruby's `DidYouMean::SpellChecker` when available to provide file name suggestions. +# +# @private +# +# source://rspec-core//lib/rspec/core/did_you_mean.rb#5 +class RSpec::Core::DidYouMean + # @return [DidYouMean] a new instance of DidYouMean + # + # source://rspec-core//lib/rspec/core/did_you_mean.rb#8 + def initialize(relative_file_name); end + + # return a hint if API for ::DidYouMean::SpellChecker not supported + # + # source://rspec-core//lib/rspec/core/did_you_mean.rb#14 + def call; end + + # Returns the value of attribute relative_file_name. + # + # source://rspec-core//lib/rspec/core/did_you_mean.rb#6 + def relative_file_name; end + + private + + # source://rspec-core//lib/rspec/core/did_you_mean.rb#30 + def formats(probables); end + + # source://rspec-core//lib/rspec/core/did_you_mean.rb#40 + def red_font(mytext); end + + # source://rspec-core//lib/rspec/core/did_you_mean.rb#35 + 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 +# @note Example blocks are evaluated in the context of an instance +# of an `ExampleGroup`, not in the context of an instance of `Example`. +# @see ExampleGroup +# +# source://rspec-core//lib/rspec/core/example.rb#44 +class RSpec::Core::Example + # Creates a new instance of Example. + # + # @api private + # @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 + # @return [Example] a new instance of Example + # + # source://rspec-core//lib/rspec/core/example.rb#186 + def initialize(example_group_class, description, user_metadata, example_block = T.unsafe(nil)); end + + # @attr + # @private + # + # source://rspec-core//lib/rspec/core/example.rb#174 + def clock; end + + # @attr + # @private + # + # source://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. + # + # source://rspec-core//lib/rspec/core/example.rb#76 + def description; end + + # The exception that will be displayed to the user -- either the failure of + # the example or the `pending_exception` if the example is pending. + # + # @private + # + # source://rspec-core//lib/rspec/core/example.rb#388 + def display_exception; end + + # 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. + # + # @private + # + # source://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 + # + # source://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. + # + # source://rspec-core//lib/rspec/core/example.rb#230 + def example_group; end + + # Returns the example_group_instance that provides the context for + # running this example. + # + # @attr_reader + # @private + # + # source://rspec-core//lib/rspec/core/example.rb#170 + def example_group_instance; end + + # Returns the first exception raised in the context of running this + # example (nil if no exception is raised). + # + # @attr_reader + # + # source://rspec-core//lib/rspec/core/example.rb#158 + def exception; end + + # @return [ExecutionResult] represents the result of running this example. + # + # source://rspec-core//lib/rspec/core/example.rb#49 + def execution_result; end + + # Used internally to set an exception and fail without actually executing + # the example when an exception is raised in before(:context). + # + # @private + # + # source://rspec-core//lib/rspec/core/example.rb#439 + def fail_with_exception(reporter, exception); end + + # @return [String] the relative path to the file where this example was + # defined. + # + # source://rspec-core//lib/rspec/core/example.rb#49 + def file_path; end + + # @return [String] the full description (including the docstrings of + # all parent example groups). + # + # source://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. + # + # source://rspec-core//lib/rspec/core/example.rb#117 + def id; end + + # Provide a human-readable representation of this class + # + # source://rspec-core//lib/rspec/core/example.rb#220 + def inspect; end + + # Returns a description of the example that always includes the location. + # + # source://rspec-core//lib/rspec/core/example.rb#87 + def inspect_output; end + + # @private + # + # source://rspec-core//lib/rspec/core/example.rb#456 + def instance_exec(*args, &block); end + + # @return [String] the exact source location of this example in a form + # like `./path/to/spec.rb:17` + # + # source://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. + # + # source://rspec-core//lib/rspec/core/example.rb#96 + def location_rerun_argument; end + + # Returns the metadata object associated with this example. + # + # @attr_reader + # + # source://rspec-core//lib/rspec/core/example.rb#163 + def metadata; end + + # @return [Boolean] flag that indicates that the example is not expected + # to pass. It will be run and will either have a pending result (if a + # failure occurs) or a failed result (if no failure occurs). + # + # source://rspec-core//lib/rspec/core/example.rb#49 + def pending; end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/example.rb#234 + def pending?; end + + # @return [RSpec::Core::Reporter] the current reporter for the example + # + # source://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!). + # + # source://rspec-core//lib/rspec/core/example.rb#111 + def rerun_argument; end + + # instance_execs the block passed to the constructor in the context of + # the instance of {ExampleGroup}. + # + # @api private + # @param example_group_instance the instance of an ExampleGroup subclass + # + # source://rspec-core//lib/rspec/core/example.rb#246 + def run(example_group_instance, reporter); end + + # Used to set the exception when `aggregate_failures` fails. + # + # @private + # + # source://rspec-core//lib/rspec/core/example.rb#425 + def set_aggregate_failures_exception(exception); end + + # Used internally to set an exception in an after hook, which + # captures the exception but doesn't raise it. + # + # @private + # + # source://rspec-core//lib/rspec/core/example.rb#412 + def set_exception(exception); end + + # @return [Boolean] flag that will cause the example to not run. + # The {ExecutionResult} status will be `:pending`. + # + # source://rspec-core//lib/rspec/core/example.rb#49 + def skip; end + + # Used internally to skip without actually executing the example when + # skip is used in before(:context). + # + # @private + # + # source://rspec-core//lib/rspec/core/example.rb#449 + def skip_with_exception(reporter, exception); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/example.rb#238 + def skipped?; end + + # Provide a human-readable representation of this class + # + # source://rspec-core//lib/rspec/core/example.rb#220 + def to_s; end + + # @private + # + # source://rspec-core//lib/rspec/core/example.rb#148 + def update_inherited_metadata(updates); end + + private + + # source://rspec-core//lib/rspec/core/example.rb#534 + def assign_generated_description; end + + # source://rspec-core//lib/rspec/core/example.rb#478 + def finish(reporter); end + + # source://rspec-core//lib/rspec/core/example.rb#543 + def generate_description; end + + # source://rspec-core//lib/rspec/core/example.rb#462 + def hooks; end + + # source://rspec-core//lib/rspec/core/example.rb#550 + def location_description; end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/example.rb#530 + def mocks_need_verification?; end + + # source://rspec-core//lib/rspec/core/example.rb#498 + def record_finished(status, reporter); end + + # source://rspec-core//lib/rspec/core/example.rb#516 + def run_after_example; end + + # source://rspec-core//lib/rspec/core/example.rb#503 + def run_before_example; end + + # source://rspec-core//lib/rspec/core/example.rb#473 + def start(reporter); end + + # source://rspec-core//lib/rspec/core/example.rb#524 + def verify_mocks; end + + # source://rspec-core//lib/rspec/core/example.rb#508 + def with_around_and_singleton_context_hooks; end + + # source://rspec-core//lib/rspec/core/example.rb#466 + def with_around_example_hooks; end + + class << self + # Used to define methods that delegate to this example's metadata. + # + # @private + # + # source://rspec-core//lib/rspec/core/example.rb#48 + def delegate_to_metadata(key); end + + # @private + # + # source://rspec-core//lib/rspec/core/example.rb#122 + def parse_id(id); end + end +end + +# @private +# +# source://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. +# +# source://rspec-core//lib/rspec/core/example.rb#556 +class RSpec::Core::Example::ExecutionResult + include ::RSpec::Core::HashImitatable + extend ::RSpec::Core::HashImitatable::ClassMethods + + # Populates finished_at and run_time if it has not yet been set + # + # @api private + # + # source://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. + # + # source://rspec-core//lib/rspec/core/example.rb#597 + def example_skipped?; end + + # @return [Exception, nil] The failure, if there was one. + # + # source://rspec-core//lib/rspec/core/metadata.rb#442 + def exception; end + + # @return [Exception, nil] The failure, if there was one. + # + # source://rspec-core//lib/rspec/core/metadata.rb#442 + def exception=(_arg0); end + + # @return [Time] When the example finished. + # + # source://rspec-core//lib/rspec/core/metadata.rb#442 + def finished_at; end + + # @return [Time] When the example finished. + # + # source://rspec-core//lib/rspec/core/metadata.rb#442 + 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`. + # + # source://rspec-core//lib/rspec/core/metadata.rb#442 + 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`. + # + # source://rspec-core//lib/rspec/core/metadata.rb#442 + def pending_exception=(_arg0); end + + # @return [Boolean] For examples tagged with `:pending`, + # this indicates whether or not it now passes. + # + # source://rspec-core//lib/rspec/core/metadata.rb#442 + def pending_fixed; end + + # @return [Boolean] For examples tagged with `:pending`, + # this indicates whether or not it now passes. + # + # source://rspec-core//lib/rspec/core/metadata.rb#442 + def pending_fixed=(_arg0); end + + # @return [Boolean] + # + # source://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. + # + # source://rspec-core//lib/rspec/core/metadata.rb#442 + def pending_message; end + + # @return [String, nil] The reason the example was pending, + # or nil if the example was not pending. + # + # source://rspec-core//lib/rspec/core/metadata.rb#442 + def pending_message=(_arg0); end + + # Records the finished status of the example. + # + # @api private + # + # source://rspec-core//lib/rspec/core/example.rb#603 + def record_finished(status, finished_at); end + + # @return [Float] How long the example took in seconds. + # + # source://rspec-core//lib/rspec/core/metadata.rb#442 + def run_time; end + + # @return [Float] How long the example took in seconds. + # + # source://rspec-core//lib/rspec/core/metadata.rb#442 + def run_time=(_arg0); end + + # @return [Time] When the example started. + # + # source://rspec-core//lib/rspec/core/metadata.rb#442 + def started_at; end + + # @return [Time] When the example started. + # + # source://rspec-core//lib/rspec/core/metadata.rb#442 + def started_at=(_arg0); end + + # @return [Symbol] `:passed`, `:failed` or `:pending`. + # + # source://rspec-core//lib/rspec/core/metadata.rb#442 + def status; end + + # @return [Symbol] `:passed`, `:failed` or `:pending`. + # + # source://rspec-core//lib/rspec/core/metadata.rb#442 + def status=(_arg0); end + + private + + # source://rspec-core//lib/rspec/core/example.rb#616 + def calculate_run_time(finished_at); end + + # source://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. + # + # source://rspec-core//lib/rspec/core/example.rb#623 + def hash_for_delegation; end + + # source://rspec-core//lib/rspec/core/example.rb#642 + def issue_deprecation(_method_name, *_args); end + + # source://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. +# +# source://rspec-core//lib/rspec/core/example.rb#331 +class RSpec::Core::Example::Procsy + # @return [Procsy] a new instance of Procsy + # + # source://rspec-core//lib/rspec/core/example.rb#362 + def initialize(example, &block); end + + # source://rspec-core//lib/rspec/core/example.rb#346 + def <<(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#346 + def ==(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#346 + def ===(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#346 + def >>(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#346 + def [](*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#346 + def arity(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#346 + def binding(*a, &b); end + + # Calls the proc and notes that the example has been executed. + # + # source://rspec-core//lib/rspec/core/example.rb#350 + def call(*args, &block); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def clock(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def clock=(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#346 + def clone(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#346 + def curry(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def description(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#346 + def dup(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def duplicate_with(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#346 + def eql?(*a, &b); end + + # The {Example} instance. + # + # source://rspec-core//lib/rspec/core/example.rb#333 + def example; end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def example_group(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def example_group_instance(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def exception(*a, &b); end + + # Indicates whether or not the around hook has executed the example. + # + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/example.rb#374 + def executed?; end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def execution_result(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def file_path(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def full_description(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#346 + def hash(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def id(*a, &b); end + + # @private + # + # source://rspec-core//lib/rspec/core/example.rb#379 + def inspect; end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def inspect_output(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#346 + def lambda?(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def location(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def location_rerun_argument(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def metadata(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#346 + def parameters(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def pending(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def pending?(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def reporter(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def rerun_argument(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#346 + def ruby2_keywords(*a, &b); end + + # Calls the proc and notes that the example has been executed. + # + # source://rspec-core//lib/rspec/core/example.rb#350 + def run(*args, &block); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def skip(*a, &b); end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def skipped?(*a, &b); end + + # source://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. + # + # source://rspec-core//lib/rspec/core/example.rb#358 + def to_proc; end + + # source://rspec-core//lib/rspec/core/example.rb#339 + def update_inherited_metadata(*a, &b); end + + # @private + # + # source://rspec-core//lib/rspec/core/example.rb#369 + def wrap(&block); end + + # source://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}. +# +# source://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 + + # source://rspec-core//lib/rspec/core/example_group.rb#707 + 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 + # + # source://rspec-core//lib/rspec/core/example_group.rb#99 + def described_class; end + + # source://rspec-core//lib/rspec/core/example_group.rb#713 + def inspect; end + + private + + # source://rspec-core//lib/rspec/core/example_group.rb#758 + def method_missing(name, *args, **_arg2); end + + class << self + # Adds an example to the example group + # + # source://rspec-core//lib/rspec/core/example_group.rb#367 + def add_example(example); end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#529 + def before_context_ivars; end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#466 + def children; end + + # source://rspec-core//lib/rspec/core/example_group.rb#247 + def context(*args, &example_group_block); end + + # Returns true if a `before(:context)` or `after(:context)` + # hook is currently executing. + # + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/example_group.rb#542 + def currently_executing_a_context_hook?; end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#667 + def declaration_locations; end + + # @private + # @see DSL#describe + # + # source://rspec-core//lib/rspec/core/example_group.rb#246 + def define_example_group_method(name, metadata = T.unsafe(nil)); end + + # @example + # $1 "does something", :slow, :load_factor => 100 do + # end + # + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#145 + def define_example_method(name, extra_options = T.unsafe(nil)); end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#317 + def define_nested_shared_group_method(new_name, report_label = T.unsafe(nil)); end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#76 + def delegate_to_metadata(*names); end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#460 + def descendant_filtered_examples; end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#503 + def descendants; end + + # source://rspec-core//lib/rspec/core/example_group.rb#247 + def describe(*args, &example_group_block); end + + # source://rspec-core//lib/rspec/core/example_group.rb#78 + def described_class; end + + # @return [String] the current example group description + # + # source://rspec-core//lib/rspec/core/example_group.rb#85 + def description; end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#700 + def each_instance_variable_for_example(group); end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#518 + def ensure_example_groups_are_configured; end + + # Defines an example within a group. + # + # @example + # example do + # end + # + # example "does something" do + # end + # + # example "does something", :slow, :uses_js do + # end + # + # example "does something", :with => 'additional metadata' do + # end + # + # example "does something" do |ex| + # # ex is the Example object that contains metadata about the example + # end + # @overload example + # @overload example + # @overload example + # @overload example + # @yield [Example] the example object + # + # source://rspec-core//lib/rspec/core/example_group.rb#146 + def example(*all_args, &block); end + + # source://rspec-core//lib/rspec/core/example_group.rb#247 + def example_group(*args, &example_group_block); end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#450 + def examples; end + + # source://rspec-core//lib/rspec/core/example_group.rb#247 + def fcontext(*args, &example_group_block); end + + # source://rspec-core//lib/rspec/core/example_group.rb#247 + def fdescribe(*args, &example_group_block); end + + # Shortcut to define an example with `:focus => true`. + # + # @example + # fexample do + # end + # + # fexample "does something" do + # end + # + # fexample "does something", :slow, :uses_js do + # end + # + # fexample "does something", :with => 'additional metadata' do + # end + # + # fexample "does something" do |ex| + # # ex is the Example object that contains metadata about the example + # end + # @overload fexample + # @overload fexample + # @overload fexample + # @overload fexample + # @see example + # @yield [Example] the example object + # + # source://rspec-core//lib/rspec/core/example_group.rb#146 + def fexample(*all_args, &block); end + + # source://rspec-core//lib/rspec/core/example_group.rb#78 + def file_path; end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#455 + def filtered_examples; end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#379 + def find_and_eval_shared(label, name, inclusion_location, *args, &customization_block); end + + # Shortcut to define an example with `:focus => true`. + # + # @example + # fit do + # end + # + # fit "does something" do + # end + # + # fit "does something", :slow, :uses_js do + # end + # + # fit "does something", :with => 'additional metadata' do + # end + # + # fit "does something" do |ex| + # # ex is the Example object that contains metadata about the example + # end + # @overload fit + # @overload fit + # @overload fit + # @overload fit + # @see example + # @yield [Example] the example object + # + # source://rspec-core//lib/rspec/core/example_group.rb#146 + def fit(*all_args, &block); end + + # Shortcut to define an example with `:focus => true`. + # + # @example + # focus do + # end + # + # focus "does something" do + # end + # + # focus "does something", :slow, :uses_js do + # end + # + # focus "does something", :with => 'additional metadata' do + # end + # + # focus "does something" do |ex| + # # ex is the Example object that contains metadata about the example + # end + # @overload focus + # @overload focus + # @overload focus + # @overload focus + # @see example + # @yield [Example] the example object + # + # source://rspec-core//lib/rspec/core/example_group.rb#146 + def focus(*all_args, &block); end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#655 + def for_filtered_examples(reporter, &block); end + + # Shortcut to define an example with `:focus => true`. + # + # @example + # fspecify do + # end + # + # fspecify "does something" do + # end + # + # fspecify "does something", :slow, :uses_js do + # end + # + # fspecify "does something", :with => 'additional metadata' do + # end + # + # fspecify "does something" do |ex| + # # ex is the Example object that contains metadata about the example + # end + # @overload fspecify + # @overload fspecify + # @overload fspecify + # @overload fspecify + # @see example + # @yield [Example] the example object + # + # source://rspec-core//lib/rspec/core/example_group.rb#146 + 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. + # + # source://rspec-core//lib/rspec/core/example_group.rb#675 + def id; end + + # Define a singleton method for the singleton class (remove the method if + # it's already been defined). + # + # @private + # + # source://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 + # + # source://rspec-core//lib/rspec/core/example_group.rb#343 + 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 + # + # source://rspec-core//lib/rspec/core/example_group.rb#353 + def include_examples(name, *args, &block); end + + # Defines an example within a group. + # This is the primary API to define a code example. + # + # @example + # it do + # end + # + # it "does something" do + # end + # + # it "does something", :slow, :uses_js do + # end + # + # it "does something", :with => 'additional metadata' do + # end + # + # it "does something" do |ex| + # # ex is the Example object that contains metadata about the example + # end + # @overload it + # @overload it + # @overload it + # @overload it + # @yield [Example] the example object + # + # source://rspec-core//lib/rspec/core/example_group.rb#146 + def it(*all_args, &block); end + + # source://rspec-core//lib/rspec/core/example_group.rb#318 + def it_behaves_like(name, *args, &customization_block); end + + # source://rspec-core//lib/rspec/core/example_group.rb#318 + def it_should_behave_like(name, *args, &customization_block); end + + # source://rspec-core//lib/rspec/core/example_group.rb#78 + def location; end + + # The [Metadata](Metadata) object associated with this group. + # + # @see Metadata + # + # source://rspec-core//lib/rspec/core/example_group.rb#51 + def metadata; end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#485 + def next_runnable_index_for(file); end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#625 + def ordering_strategy; end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#508 + def parent_groups; end + + # Shortcut to define an example with `:pending => true` + # + # @example + # pending do + # end + # + # pending "does something" do + # end + # + # pending "does something", :slow, :uses_js do + # end + # + # pending "does something", :with => 'additional metadata' do + # end + # + # pending "does something" do |ex| + # # ex is the Example object that contains metadata about the example + # end + # @overload pending + # @overload pending + # @overload pending + # @overload pending + # @see example + # @yield [Example] the example object + # + # source://rspec-core//lib/rspec/core/example_group.rb#146 + def pending(*all_args, &block); end + + # Removes an example from the example group + # + # source://rspec-core//lib/rspec/core/example_group.rb#373 + def remove_example(example); end + + # Clear memoized values when adding/removing examples + # + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#359 + def reset_memoized; end + + # Runs all the examples in this group. + # + # source://rspec-core//lib/rspec/core/example_group.rb#599 + def run(reporter = T.unsafe(nil)); end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#585 + def run_after_context_hooks(example_group_instance); end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#547 + def run_before_context_hooks(example_group_instance); end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#641 + def run_examples(reporter); end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#410 + def set_it_up(description, args, registration_collection, &example_group_block); end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#685 + def set_ivars(instance, ivars); end + + # Shortcut to define an example with `:skip => true` + # + # @example + # skip do + # end + # + # skip "does something" do + # end + # + # skip "does something", :slow, :uses_js do + # end + # + # skip "does something", :with => 'additional metadata' do + # end + # + # skip "does something" do |ex| + # # ex is the Example object that contains metadata about the example + # end + # @overload skip + # @overload skip + # @overload skip + # @overload skip + # @see example + # @yield [Example] the example object + # + # source://rspec-core//lib/rspec/core/example_group.rb#146 + def skip(*all_args, &block); end + + # Defines an example within a group. + # Useful for when your docstring does not read well off of `it`. + # + # @example + # RSpec.describe MyClass do + # specify "#do_something is deprecated" do + # # ... + # end + # end + # @example + # specify do + # end + # + # specify "does something" do + # end + # + # specify "does something", :slow, :uses_js do + # end + # + # specify "does something", :with => 'additional metadata' do + # end + # + # specify "does something" do |ex| + # # ex is the Example object that contains metadata about the example + # end + # @overload specify + # @overload specify + # @overload specify + # @overload specify + # @yield [Example] the example object + # + # source://rspec-core//lib/rspec/core/example_group.rb#146 + def specify(*all_args, &block); end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#534 + def store_before_context_ivars(example_group_instance); end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#395 + def subclass(parent, description, args, registration_collection, &example_group_block); end + + # :nocov: + # + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#562 + def superclass_before_context_ivars; end + + # @private + # @return [Metadata] belonging to the parent of a nested {ExampleGroup} + # + # source://rspec-core//lib/rspec/core/example_group.rb#71 + def superclass_metadata; end + + # @private + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/example_group.rb#513 + def top_level?; end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#680 + def top_level_description; end + + # 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. + # + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#476 + def traverse_tree_until(&block); end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#727 + 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 + # + # source://rspec-core//lib/rspec/core/example_group.rb#61 + def with_replaced_metadata(meta); end + + # source://rspec-core//lib/rspec/core/example_group.rb#247 + def xcontext(*args, &example_group_block); end + + # source://rspec-core//lib/rspec/core/example_group.rb#247 + def xdescribe(*args, &example_group_block); end + + # Shortcut to define an example with `:skip => 'Temporarily skipped with xexample'`. + # + # @example + # xexample do + # end + # + # xexample "does something" do + # end + # + # xexample "does something", :slow, :uses_js do + # end + # + # xexample "does something", :with => 'additional metadata' do + # end + # + # xexample "does something" do |ex| + # # ex is the Example object that contains metadata about the example + # end + # @overload xexample + # @overload xexample + # @overload xexample + # @overload xexample + # @see example + # @yield [Example] the example object + # + # source://rspec-core//lib/rspec/core/example_group.rb#146 + def xexample(*all_args, &block); end + + # Shortcut to define an example with `:skip => 'Temporarily skipped with xit'`. + # + # @example + # xit do + # end + # + # xit "does something" do + # end + # + # xit "does something", :slow, :uses_js do + # end + # + # xit "does something", :with => 'additional metadata' do + # end + # + # xit "does something" do |ex| + # # ex is the Example object that contains metadata about the example + # end + # @overload xit + # @overload xit + # @overload xit + # @overload xit + # @see example + # @yield [Example] the example object + # + # source://rspec-core//lib/rspec/core/example_group.rb#146 + def xit(*all_args, &block); end + + # Shortcut to define an example with `:skip => 'Temporarily skipped with xspecify'`. + # + # @example + # xspecify do + # end + # + # xspecify "does something" do + # end + # + # xspecify "does something", :slow, :uses_js do + # end + # + # xspecify "does something", :with => 'additional metadata' do + # end + # + # xspecify "does something" do |ex| + # # ex is the Example object that contains metadata about the example + # end + # @overload xspecify + # @overload xspecify + # @overload xspecify + # @overload xspecify + # @see example + # @yield [Example] the example object + # + # source://rspec-core//lib/rspec/core/example_group.rb#146 + def xspecify(*all_args, &block); end + + private + + # source://rspec-core//lib/rspec/core/example_group.rb#742 + def method_missing(name, *args); end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/example_group.rb#696 +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. +# +# source://rspec-core//lib/rspec/core/example_group.rb#740 +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 +# +# source://rspec-core//lib/rspec/core/example_status_persister.rb#143 +class RSpec::Core::ExampleStatusDumper + # @return [ExampleStatusDumper] a new instance of ExampleStatusDumper + # + # source://rspec-core//lib/rspec/core/example_status_persister.rb#148 + def initialize(examples); end + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#152 + def dump; end + + private + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#188 + def column_widths; end + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#159 + def formatted_header_rows; end + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#176 + def formatted_row_from(row_values); end + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#166 + def formatted_value_rows; end + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#184 + def headers; end + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#172 + def rows; end + + class << self + # source://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 +# +# source://rspec-core//lib/rspec/core/example_status_persister.rb#74 +class RSpec::Core::ExampleStatusMerger + # @return [ExampleStatusMerger] a new instance of ExampleStatusMerger + # + # source://rspec-core//lib/rspec/core/example_status_persister.rb#79 + def initialize(this_run, from_previous_runs); end + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#85 + def merge; end + + private + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#102 + def delete_previous_examples_that_no_longer_exist; end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/example_status_persister.rb#108 + def example_must_no_longer_exist?(ex_id); end + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#95 + def hash_from(example_list); end + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#124 + def loaded_spec_files; end + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#132 + def sort_value_from(example); end + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#128 + def spec_file_from(ex_id); end + + class << self + # source://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 +# +# source://rspec-core//lib/rspec/core/example_status_persister.rb#207 +class RSpec::Core::ExampleStatusParser + # @return [ExampleStatusParser] a new instance of ExampleStatusParser + # + # source://rspec-core//lib/rspec/core/example_status_persister.rb#212 + def initialize(string); end + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#216 + def parse; end + + private + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#226 + def headers; end + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#222 + def parse_row(line); end + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#230 + def split_line(line); end + + class << self + # source://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 +# +# source://rspec-core//lib/rspec/core/example_status_persister.rb#8 +class RSpec::Core::ExampleStatusPersister + # @return [ExampleStatusPersister] a new instance of ExampleStatusPersister + # + # source://rspec-core//lib/rspec/core/example_status_persister.rb#18 + def initialize(examples, file_name); end + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#23 + def persist; end + + private + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#40 + def dump_statuses(unparsed_previous_runs); end + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#46 + def statuses_from_this_run; end + + class << self + # source://rspec-core//lib/rspec/core/example_status_persister.rb#9 + def load_from(file_name); end + + # source://rspec-core//lib/rspec/core/example_status_persister.rb#14 + def persist(examples, file_name); end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/filter_manager.rb#183 +RSpec::Core::ExclusionRules = RSpec::Core::FilterRules + +# @private +# +# source://rspec-core//lib/rspec/core/filter_manager.rb#4 +class RSpec::Core::FilterManager + # @return [FilterManager] a new instance of FilterManager + # + # source://rspec-core//lib/rspec/core/filter_manager.rb#7 + def initialize; end + + # source://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] + # + # source://rspec-core//lib/rspec/core/filter_manager.rb#15 + def add_location(file_path, line_numbers); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/filter_manager.rb#30 + def empty?; end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#57 + def exclude(*args); end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#61 + def exclude_only(*args); end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#65 + def exclude_with_low_priority(*args); end + + # Returns the value of attribute exclusions. + # + # source://rspec-core//lib/rspec/core/filter_manager.rb#5 + def exclusions; end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#69 + def include(*args); end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#73 + def include_only(*args); end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#77 + def include_with_low_priority(*args); end + + # Returns the value of attribute inclusions. + # + # source://rspec-core//lib/rspec/core/filter_manager.rb#5 + def inclusions; end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#34 + def prune(examples); end + + private + + # source://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. + # + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/filter_manager.rb#101 + def file_scoped_include?(ex_metadata, ids, locations); end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#89 + def prune_conditionally_filtered_examples(examples); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/filter_manager.rb#115 +class RSpec::Core::FilterRules + # @return [FilterRules] a new instance of FilterRules + # + # source://rspec-core//lib/rspec/core/filter_manager.rb#130 + def initialize(rules = T.unsafe(nil)); end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#161 + def [](key); end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#134 + def add(updated); end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#138 + def add_with_low_priority(updated); end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#149 + def clear; end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#153 + def delete(key); end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#173 + def description; end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#169 + def each_pair(&block); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/filter_manager.rb#165 + def empty?; end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#157 + def fetch(*args, &block); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/filter_manager.rb#177 + def include_example?(example); end + + # Returns the value of attribute opposite. + # + # source://rspec-core//lib/rspec/core/filter_manager.rb#119 + def opposite; end + + # Sets the attribute opposite + # + # @param value the value to set the attribute opposite to. + # + # source://rspec-core//lib/rspec/core/filter_manager.rb#119 + def opposite=(_arg0); end + + # Returns the value of attribute rules. + # + # source://rspec-core//lib/rspec/core/filter_manager.rb#120 + def rules; end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#144 + def use_only(updated); end + + class << self + # source://rspec-core//lib/rspec/core/filter_manager.rb#122 + def build; end + end +end + +# source://rspec-core//lib/rspec/core/filter_manager.rb#116 +RSpec::Core::FilterRules::PROC_HEX_NUMBER = T.let(T.unsafe(nil), Regexp) + +# source://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 +# +# source://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 +# +# source://rspec-core//lib/rspec/core/metadata_filter.rb#151 +class RSpec::Core::FilterableItemRepository::QueryOptimized < ::RSpec::Core::FilterableItemRepository::UpdateOptimized + # @return [QueryOptimized] a new instance of QueryOptimized + # + # source://rspec-core//lib/rspec/core/metadata_filter.rb#155 + def initialize(applies_predicate); end + + # source://rspec-core//lib/rspec/core/metadata_filter.rb#164 + def append(item, metadata); end + + # source://rspec-core//lib/rspec/core/metadata_filter.rb#174 + def delete(item, metadata); end + + # source://rspec-core//lib/rspec/core/metadata_filter.rb#179 + def items_for(metadata); end + + # source://rspec-core//lib/rspec/core/metadata_filter.rb#169 + def prepend(item, metadata); end + + private + + # source://rspec-core//lib/rspec/core/metadata_filter.rb#217 + def applicable_metadata_from(metadata); end + + # source://rspec-core//lib/rspec/core/metadata_filter.rb#118 + def find_items_for(request_meta); end + + # source://rspec-core//lib/rspec/core/metadata_filter.rb#211 + def handle_mutation(metadata); end + + # source://rspec-core//lib/rspec/core/metadata_filter.rb#235 + def proc_keys_from(metadata); end + + # source://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 +# +# source://rspec-core//lib/rspec/core/metadata_filter.rb#98 +class RSpec::Core::FilterableItemRepository::UpdateOptimized + # @return [UpdateOptimized] a new instance of UpdateOptimized + # + # source://rspec-core//lib/rspec/core/metadata_filter.rb#101 + def initialize(applies_predicate); end + + # source://rspec-core//lib/rspec/core/metadata_filter.rb#106 + def append(item, metadata); end + + # source://rspec-core//lib/rspec/core/metadata_filter.rb#114 + def delete(item, metadata); end + + # Returns the value of attribute items_and_filters. + # + # source://rspec-core//lib/rspec/core/metadata_filter.rb#99 + def items_and_filters; end + + # source://rspec-core//lib/rspec/core/metadata_filter.rb#118 + def items_for(request_meta); end + + # source://rspec-core//lib/rspec/core/metadata_filter.rb#110 + def prepend(item, metadata); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/flat_map.rb#4 +module RSpec::Core::FlatMap + private + + # :nocov: + # + # source://rspec-core//lib/rspec/core/flat_map.rb#6 + def flat_map(array, &block); end + + class << self + # :nocov: + # + # source://rspec-core//lib/rspec/core/flat_map.rb#6 + 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 +# +# source://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 + # + # source://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 +# +# source://rspec-core//lib/rspec/core/formatters/base_bisect_formatter.rb#12 +class RSpec::Core::Formatters::BaseBisectFormatter + # @return [BaseBisectFormatter] a new instance of BaseBisectFormatter + # + # source://rspec-core//lib/rspec/core/formatters/base_bisect_formatter.rb#17 + def initialize(expected_failures); end + + # source://rspec-core//lib/rspec/core/formatters/base_bisect_formatter.rb#23 + def example_failed(notification); end + + # source://rspec-core//lib/rspec/core/formatters/base_bisect_formatter.rb#27 + def example_finished(notification); end + + # source://rspec-core//lib/rspec/core/formatters/base_bisect_formatter.rb#37 + def start_dump(_notification); end + + class << self + # @private + # + # source://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 +# +# source://rspec-core//lib/rspec/core/formatters/base_formatter.rb#13 +class RSpec::Core::Formatters::BaseFormatter + # @api public + # @param output [IO] the formatter output + # @return [BaseFormatter] a new instance of BaseFormatter + # @see RSpec::Core::Formatters::Protocol#initialize + # + # source://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 + # + # source://rspec-core//lib/rspec/core/formatters/base_formatter.rb#50 + def close(_notification); end + + # Returns the value of attribute example_group. + # + # source://rspec-core//lib/rspec/core/formatters/base_formatter.rb#17 + def example_group; end + + # Sets the attribute example_group + # + # @param value the value to set the attribute example_group to. + # + # source://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 + # + # source://rspec-core//lib/rspec/core/formatters/base_formatter.rb#42 + def example_group_started(notification); end + + # Returns the value of attribute output. + # + # source://rspec-core//lib/rspec/core/formatters/base_formatter.rb#18 + def output; end + + # @api public + # @param notification [StartNotification] + # @see RSpec::Core::Formatters::Protocol#start + # + # source://rspec-core//lib/rspec/core/formatters/base_formatter.rb#32 + def start(notification); end + + private + + # source://rspec-core//lib/rspec/core/formatters/base_formatter.rb#64 + def output_supports_sync; end + + # source://rspec-core//lib/rspec/core/formatters/base_formatter.rb#60 + def restore_sync_output; end + + # source://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 +# +# source://rspec-core//lib/rspec/core/formatters/base_text_formatter.rb#12 +class RSpec::Core::Formatters::BaseTextFormatter < ::RSpec::Core::Formatters::BaseFormatter + # 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. + # + # @api public + # @param _notification [NullNotification] (Ignored) + # + # source://rspec-core//lib/rspec/core/formatters/base_text_formatter.rb#65 + def close(_notification); end + + # Dumps detailed information about each example failure. + # + # @api public + # @param notification [NullNotification] + # + # source://rspec-core//lib/rspec/core/formatters/base_text_formatter.rb#30 + def dump_failures(notification); end + + # @private + # + # source://rspec-core//lib/rspec/core/formatters/base_text_formatter.rb#47 + def dump_pending(notification); end + + # This method is invoked after the dumping of examples and failures. + # Each parameter is assigned to a corresponding attribute. + # + # @api public + # @param summary [SummaryNotification] containing duration, + # example_count, failure_count and pending_count + # + # source://rspec-core//lib/rspec/core/formatters/base_text_formatter.rb#42 + def dump_summary(summary); end + + # Used by the reporter to send messages to the output stream. + # + # @api public + # @param notification [MessageNotification] containing message + # + # source://rspec-core//lib/rspec/core/formatters/base_text_formatter.rb#21 + def message(notification); end + + # @private + # + # source://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 +# +# source://rspec-core//lib/rspec/core/formatters/bisect_drb_formatter.rb#15 +class RSpec::Core::Formatters::BisectDRbFormatter < ::RSpec::Core::Formatters::BaseBisectFormatter + # @return [BisectDRbFormatter] a new instance of BisectDRbFormatter + # + # source://rspec-core//lib/rspec/core/formatters/bisect_drb_formatter.rb#16 + def initialize(_output); end + + # source://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. +# +# source://rspec-core//lib/rspec/core/formatters/console_codes.rb#6 +module RSpec::Core::Formatters::ConsoleCodes + private + + # @private + # + # source://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 + # + # source://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 + # + # source://rspec-core//lib/rspec/core/formatters/console_codes.rb#66 + def wrap(text, code_or_symbol); end + + class << self + # @private + # + # source://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 + # + # source://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 + # + # source://rspec-core//lib/rspec/core/formatters/console_codes.rb#66 + def wrap(text, code_or_symbol); end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/console_codes.rb#8 +RSpec::Core::Formatters::ConsoleCodes::VT100_CODES = T.let(T.unsafe(nil), Hash) + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/console_codes.rb#29 +RSpec::Core::Formatters::ConsoleCodes::VT100_CODE_VALUES = T.let(T.unsafe(nil), Hash) + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#7 +class RSpec::Core::Formatters::DeprecationFormatter + # @return [DeprecationFormatter] a new instance of DeprecationFormatter + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#12 + def initialize(deprecation_stream, summary_stream); end + + # Returns the value of attribute count. + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#10 + def count; end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#32 + def deprecation(notification); end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#44 + def deprecation_message_for(data); end + + # Returns the value of attribute deprecation_stream. + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#10 + def deprecation_stream; end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#40 + def deprecation_summary(_notification); end + + # Returns the value of attribute deprecation_stream. + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#10 + def output; end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#20 + def printer; end + + # Returns the value of attribute summary_stream. + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#10 + def summary_stream; end +end + +# source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#60 +RSpec::Core::Formatters::DeprecationFormatter::DEPRECATION_STREAM_NOTICE = T.let(T.unsafe(nil), String) + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#135 +class RSpec::Core::Formatters::DeprecationFormatter::DelayedPrinter + # @return [DelayedPrinter] a new instance of DelayedPrinter + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#140 + def initialize(deprecation_stream, summary_stream, deprecation_formatter); end + + # Returns the value of attribute deprecation_formatter. + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#138 + def deprecation_formatter; end + + # Returns the value of attribute deprecation_stream. + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#138 + def deprecation_stream; end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#163 + def deprecation_summary; end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#172 + def print_deferred_deprecation_warnings; end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#148 + def print_deprecation_message(data); end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#155 + def stash_deprecation_message(deprecation_message); end + + # Returns the value of attribute summary_stream. + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#138 + def summary_stream; end +end + +# source://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) + +# Wraps a File object and provides file-specific operations. +# +# @private +# +# source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#196 +class RSpec::Core::Formatters::DeprecationFormatter::FileStream + # @return [FileStream] a new instance of FileStream + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#197 + def initialize(file); end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#207 + def puts(*args); end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#211 + def summarize(summary_stream, deprecation_count); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#94 +class RSpec::Core::Formatters::DeprecationFormatter::GeneratedDeprecationMessage < ::Struct + # @return [GeneratedDeprecationMessage] a new instance of GeneratedDeprecationMessage + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#95 + def initialize(data); end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#100 + def to_s; end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#107 + def too_many_warnings_message; end + + # Returns the value of attribute type + # + # @return [Object] the current value of type + def type; end + + # Sets the attribute type + # + # @param value [Object] the value to set the attribute type to. + # @return [Object] the newly set value + def type=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#113 +class RSpec::Core::Formatters::DeprecationFormatter::ImmediatePrinter + # @return [ImmediatePrinter] a new instance of ImmediatePrinter + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#116 + def initialize(deprecation_stream, summary_stream, deprecation_formatter); end + + # Returns the value of attribute deprecation_formatter. + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#114 + def deprecation_formatter; end + + # Returns the value of attribute deprecation_stream. + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#114 + def deprecation_stream; end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#128 + def deprecation_summary; end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#123 + def print_deprecation_message(data); end + + # Returns the value of attribute summary_stream. + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#114 + def summary_stream; end +end + +# source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#52 +RSpec::Core::Formatters::DeprecationFormatter::RAISE_ERROR_CONFIG_NOTICE = T.let(T.unsafe(nil), String) + +# Not really a stream, but is usable in place of one. +# +# @private +# +# source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#184 +class RSpec::Core::Formatters::DeprecationFormatter::RaiseErrorStream + # @raise [DeprecationError] + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#185 + def puts(message); end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#189 + def summarize(summary_stream, deprecation_count); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#66 +class RSpec::Core::Formatters::DeprecationFormatter::SpecifiedDeprecationMessage < ::Struct + # @return [SpecifiedDeprecationMessage] a new instance of SpecifiedDeprecationMessage + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#67 + def initialize(data); end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#72 + def to_s; end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#76 + def too_many_warnings_message; end + + # Returns the value of attribute type + # + # @return [Object] the current value of type + def type; end + + # Sets the attribute type + # + # @param value [Object] the value to set the attribute type to. + # @return [Object] the newly set value + def type=(_); end + + private + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#88 + def deprecation_type_for(data); end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#82 + def output_formatted(str); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# source://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 +# +# source://rspec-core//lib/rspec/core/formatters/documentation_formatter.rb#8 +class RSpec::Core::Formatters::DocumentationFormatter < ::RSpec::Core::Formatters::BaseTextFormatter + # @return [DocumentationFormatter] a new instance of DocumentationFormatter + # + # source://rspec-core//lib/rspec/core/formatters/documentation_formatter.rb#12 + def initialize(output); end + + # source://rspec-core//lib/rspec/core/formatters/documentation_formatter.rb#50 + def example_failed(failure); end + + # source://rspec-core//lib/rspec/core/formatters/documentation_formatter.rb#31 + def example_group_finished(_notification); end + + # source://rspec-core//lib/rspec/core/formatters/documentation_formatter.rb#24 + def example_group_started(notification); end + + # source://rspec-core//lib/rspec/core/formatters/documentation_formatter.rb#35 + def example_passed(passed); end + + # source://rspec-core//lib/rspec/core/formatters/documentation_formatter.rb#42 + def example_pending(pending); end + + # source://rspec-core//lib/rspec/core/formatters/documentation_formatter.rb#20 + def example_started(_notification); end + + # source://rspec-core//lib/rspec/core/formatters/documentation_formatter.rb#57 + def message(notification); end + + private + + # source://rspec-core//lib/rspec/core/formatters/documentation_formatter.rb#96 + def current_indentation(offset = T.unsafe(nil)); end + + # source://rspec-core//lib/rspec/core/formatters/documentation_formatter.rb#85 + def failure_output(example); end + + # source://rspec-core//lib/rspec/core/formatters/documentation_formatter.rb#67 + def flush_messages; end + + # source://rspec-core//lib/rspec/core/formatters/documentation_formatter.rb#91 + def next_failure_index; end + + # source://rspec-core//lib/rspec/core/formatters/documentation_formatter.rb#75 + def passed_output(example); end + + # source://rspec-core//lib/rspec/core/formatters/documentation_formatter.rb#79 + def pending_output(example, message); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#11 +class RSpec::Core::Formatters::ExceptionPresenter + # @return [ExceptionPresenter] a new instance of ExceptionPresenter + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#16 + def initialize(exception, example, options = T.unsafe(nil)); end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#78 + def colorized_formatted_backtrace(colorizer = T.unsafe(nil)); end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#33 + def colorized_message_lines(colorizer = T.unsafe(nil)); end + + # Returns the value of attribute description. + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#12 + def description; end + + # Returns the value of attribute example. + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#12 + def example; end + + # Returns the value of attribute exception. + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#12 + def exception; end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#39 + def formatted_backtrace(exception = T.unsafe(nil)); end + + # :nocov: + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#45 + def formatted_cause(exception); end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#84 + def fully_formatted(failure_number, colorizer = T.unsafe(nil)); end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#89 + def fully_formatted_lines(failure_number, colorizer); end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#29 + def message_lines; end + + private + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#224 + def add_shared_group_lines(lines, colorizer); end + + # Returns the value of attribute backtrace_formatter. + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#12 + def backtrace_formatter; end + + # Returns the value of attribute detail_formatter. + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#12 + def detail_formatter; end + + # for 1.8.7 + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#282 + def encoded_description(description); end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#120 + def encoded_string(string); end + + # :nocov: + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#116 + def encoding_of(string); end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#292 + def exception_backtrace; end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#150 + def exception_class_name(exception = T.unsafe(nil)); end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#202 + def exception_lines; end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#184 + def exception_message_string(exception); end + + # Returns the value of attribute extra_detail_formatter. + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#12 + def extra_detail_formatter; end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#213 + def extra_failure_lines; end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#156 + def failure_lines; end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#170 + def failure_slash_error_lines; end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#104 + def final_exception(exception, previous = T.unsafe(nil)); end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#258 + def find_failed_line; end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#273 + def formatted_message_and_backtrace(colorizer); end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#134 + def indent_lines(lines, failure_number); end + + # Returns the value of attribute message_color. + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#12 + def message_color; end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#234 + def read_failed_lines; end +end + +# 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. +# +# @private +# +# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#301 +class RSpec::Core::Formatters::ExceptionPresenter::Factory + # @return [Factory] a new instance of Factory + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#308 + def initialize(example); end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#302 + def build; end + + private + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#363 + def multiple_exception_summarizer(exception, prior_detail_formatter, color); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#359 + def multiple_exceptions_error?(exception); end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#318 + def options; end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#322 + def pending_options; end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#384 + def sub_failure_list_formatter(exception, message_color); end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#343 + def with_multiple_error_options_as_needed(exception, options); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#417 +class RSpec::Core::Formatters::ExceptionPresenter::Factory::CommonBacktraceTruncater + # @return [CommonBacktraceTruncater] a new instance of CommonBacktraceTruncater + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#418 + def initialize(parent); end + + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#422 + def with_truncated_backtrace(child); end +end + +# Used to prevent a confusing backtrace from showing up from the `aggregate_failures` +# block declared for `:aggregate_failures` metadata. +# +# @private +# +# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#410 +module RSpec::Core::Formatters::ExceptionPresenter::Factory::EmptyBacktraceFormatter + class << self + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#411 + def format_backtrace(*_arg0); end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#442 +RSpec::Core::Formatters::ExceptionPresenter::PENDING_DETAIL_FORMATTER = T.let(T.unsafe(nil), Proc) + +# @private +# +# source://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. + # + # source://rspec-core//lib/rspec/core/formatters/failure_list_formatter.rb#18 + def dump_profile(_profile); end + + # source://rspec-core//lib/rspec/core/formatters/failure_list_formatter.rb#10 + def example_failed(failure); end + + # source://rspec-core//lib/rspec/core/formatters/failure_list_formatter.rb#19 + def message(_message); end +end + +# Formatter for providing message output as a fallback when no other +# profiler implements #message +# +# @api private +# +# source://rspec-core//lib/rspec/core/formatters/fallback_message_formatter.rb#7 +class RSpec::Core::Formatters::FallbackMessageFormatter + # @api private + # @return [FallbackMessageFormatter] a new instance of FallbackMessageFormatter + # + # source://rspec-core//lib/rspec/core/formatters/fallback_message_formatter.rb#10 + def initialize(output); end + + # Used by the reporter to send messages to the output stream. + # + # @api public + # @param notification [MessageNotification] containing message + # + # source://rspec-core//lib/rspec/core/formatters/fallback_message_formatter.rb#22 + def message(notification); end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/formatters/fallback_message_formatter.rb#15 + def output; end +end + +# Formatters helpers. +# +# source://rspec-core//lib/rspec/core/formatters/helpers.rb#7 +module RSpec::Core::Formatters::Helpers + class << self + # Formats seconds into a human-readable string. + # + # @api private + # @example + # format_duration(1) #=> "1 minute 1 second" + # format_duration(135.14) #=> "2 minutes 15.14 seconds" + # @param duration [Float, Fixnum] in seconds + # @return [String] human-readable time + # + # source://rspec-core//lib/rspec/core/formatters/helpers.rb#24 + def format_duration(duration); end + + # 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. + # + # The precision used is set in {Helpers::SUB_SECOND_PRECISION} and + # {Helpers::DEFAULT_PRECISION}. + # + # @api private + # @example + # format_seconds(0.000006) #=> "0.00001" + # format_seconds(0.020000) #=> "0.02" + # format_seconds(1.00000000001) #=> "1" + # @param float [Float] + # @return [String] formatted float + # @see #strip_trailing_zeroes + # + # source://rspec-core//lib/rspec/core/formatters/helpers.rb#60 + def format_seconds(float, precision = T.unsafe(nil)); end + + # Given a list of example ids, organizes them into a compact, ordered list. + # + # @api private + # + # source://rspec-core//lib/rspec/core/formatters/helpers.rb#102 + def organize_ids(ids); end + + # Pluralize a word based on a count. + # + # @api private + # @param count [Fixnum] number of objects + # @param string [String] word to be pluralized + # @return [String] pluralized word + # + # source://rspec-core//lib/rspec/core/formatters/helpers.rb#88 + def pluralize(count, string); end + + private + + # Remove trailing zeros from a string. + # + # Only remove trailing zeros after a decimal place. + # see: http://rubular.com/r/ojtTydOgpn + # + # @api private + # @param string [String] string with trailing zeros + # @return [String] string with trailing zeros removed + # + # source://rspec-core//lib/rspec/core/formatters/helpers.rb#76 + def strip_trailing_zeroes(string); end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/helpers.rb#12 +RSpec::Core::Formatters::Helpers::DEFAULT_PRECISION = T.let(T.unsafe(nil), Integer) + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/helpers.rb#9 +RSpec::Core::Formatters::Helpers::SUB_SECOND_PRECISION = T.let(T.unsafe(nil), Integer) + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/html_formatter.rb#8 +class RSpec::Core::Formatters::HtmlFormatter < ::RSpec::Core::Formatters::BaseFormatter + # @return [HtmlFormatter] a new instance of HtmlFormatter + # + # source://rspec-core//lib/rspec/core/formatters/html_formatter.rb#13 + def initialize(output); end + + # source://rspec-core//lib/rspec/core/formatters/html_formatter.rb#103 + def dump_summary(summary); end + + # source://rspec-core//lib/rspec/core/formatters/html_formatter.rb#55 + def example_failed(failure); end + + # source://rspec-core//lib/rspec/core/formatters/html_formatter.rb#28 + def example_group_started(notification); end + + # source://rspec-core//lib/rspec/core/formatters/html_formatter.rb#49 + def example_passed(passed); end + + # source://rspec-core//lib/rspec/core/formatters/html_formatter.rb#93 + def example_pending(pending); end + + # source://rspec-core//lib/rspec/core/formatters/html_formatter.rb#45 + def example_started(_notification); end + + # source://rspec-core//lib/rspec/core/formatters/html_formatter.rb#22 + def start(notification); end + + # source://rspec-core//lib/rspec/core/formatters/html_formatter.rb#40 + def start_dump(_notification); end + + private + + # The number of the currently running example_group. + # + # source://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). + # + # source://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. + # + # source://rspec-core//lib/rspec/core/formatters/html_formatter.rb#141 + def extra_failure_content(failure); end + + # source://rspec-core//lib/rspec/core/formatters/html_formatter.rb#130 + def percent_done; end +end + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/html_printer.rb#7 +class RSpec::Core::Formatters::HtmlPrinter + include ::ERB::Escape + include ::ERB::Util + + # @return [HtmlPrinter] a new instance of HtmlPrinter + # + # source://rspec-core//lib/rspec/core/formatters/html_printer.rb#9 + def initialize(output); end + + # source://rspec-core//lib/rspec/core/formatters/html_printer.rb#79 + def flush; end + + # source://rspec-core//lib/rspec/core/formatters/html_printer.rb#96 + def make_example_group_header_red(group_id); end + + # source://rspec-core//lib/rspec/core/formatters/html_printer.rb#103 + def make_example_group_header_yellow(group_id); end + + # source://rspec-core//lib/rspec/core/formatters/html_printer.rb#88 + def make_header_red; end + + # source://rspec-core//lib/rspec/core/formatters/html_printer.rb#92 + def make_header_yellow; end + + # source://rspec-core//lib/rspec/core/formatters/html_printer.rb#83 + def move_progress(percent_done); end + + # source://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 + + # source://rspec-core//lib/rspec/core/formatters/html_printer.rb#18 + def print_example_group_end; end + + # source://rspec-core//lib/rspec/core/formatters/html_printer.rb#23 + def print_example_group_start(group_id, description, number_of_parents); end + + # source://rspec-core//lib/rspec/core/formatters/html_printer.rb#29 + def print_example_passed(description, run_time); end + + # source://rspec-core//lib/rspec/core/formatters/html_printer.rb#53 + def print_example_pending(description, pending_message); end + + # source://rspec-core//lib/rspec/core/formatters/html_printer.rb#13 + def print_html_start; end + + # source://rspec-core//lib/rspec/core/formatters/html_printer.rb#59 + def print_summary(duration, example_count, failure_count, pending_count); end + + private + + # source://rspec-core//lib/rspec/core/formatters/html_printer.rb#112 + def indentation_style(number_of_parents); end +end + +# source://rspec-core//lib/rspec/core/formatters/html_printer.rb#140 +RSpec::Core::Formatters::HtmlPrinter::GLOBAL_SCRIPTS = T.let(T.unsafe(nil), String) + +# source://rspec-core//lib/rspec/core/formatters/html_printer.rb#218 +RSpec::Core::Formatters::HtmlPrinter::GLOBAL_STYLES = T.let(T.unsafe(nil), String) + +# source://rspec-core//lib/rspec/core/formatters/html_printer.rb#382 +RSpec::Core::Formatters::HtmlPrinter::HTML_HEADER = T.let(T.unsafe(nil), String) + +# source://rspec-core//lib/rspec/core/formatters/html_printer.rb#116 +RSpec::Core::Formatters::HtmlPrinter::REPORT_HEADER = T.let(T.unsafe(nil), String) + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/json_formatter.rb#8 +class RSpec::Core::Formatters::JsonFormatter < ::RSpec::Core::Formatters::BaseFormatter + # @return [JsonFormatter] a new instance of JsonFormatter + # + # source://rspec-core//lib/rspec/core/formatters/json_formatter.rb#13 + def initialize(output); end + + # source://rspec-core//lib/rspec/core/formatters/json_formatter.rb#56 + def close(_notification); end + + # source://rspec-core//lib/rspec/core/formatters/json_formatter.rb#60 + def dump_profile(profile); end + + # @api private + # + # source://rspec-core//lib/rspec/core/formatters/json_formatter.rb#79 + def dump_profile_slowest_example_groups(profile); end + + # @api private + # + # source://rspec-core//lib/rspec/core/formatters/json_formatter.rb#67 + def dump_profile_slowest_examples(profile); end + + # source://rspec-core//lib/rspec/core/formatters/json_formatter.rb#24 + def dump_summary(summary); end + + # source://rspec-core//lib/rspec/core/formatters/json_formatter.rb#20 + def message(notification); end + + # Returns the value of attribute output_hash. + # + # source://rspec-core//lib/rspec/core/formatters/json_formatter.rb#11 + def output_hash; end + + # source://rspec-core//lib/rspec/core/formatters/json_formatter.rb#51 + def seed(notification); end + + # source://rspec-core//lib/rspec/core/formatters/json_formatter.rb#35 + def stop(group_notification); end + + private + + # source://rspec-core//lib/rspec/core/formatters/json_formatter.rb#88 + def format_example(example); end +end + +# `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. +# +# @api private +# +# source://rspec-core//lib/rspec/core/formatters.rb#96 +class RSpec::Core::Formatters::Loader + # @api private + # @return [Loader] a new instance of Loader + # + # source://rspec-core//lib/rspec/core/formatters.rb#105 + def initialize(reporter); end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/formatters.rb#144 + def add(formatter_to_use, *paths); end + + # @api private + # @return [String] the default formatter to setup, defaults to `progress` + # + # source://rspec-core//lib/rspec/core/formatters.rb#118 + def default_formatter; end + + # @api private + # @return [String] the default formatter to setup, defaults to `progress` + # + # source://rspec-core//lib/rspec/core/formatters.rb#118 + def default_formatter=(_arg0); end + + # @api private + # @return [Array] the loaded formatters + # + # source://rspec-core//lib/rspec/core/formatters.rb#112 + def formatters; end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/formatters.rb#121 + def prepare_default(output_stream, deprecation_stream); end + + # @api private + # @return [Reporter] the reporter + # + # source://rspec-core//lib/rspec/core/formatters.rb#115 + def reporter; end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/formatters.rb#126 + def setup_default(output_stream, deprecation_stream); end + + private + + # @api private + # + # source://rspec-core//lib/rspec/core/formatters.rb#211 + def built_in_formatter(key); end + + # @api private + # + # source://rspec-core//lib/rspec/core/formatters.rb#234 + def custom_formatter(formatter_ref); end + + # @api private + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/formatters.rb#195 + def duplicate_formatter_exists?(new_formatter); end + + # @api private + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/formatters.rb#207 + def existing_formatter_implements?(notification); end + + # @api private + # + # source://rspec-core//lib/rspec/core/formatters.rb#181 + def find_formatter(formatter_to_use); end + + # @api private + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/formatters.rb#202 + def has_matching_output?(formatter, new_formatter); end + + # @api private + # + # source://rspec-core//lib/rspec/core/formatters.rb#228 + def notifications_for(formatter_class); end + + # @api private + # + # source://rspec-core//lib/rspec/core/formatters.rb#269 + def open_stream(path_or_wrapper); end + + # @api private + # + # source://rspec-core//lib/rspec/core/formatters.rb#250 + def path_for(const_ref); end + + # @api private + # + # source://rspec-core//lib/rspec/core/formatters.rb#188 + def register(formatter, notifications); end + + # @api private + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/formatters.rb#246 + def string_const?(str); end + + # activesupport/lib/active_support/inflector/methods.rb, line 48 + # + # @api private + # + # source://rspec-core//lib/rspec/core/formatters.rb#259 + def underscore(camel_cased_word); end + + # @api private + # + # source://rspec-core//lib/rspec/core/formatters.rb#254 + def underscore_with_fix_for_non_standard_rspec_naming(string); end + + class << self + # Internal formatters are stored here when loaded. + # + # @api private + # + # source://rspec-core//lib/rspec/core/formatters.rb#100 + def formatters; end + end +end + +# Formatter for providing profile output. +# +# @api private +# +# source://rspec-core//lib/rspec/core/formatters/profile_formatter.rb#8 +class RSpec::Core::Formatters::ProfileFormatter + # @api private + # @return [ProfileFormatter] a new instance of ProfileFormatter + # + # source://rspec-core//lib/rspec/core/formatters/profile_formatter.rb#11 + def initialize(output); end + + # This method is invoked after the dumping the summary if profiling is + # enabled. + # + # @api public + # @param profile [ProfileNotification] containing duration, + # slowest_examples and slowest_example_groups + # + # source://rspec-core//lib/rspec/core/formatters/profile_formatter.rb#25 + def dump_profile(profile); end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/formatters/profile_formatter.rb#16 + def output; end + + private + + # @api private + # + # source://rspec-core//lib/rspec/core/formatters/profile_formatter.rb#62 + def bold(text); end + + # @api private + # + # source://rspec-core//lib/rspec/core/formatters/profile_formatter.rb#44 + def dump_profile_slowest_example_groups(profile); end + + # @api private + # + # source://rspec-core//lib/rspec/core/formatters/profile_formatter.rb#32 + def dump_profile_slowest_examples(profile); end + + # @api private + # + # source://rspec-core//lib/rspec/core/formatters/profile_formatter.rb#57 + def format_caller(caller_info); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/progress_formatter.rb#8 +class RSpec::Core::Formatters::ProgressFormatter < ::RSpec::Core::Formatters::BaseTextFormatter + # source://rspec-core//lib/rspec/core/formatters/progress_formatter.rb#19 + def example_failed(_notification); end + + # source://rspec-core//lib/rspec/core/formatters/progress_formatter.rb#11 + def example_passed(_notification); end + + # source://rspec-core//lib/rspec/core/formatters/progress_formatter.rb#15 + def example_pending(_notification); end + + # source://rspec-core//lib/rspec/core/formatters/progress_formatter.rb#23 + def start_dump(_notification); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#5 +class RSpec::Core::Formatters::SnippetExtractor + # @return [SnippetExtractor] a new instance of SnippetExtractor + # + # source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#35 + def initialize(source, beginning_line_number, max_line_count = T.unsafe(nil)); end + + # Returns the value of attribute beginning_line_number. + # + # source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#24 + def beginning_line_number; end + + # source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#41 + def expression_lines; end + + # Returns the value of attribute max_line_count. + # + # source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#24 + def max_line_count; end + + # Returns the value of attribute source. + # + # source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#24 + def source; end + + private + + # @raise [NoExpressionAtLineError] + # + # source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#95 + def expression_node; end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#107 + def expression_outmost_node?(node); end + + # source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#55 + def line_range_of_expression; end + + # source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#87 + def line_range_of_location_nodes_in_expression; end + + # source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#117 + def location_nodes_at_beginning_line; end + + # source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#70 + def unclosed_tokens_in_line_range(line_range); end + + class << self + # :nocov: + # + # source://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 + + # @raise [NoSuchLineError] + # + # source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#9 + def extract_line_at(file_path, line_number); end + + # source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#128 + def least_indentation_from(lines); end + + # @raise [NoSuchFileError] + # + # source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#16 + def source_from_file(path); end + end +end + +# source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#22 +class RSpec::Core::Formatters::SnippetExtractor::NoExpressionAtLineError < ::StandardError; end + +# source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#6 +class RSpec::Core::Formatters::SnippetExtractor::NoSuchFileError < ::StandardError; end + +# source://rspec-core//lib/rspec/core/formatters/snippet_extractor.rb#7 +class RSpec::Core::Formatters::SnippetExtractor::NoSuchLineError < ::StandardError; end + +# Provides terminal syntax highlighting of code snippets +# when coderay is available. +# +# @private +# +# source://rspec-core//lib/rspec/core/formatters/syntax_highlighter.rb#7 +class RSpec::Core::Formatters::SyntaxHighlighter + # @return [SyntaxHighlighter] a new instance of SyntaxHighlighter + # + # source://rspec-core//lib/rspec/core/formatters/syntax_highlighter.rb#8 + def initialize(configuration); end + + # source://rspec-core//lib/rspec/core/formatters/syntax_highlighter.rb#12 + def highlight(lines); end + + private + + # source://rspec-core//lib/rspec/core/formatters/syntax_highlighter.rb#50 + def color_enabled_implementation; end + + # :nocov: + # + # source://rspec-core//lib/rspec/core/formatters/syntax_highlighter.rb#44 + def implementation; end + + class << self + # source://rspec-core//lib/rspec/core/formatters/syntax_highlighter.rb#18 + def attempt_to_add_rspec_terms_to_coderay_keywords; end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/syntax_highlighter.rb#61 +module RSpec::Core::Formatters::SyntaxHighlighter::CodeRayImplementation + class << self + # source://rspec-core//lib/rspec/core/formatters/syntax_highlighter.rb#64 + def highlight_syntax(lines); end + end +end + +# source://rspec-core//lib/rspec/core/formatters/syntax_highlighter.rb#62 +RSpec::Core::Formatters::SyntaxHighlighter::CodeRayImplementation::RESET_CODE = T.let(T.unsafe(nil), String) + +# @private +# +# source://rspec-core//lib/rspec/core/formatters/syntax_highlighter.rb#78 +module RSpec::Core::Formatters::SyntaxHighlighter::NoSyntaxHighlightingImplementation + class << self + # source://rspec-core//lib/rspec/core/formatters/syntax_highlighter.rb#79 + def highlight_syntax(lines); end + end +end + +# Not sure why, but our code above (and/or coderay itself) does not work +# on Windows, so we disable the feature on Windows. +# +# @private +# +# source://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 +# +# source://rspec-core//lib/rspec/core/metadata.rb#349 +module RSpec::Core::HashImitatable + mixes_in_class_methods ::RSpec::Core::HashImitatable::ClassMethods + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def <(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def <=(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def >(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def >=(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#388 + def [](key); end + + # source://rspec-core//lib/rspec/core/metadata.rb#398 + def []=(key, value); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def all?(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def any?(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def assoc(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def chain(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def chunk(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def chunk_while(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def clear(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def collect(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def collect_concat(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def compact(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def compact!(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def compare_by_identity(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def compare_by_identity?(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def count(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def cycle(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def deconstruct_keys(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def default(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def default=(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def default_proc(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def default_proc=(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def delete(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def delete_if(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def detect(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def dig(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def drop(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def drop_while(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def each(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def each_cons(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def each_entry(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def each_key(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def each_pair(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def each_slice(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def each_value(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def each_with_index(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def each_with_object(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def empty?(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def entries(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def except(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def fetch(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def fetch_values(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def filter(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def filter!(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def filter_map(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def find(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def find_all(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def find_index(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def first(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def flat_map(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def flatten(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def grep(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def grep_v(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def group_by(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def has_key?(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def has_value?(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def include?(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def index_by(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def inject(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def invert(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def keep_if(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def key(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def key?(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def keys(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def lazy(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def length(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def map(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def max(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def max_by(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def member?(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def merge(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def merge!(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def min(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def min_by(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def minmax(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def minmax_by(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def none?(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def one?(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def partition(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def rassoc(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def reduce(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def rehash(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def reject(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def reject!(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def replace(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def reverse_each(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def select(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def select!(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def shift(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def size(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def slice(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def slice_after(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def slice_before(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def slice_when(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def sort(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def sort_by(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def store(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def sum(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def take(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def take_while(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def tally(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def to_a(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#354 + def to_h; end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def to_hash(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def to_proc(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def to_set(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def transform_keys(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def transform_keys!(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def transform_values(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def transform_values!(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def uniq(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def update(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def value?(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def values(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def values_at(*args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#367 + def zip(*args, &block); end + + private + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/metadata.rb#414 + def directly_supports_attribute?(name); end + + # source://rspec-core//lib/rspec/core/metadata.rb#410 + def extra_hash_attributes; end + + # source://rspec-core//lib/rspec/core/metadata.rb#418 + def get_value(name); end + + # source://rspec-core//lib/rspec/core/metadata.rb#426 + def hash_for_delegation; end + + # source://rspec-core//lib/rspec/core/metadata.rb#430 + def issue_deprecation(_method_name, *_args); end + + # source://rspec-core//lib/rspec/core/metadata.rb#422 + def set_value(name, value); end + + class << self + # @private + # + # source://rspec-core//lib/rspec/core/metadata.rb#350 + def included(klass); end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/metadata.rb#435 +module RSpec::Core::HashImitatable::ClassMethods + # source://rspec-core//lib/rspec/core/metadata.rb#440 + def attr_accessor(*names); end + + # source://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. +# +# source://rspec-core//lib/rspec/core/hooks.rb#9 +module RSpec::Core::Hooks + # 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. + # + # @api public + # @note The `:suite` scope is only supported for hooks registered on + # `RSpec.configuration` since they exist independently of any + # example or example group. + # @note The `:example` and `:context` scopes are also available as + # `:each` and `:all`, respectively. Use whichever you prefer. + # @overload after + # @overload after + # @overload after + # @overload after + # @see #before + # @see #around + # @see ExampleGroup + # @see SharedContext + # @see SharedExampleGroup + # @see Configuration + # + # source://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. + # + # source://rspec-core//lib/rspec/core/hooks.rb#287 + def append_after(*args, &block); end + + # 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. + # + # @api public + # @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. + # @overload before + # @overload before + # @overload before + # @overload before + # @see #after + # @see #around + # @see ExampleGroup + # @see SharedContext + # @see SharedExampleGroup + # @see Configuration + # + # source://rspec-core//lib/rspec/core/hooks.rb#200 + def append_before(*args, &block); end + + # 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`. + # + # @api public + # @note `:example`/`:each` is the only supported scope. + # @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. + # @overload around + # @overload around + # @overload around + # @overload around + # @yield [Example] the example to run + # + # source://rspec-core//lib/rspec/core/hooks.rb#349 + def around(*args, &block); end + + # 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. + # + # @api public + # @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. + # @overload before + # @overload before + # @overload before + # @overload before + # @see #after + # @see #around + # @see ExampleGroup + # @see SharedContext + # @see SharedExampleGroup + # @see Configuration + # + # source://rspec-core//lib/rspec/core/hooks.rb#200 + def before(*args, &block); end + + # Holds the various registered hooks. + # + # @private + # + # source://rspec-core//lib/rspec/core/hooks.rb#355 + def hooks; end + + # 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. + # + # @api public + # @note The `:suite` scope is only supported for hooks registered on + # `RSpec.configuration` since they exist independently of any + # example or example group. + # @note The `:example` and `:context` scopes are also available as + # `:each` and `:all`, respectively. Use whichever you prefer. + # @overload after + # @overload after + # @overload after + # @overload after + # @see #before + # @see #around + # @see ExampleGroup + # @see SharedContext + # @see SharedExampleGroup + # @see Configuration + # + # source://rspec-core//lib/rspec/core/hooks.rb#277 + 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. + # + # source://rspec-core//lib/rspec/core/hooks.rb#210 + def prepend_before(*args, &block); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/hooks.rb#379 +class RSpec::Core::Hooks::AfterContextHook < ::RSpec::Core::Hooks::Hook + # source://rspec-core//lib/rspec/core/hooks.rb#380 + def run(example); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/hooks.rb#370 +class RSpec::Core::Hooks::AfterHook < ::RSpec::Core::Hooks::Hook + # source://rspec-core//lib/rspec/core/hooks.rb#371 + def run(example); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/hooks.rb#388 +class RSpec::Core::Hooks::AroundHook < ::RSpec::Core::Hooks::Hook + # source://rspec-core//lib/rspec/core/hooks.rb#389 + def execute_with(example, procsy); end + + # :nocov: + # + # source://rspec-core//lib/rspec/core/hooks.rb#397 + def hook_description; end +end + +# @private +# +# source://rspec-core//lib/rspec/core/hooks.rb#363 +class RSpec::Core::Hooks::BeforeHook < ::RSpec::Core::Hooks::Hook + # source://rspec-core//lib/rspec/core/hooks.rb#364 + def run(example); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/hooks.rb#360 +class RSpec::Core::Hooks::Hook < ::Struct + # Returns the value of attribute block + # + # @return [Object] the current value of block + def block; end + + # Sets the attribute block + # + # @param value [Object] the value to set the attribute block to. + # @return [Object] the newly set value + def block=(_); end + + # Returns the value of attribute options + # + # @return [Object] the current value of options + def options; end + + # Sets the attribute options + # + # @param value [Object] the value to set the attribute options to. + # @return [Object] the newly set value + def options=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# 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. +# +# @private +# +# source://rspec-core//lib/rspec/core/hooks.rb#420 +class RSpec::Core::Hooks::HookCollections + # @return [HookCollections] a new instance of HookCollections + # + # source://rspec-core//lib/rspec/core/hooks.rb#421 + def initialize(owner, filterable_item_repo_class); end + + # source://rspec-core//lib/rspec/core/hooks.rb#449 + def register(prepend_or_append, position, *args, &block); end + + # source://rspec-core//lib/rspec/core/hooks.rb#442 + def register_global_singleton_context_hooks(example, globals); end + + # source://rspec-core//lib/rspec/core/hooks.rb#431 + def register_globals(host, globals); end + + # 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. + # + # @private + # + # source://rspec-core//lib/rspec/core/hooks.rb#475 + def run(position, scope, example_or_group); end + + protected + + # source://rspec-core//lib/rspec/core/hooks.rb#523 + def all_hooks_for(position, scope); end + + # source://rspec-core//lib/rspec/core/hooks.rb#507 + def matching_hooks_for(position, scope, example_or_group); end + + # source://rspec-core//lib/rspec/core/hooks.rb#533 + def processable_hooks_for(position, scope, host); end + + # source://rspec-core//lib/rspec/core/hooks.rb#527 + def run_owned_hooks_for(position, scope, example_or_group); end + + private + + # source://rspec-core//lib/rspec/core/hooks.rb#553 + def ensure_hooks_initialized_for(position, scope); end + + # source://rspec-core//lib/rspec/core/hooks.rb#591 + def extract_scope_from(args); end + + # source://rspec-core//lib/rspec/core/hooks.rb#543 + def hooks_for(position, scope); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/hooks.rb#605 + def known_scope?(scope); end + + # source://rspec-core//lib/rspec/core/hooks.rb#609 + def normalized_scope_for(scope); end + + # :nocov: + # + # source://rspec-core//lib/rspec/core/hooks.rb#633 + def owner_parent_groups; end + + # source://rspec-core//lib/rspec/core/hooks.rb#571 + def process(host, parent_groups, globals, position, scope); end + + # source://rspec-core//lib/rspec/core/hooks.rb#619 + def run_around_example_hooks_for(example); end + + # source://rspec-core//lib/rspec/core/hooks.rb#613 + def run_example_hooks_for(example, position, each_method); end + + # source://rspec-core//lib/rspec/core/hooks.rb#584 + def scope_and_options_from(*args); end +end + +# source://rspec-core//lib/rspec/core/hooks.rb#505 +RSpec::Core::Hooks::HookCollections::EMPTY_HOOK_ARRAY = T.let(T.unsafe(nil), Array) + +# source://rspec-core//lib/rspec/core/hooks.rb#495 +RSpec::Core::Hooks::HookCollections::HOOK_TYPES = T.let(T.unsafe(nil), Hash) + +# source://rspec-core//lib/rspec/core/hooks.rb#491 +RSpec::Core::Hooks::HookCollections::SCOPES = T.let(T.unsafe(nil), Array) + +# source://rspec-core//lib/rspec/core/hooks.rb#493 +RSpec::Core::Hooks::HookCollections::SCOPE_ALIASES = T.let(T.unsafe(nil), Hash) + +# @private +# +# source://rspec-core//lib/rspec/core/filter_manager.rb#186 +class RSpec::Core::InclusionRules < ::RSpec::Core::FilterRules + # source://rspec-core//lib/rspec/core/filter_manager.rb#187 + def add(*args); end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#191 + def add_with_low_priority(*args); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/filter_manager.rb#195 + def include_example?(example); end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#203 + def split_file_scoped_rules; end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/filter_manager.rb#199 + def standalone?; end + + private + + # source://rspec-core//lib/rspec/core/filter_manager.rb#213 + def apply_standalone_filter(updated); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/filter_manager.rb#226 + def is_standalone_filter?(rules); end + + # source://rspec-core//lib/rspec/core/filter_manager.rb#221 + def replace_filters(new_rules); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/invocations.rb#4 +module RSpec::Core::Invocations; end + +# @private +# +# source://rspec-core//lib/rspec/core/invocations.rb#28 +class RSpec::Core::Invocations::Bisect + # source://rspec-core//lib/rspec/core/invocations.rb#29 + def call(options, err, out); end + + private + + # source://rspec-core//lib/rspec/core/invocations.rb#45 + def bisect_formatter_klass_for(argument); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/invocations.rb#15 +class RSpec::Core::Invocations::DRbWithFallback + # source://rspec-core//lib/rspec/core/invocations.rb#16 + def call(options, err, out); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/invocations.rb#6 +class RSpec::Core::Invocations::InitializeProject + # source://rspec-core//lib/rspec/core/invocations.rb#7 + def call(*_args); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/invocations.rb#78 +class RSpec::Core::Invocations::PrintHelp < ::Struct + # source://rspec-core//lib/rspec/core/invocations.rb#79 + def call(_options, _err, out); end + + # Returns the value of attribute hidden_options + # + # @return [Object] the current value of hidden_options + def hidden_options; end + + # Sets the attribute hidden_options + # + # @param value [Object] the value to set the attribute hidden_options to. + # @return [Object] the newly set value + def hidden_options=(_); end + + # Returns the value of attribute parser + # + # @return [Object] the current value of parser + def parser; end + + # Sets the attribute parser + # + # @param value [Object] the value to set the attribute parser to. + # @return [Object] the newly set value + def parser=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/invocations.rb#52 +class RSpec::Core::Invocations::PrintVersion + # source://rspec-core//lib/rspec/core/invocations.rb#53 + def call(_options, _err, out); end +end + +# 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]`. +# +# @private +# +# source://rspec-core//lib/rspec/core/metadata.rb#470 +class RSpec::Core::LegacyExampleGroupHash + include ::RSpec::Core::HashImitatable + extend ::RSpec::Core::HashImitatable::ClassMethods + + # @return [LegacyExampleGroupHash] a new instance of LegacyExampleGroupHash + # + # source://rspec-core//lib/rspec/core/metadata.rb#473 + def initialize(metadata); end + + # source://rspec-core//lib/rspec/core/metadata.rb#479 + def to_h; end + + private + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/metadata.rb#485 + def directly_supports_attribute?(name); end + + # source://rspec-core//lib/rspec/core/metadata.rb#489 + def get_value(name); end + + # source://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 +# +# source://rspec-core//lib/rspec/core/memoized_helpers.rb#9 +module RSpec::Core::MemoizedHelpers + # @private + # + # source://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 + # @note This only works if you are using rspec-expectations. + # @see #subject + # @see #should + # @see #should_not + # + # source://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 + # @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`. + # @see #subject + # @see #is_expected + # + # source://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 + # @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`. + # @see #subject + # @see #is_expected + # + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#100 + def should_not(matcher = T.unsafe(nil), message = T.unsafe(nil)); end + + # @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 `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. + # @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 + # + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#57 + def subject; end + + private + + # @private + # + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#141 + def __init_memoized; end + + # 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 + # + # @private + # + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#129 + def __memoized; end + + # @private + # + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#150 + def enforce_value_expectation(matcher, method_name); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#163 + def matcher_supports_value_expectations?(matcher); end + + class << self + # @private + # + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#542 + def define_helpers_on(example_group); end + + # 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. + # + # @private + # + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#570 + def get_constant_or_yield(example_group, name); end + + # 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. + # + # @private + # + # source://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. +# +# source://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. + # + # @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 + # @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. + # + # source://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 + # + # source://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. + # + # @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 + # @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 + # @see MemoizedHelpers#should + # @see MemoizedHelpers#should_not + # @see MemoizedHelpers#is_expected + # + # source://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 + # + # source://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 +# +# source://rspec-core//lib/rspec/core/memoized_helpers.rb#200 +class RSpec::Core::MemoizedHelpers::ContextHookMemoized + class << self + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#222 + def fetch_or_store(key, &_block); end + + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#201 + def isolate_for_context_hook(example_group_instance); end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/memoized_helpers.rb#256 +class RSpec::Core::MemoizedHelpers::ContextHookMemoized::After < ::RSpec::Core::MemoizedHelpers::ContextHookMemoized + class << self + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#261 + def article; end + + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#257 + def hook_expression; end + + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#265 + def hook_intention; end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/memoized_helpers.rb#241 +class RSpec::Core::MemoizedHelpers::ContextHookMemoized::Before < ::RSpec::Core::MemoizedHelpers::ContextHookMemoized + class << self + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#246 + def article; end + + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#242 + def hook_expression; end + + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#250 + def hook_intention; end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/memoized_helpers.rb#186 +class RSpec::Core::MemoizedHelpers::NonThreadSafeMemoized + # @return [NonThreadSafeMemoized] a new instance of NonThreadSafeMemoized + # + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#187 + def initialize; end + + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#191 + def fetch_or_store(key); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/memoized_helpers.rb#170 +class RSpec::Core::MemoizedHelpers::ThreadsafeMemoized + # @return [ThreadsafeMemoized] a new instance of ThreadsafeMemoized + # + # source://rspec-core//lib/rspec/core/memoized_helpers.rb#171 + def initialize; end + + # source://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 +# +# source://rspec-core//lib/rspec/core/metadata.rb#27 +module RSpec::Core::Metadata + class << self + # Returns an enumerator that iteratively walks up the given metadata through all + # example group ancestors, yielding each metadata hash along the way. + # + # @private + # + # source://rspec-core//lib/rspec/core/metadata.rb#71 + def ascend(metadata); end + + # Iteratively walks up from the given metadata through all + # example group ancestors, yielding each metadata hash along the way. + # + # @private + # @yield [metadata] + # + # source://rspec-core//lib/rspec/core/metadata.rb#58 + def ascending(metadata); end + + # 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`. + # + # @private + # + # source://rspec-core//lib/rspec/core/metadata.rb#80 + def build_hash_from(args, warn_about_example_group_filtering = T.unsafe(nil)); end + + # @private + # + # source://rspec-core//lib/rspec/core/metadata.rb#94 + def deep_hash_dup(object); end + + # @private + # + # source://rspec-core//lib/rspec/core/metadata.rb#105 + def id_from(metadata); end + + # @private + # + # source://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 + # + # source://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 + # + # source://rspec-core//lib/rspec/core/metadata.rb#36 + def relative_path_regex; end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/metadata.rb#247 +class RSpec::Core::Metadata::ExampleGroupHash < ::RSpec::Core::Metadata::HashPopulator + private + + # source://rspec-core//lib/rspec/core/metadata.rb#304 + def described_class; end + + # source://rspec-core//lib/rspec/core/metadata.rb#311 + def full_description; end + + class << self + # source://rspec-core//lib/rspec/core/metadata.rb#265 + def backwards_compatibility_default_proc(&example_group_selector); end + + # source://rspec-core//lib/rspec/core/metadata.rb#248 + def create(parent_group_metadata, user_metadata, example_group_index, *args, &block); end + + # source://rspec-core//lib/rspec/core/metadata.rb#261 + def hash_with_backwards_compatibility_default_proc; end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/metadata.rb#213 +class RSpec::Core::Metadata::ExampleHash < ::RSpec::Core::Metadata::HashPopulator + private + + # source://rspec-core//lib/rspec/core/metadata.rb#234 + def described_class; end + + # source://rspec-core//lib/rspec/core/metadata.rb#238 + def full_description; end + + class << self + # source://rspec-core//lib/rspec/core/metadata.rb#214 + def create(group_metadata, user_metadata, index_provider, description, block); end + end +end + +# Used internally to populate metadata hashes with computed keys +# managed by RSpec. +# +# @private +# +# source://rspec-core//lib/rspec/core/metadata.rb#117 +class RSpec::Core::Metadata::HashPopulator + # @return [HashPopulator] a new instance of HashPopulator + # + # source://rspec-core//lib/rspec/core/metadata.rb#120 + def initialize(metadata, user_metadata, index_provider, description_args, block); end + + # Returns the value of attribute block. + # + # source://rspec-core//lib/rspec/core/metadata.rb#118 + def block; end + + # Returns the value of attribute description_args. + # + # source://rspec-core//lib/rspec/core/metadata.rb#118 + def description_args; end + + # Returns the value of attribute metadata. + # + # source://rspec-core//lib/rspec/core/metadata.rb#118 + def metadata; end + + # source://rspec-core//lib/rspec/core/metadata.rb#128 + def populate; end + + # Returns the value of attribute user_metadata. + # + # source://rspec-core//lib/rspec/core/metadata.rb#118 + def user_metadata; end + + private + + # source://rspec-core//lib/rspec/core/metadata.rb#178 + def build_description_from(parent_description = T.unsafe(nil), my_description = T.unsafe(nil)); end + + # source://rspec-core//lib/rspec/core/metadata.rb#185 + def build_scoped_id_for(file_path); end + + # source://rspec-core//lib/rspec/core/metadata.rb#170 + def description_separator(parent_part, child_part); end + + # source://rspec-core//lib/rspec/core/metadata.rb#191 + def ensure_valid_user_keys; end + + # source://rspec-core//lib/rspec/core/metadata.rb#164 + def file_path_and_line_number_from(backtrace); end + + # source://rspec-core//lib/rspec/core/metadata.rb#143 + def populate_location_attributes; end +end + +# @private +# +# source://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. +# +# source://rspec-core//lib/rspec/core/metadata_filter.rb#8 +module RSpec::Core::MetadataFilter + class << self + # @private + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/metadata_filter.rb#11 + def apply?(predicate, filters, metadata); end + + # @private + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/metadata_filter.rb#16 + def filter_applies?(key, filter_value, metadata); end + + # @private + # + # source://rspec-core//lib/rspec/core/metadata_filter.rb#33 + def silence_metadata_example_group_deprecations; end + + private + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/metadata_filter.rb#42 + def filter_applies_to_any_value?(key, value, metadata); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/metadata_filter.rb#73 + def filters_apply?(key, value, metadata); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/metadata_filter.rb#46 + def id_filter_applies?(rerun_paths_to_scoped_ids, metadata); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/metadata_filter.rb#54 + def location_filter_applies?(locations, metadata); end + + # @return [Boolean] + # + # source://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. +# +# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#452 +class RSpec::Core::MultipleExceptionError < ::StandardError + include ::RSpec::Core::MultipleExceptionError::InterfaceTag + + # @param exceptions [Array] The initial list of exceptions. + # @return [MultipleExceptionError] a new instance of MultipleExceptionError + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#513 + def initialize(*exceptions); end + + # @return [nil] Provided only for interface compatibility with + # `RSpec::Expectations::MultipleExpectationsNotMetError`. + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#510 + def aggregation_block_label; end + + # @return [Hash] Metadata used by RSpec for formatting purposes. + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#506 + def aggregation_metadata; end + + # @return [Array] The list of failures and other exceptions, combined. + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#503 + def all_exceptions; end + + # return [String] A description of the failure/error counts. + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#538 + def exception_count_description; end + + # @return [Array] The list of failures. + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#497 + def failures; end + + # @note RSpec does not actually use this -- instead it formats each exception + # individually. + # @return [String] Combines all the exception messages into a single string. + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#528 + def message; end + + # @return [Array] The list of other errors. + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#500 + def other_errors; end + + # @return [String] A summary of the failure, including the block label and a count of failures. + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#533 + def summary; end +end + +# 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. +# +# @private +# +# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#458 +module RSpec::Core::MultipleExceptionError::InterfaceTag + # Appends the provided exception to the list. + # + # @param exception [Exception] Exception to append to the list. + # @private + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#462 + 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 + # + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#488 + def for(ex); end + end +end + +# Notifications are value objects passed to formatters to provide them +# with information about a particular event of interest. +# +# source://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. +# +# source://rspec-core//lib/rspec/core/notifications.rb#512 +class RSpec::Core::Notifications::CustomNotification < ::Struct + class << self + # Build a custom notification based on the supplied option key / values. + # + # @param options [Hash] A hash of method / value pairs to create on this notification + # @return [CustomNotification] + # + # source://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 +# +# source://rspec-core//lib/rspec/core/notifications.rb#493 +class RSpec::Core::Notifications::DeprecationNotification < ::Struct + # An optional call site from which the deprecation + # was issued + # + # @return [String] the current value of call_site + def call_site; end + + # An optional call site from which the deprecation + # was issued + # + # @param value [String] the value to set the attribute call_site to. + # @return [String] the newly set value + def call_site=(_); end + + # A custom message about the deprecation (alias of + # message) + # + # @return [String] the current value of deprecated + def deprecated; end + + # A custom message about the deprecation (alias of + # message) + # + # @param value [String] the value to set the attribute deprecated to. + # @return [String] the newly set value + def deprecated=(_); end + + # A custom message about the deprecation + # + # @return [String] the current value of message + def message; end + + # A custom message about the deprecation + # + # @param value [String] the value to set the attribute message to. + # @return [String] the newly set value + def message=(_); end + + # An optional replacement for the deprecation + # + # @return [String] the current value of replacement + def replacement; end + + # An optional replacement for the deprecation + # + # @param value [String] the value to set the attribute replacement to. + # @return [String] the newly set value + def replacement=(_); end + + class << self + def [](*_arg0); end + + # Convenience way to initialize the notification + # + # @api + # + # source://rspec-core//lib/rspec/core/notifications.rb#499 + def from_hash(data); end + + def inspect; end + def keyword_init?; end + def members; end + + private + + 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. +# +# @attr example [RSpec::Core::Example] the current example +# @example +# def example_started(notification) +# puts "Hey I started #{notification.example.description}" +# end +# +# source://rspec-core//lib/rspec/core/notifications.rb#38 +class RSpec::Core::Notifications::ExampleNotification < ::Struct + # the current example + # + # @return [RSpec::Core::Example] the current value of example + def example; end + + # the current example + # + # @param value [RSpec::Core::Example] the value to set the attribute example to. + # @return [RSpec::Core::Example] the newly set value + def example=(_); end + + class << self + def [](*_arg0); end + + # @private + # + # source://rspec-core//lib/rspec/core/notifications.rb#41 + def for(example); end + + def inspect; end + def keyword_init?; end + def members; end + + private + + 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 +# +# source://rspec-core//lib/rspec/core/notifications.rb#69 +class RSpec::Core::Notifications::ExamplesNotification + # @return [ExamplesNotification] a new instance of ExamplesNotification + # + # source://rspec-core//lib/rspec/core/notifications.rb#70 + def initialize(reporter); end + + # @return [Array] list of examples + # + # source://rspec-core//lib/rspec/core/notifications.rb#75 + def examples; end + + # @return [Array] list of failed examples + # + # source://rspec-core//lib/rspec/core/notifications.rb#80 + def failed_examples; end + + # @return [Array] returns failed examples as notifications + # + # source://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. + # + # source://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. + # + # source://rspec-core//lib/rspec/core/notifications.rb#122 + def fully_formatted_pending_examples(colorizer = T.unsafe(nil)); end + + # @return [Array] returns examples as notifications + # + # source://rspec-core//lib/rspec/core/notifications.rb#91 + def notifications; end + + # @return [Array] list of pending examples + # + # source://rspec-core//lib/rspec/core/notifications.rb#85 + def pending_examples; end + + # returns pending examples as notifications + # + # @return [Array] + # + # source://rspec-core//lib/rspec/core/notifications.rb#104 + def pending_notifications; end + + private + + # source://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. +# +# @attr example [RSpec::Core::Example] the current example +# @example +# def example_failed(notification) +# puts "Hey I failed :(" +# puts "Here's my stack trace" +# puts notification.exception.backtrace.join("\n") +# end +# @see ExampleNotification +# +# source://rspec-core//lib/rspec/core/notifications.rb#156 +class RSpec::Core::Notifications::FailedExampleNotification < ::RSpec::Core::Notifications::ExampleNotification + # @return [FailedExampleNotification] a new instance of FailedExampleNotification + # + # source://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 + # + # source://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 + # + # source://rspec-core//lib/rspec/core/notifications.rb#180 + def colorized_message_lines(colorizer = T.unsafe(nil)); end + + # @return [String] The example description + # + # source://rspec-core//lib/rspec/core/notifications.rb#165 + def description; end + + # @return [Exception] The example failure + # + # source://rspec-core//lib/rspec/core/notifications.rb#160 + def exception; end + + # Returns the failures formatted backtrace. + # + # @return [Array] the examples backtrace lines + # + # source://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. + # + # source://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. + # + # source://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 + # + # source://rspec-core//lib/rspec/core/notifications.rb#172 + def message_lines; end + + class << self + 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. +# +# @attr group [RSpec::Core::ExampleGroup] the current group +# @example +# def example_group_started(notification) +# puts "Hey I started #{notification.group.description}" +# end +# +# source://rspec-core//lib/rspec/core/notifications.rb#258 +class RSpec::Core::Notifications::GroupNotification < ::Struct + # the current group + # + # @return [RSpec::Core::ExampleGroup] the current value of group + def group; end + + # the current group + # + # @param value [RSpec::Core::ExampleGroup] the value to set the attribute group to. + # @return [RSpec::Core::ExampleGroup] the newly set value + def group=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# The `MessageNotification` encapsulates generic messages that the reporter +# sends to formatters. +# +# @attr message [String] the message +# +# source://rspec-core//lib/rspec/core/notifications.rb#264 +class RSpec::Core::Notifications::MessageNotification < ::Struct + # the message + # + # @return [String] the current value of message + def message; end + + # the message + # + # @param value [String] the value to set the attribute message to. + # @return [String] the newly set value + def message=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/notifications.rb#11 +module RSpec::Core::Notifications::NullColorizer + private + + # source://rspec-core//lib/rspec/core/notifications.rb#14 + def wrap(line, _code_or_symbol); end + + class << self + # source://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. +# +# source://rspec-core//lib/rspec/core/notifications.rb#506 +class RSpec::Core::Notifications::NullNotification; end + +# @deprecated Use {FailedExampleNotification} instead. +# +# source://rspec-core//lib/rspec/core/notifications.rb#223 +class RSpec::Core::Notifications::PendingExampleFailedAsExpectedNotification < ::RSpec::Core::Notifications::FailedExampleNotification; end + +# @deprecated Use {FailedExampleNotification} instead. +# +# source://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 +# +# source://rspec-core//lib/rspec/core/notifications.rb#429 +class RSpec::Core::Notifications::ProfileNotification + # @return [ProfileNotification] a new instance of ProfileNotification + # + # source://rspec-core//lib/rspec/core/notifications.rb#430 + def initialize(duration, examples, number_of_examples, example_groups); end + + # the time taken (in seconds) to run the suite + # + # @return [Float] the current value of duration + # + # source://rspec-core//lib/rspec/core/notifications.rb#436 + def duration; end + + # the examples run + # + # @return [Array] the current value of examples + # + # source://rspec-core//lib/rspec/core/notifications.rb#436 + def examples; end + + # the number of examples to profile + # + # @return [Fixnum] the current value of number_of_examples + # + # source://rspec-core//lib/rspec/core/notifications.rb#436 + def number_of_examples; end + + # @return [String] the percentage of total time taken + # + # source://rspec-core//lib/rspec/core/notifications.rb#455 + def percentage; end + + # @return [Float] the time taken (in seconds) to run the slowest examples + # + # source://rspec-core//lib/rspec/core/notifications.rb#447 + def slow_duration; end + + # @return [Array] the slowest examples + # + # source://rspec-core//lib/rspec/core/notifications.rb#439 + def slowest_examples; end + + # @return [Array] the slowest example groups + # + # source://rspec-core//lib/rspec/core/notifications.rb#464 + def slowest_groups; end + + private + + # source://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 +# +# source://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. + # + # source://rspec-core//lib/rspec/core/notifications.rb#282 + def fully_formatted; end + + # the seed used to randomize ordering + # + # @return [Fixnum] the current value of seed + def seed; end + + # the seed used to randomize ordering + # + # @param value [Fixnum] the value to set the attribute seed to. + # @return [Fixnum] the newly set value + def seed=(_); end + + # @api + # @return [Boolean] has the seed been used? + # + # source://rspec-core//lib/rspec/core/notifications.rb#275 + def seed_used?; end + + # whether the seed has been used or not + # + # @param value [Boolean] the value to set the attribute used to. + # @return [Boolean] the newly set value + def used=(_); end + + private + + # whether the seed has been used or not + # + # @return [Boolean] the current value of used + def used; end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# The `SkippedExampleNotification` extends `ExampleNotification` with +# things useful for specs that are skipped. +# +# @attr example [RSpec::Core::Example] the current example +# @see ExampleNotification +# +# source://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. + # + # source://rspec-core//lib/rspec/core/notifications.rb#235 + def fully_formatted(pending_number, colorizer = T.unsafe(nil)); end + + class << self + 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 +# +# source://rspec-core//lib/rspec/core/notifications.rb#26 +class RSpec::Core::Notifications::StartNotification < ::Struct + # the number counted + # + # @return [Fixnum] the current value of count + def count; end + + # the number counted + # + # @param value [Fixnum] the value to set the attribute count to. + # @return [Fixnum] the newly set value + def count=(_); end + + # the number of seconds taken to boot RSpec + # and load the spec files + # + # @return [Float] the current value of load_time + def load_time; end + + # the number of seconds taken to boot RSpec + # and load the spec files + # + # @param value [Float] the value to set the attribute load_time to. + # @return [Float] the newly set value + def load_time=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + 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 +# +# source://rspec-core//lib/rspec/core/notifications.rb#300 +class RSpec::Core::Notifications::SummaryNotification < ::Struct + include ::RSpec::Core::ShellEscape + + # Formats failures into a rerunable command format. + # + # @api public + # @param colorizer [#wrap] An object which supports wrapping text with + # specific colors. + # @return [String] A colorized summary line. + # + # source://rspec-core//lib/rspec/core/notifications.rb#364 + def colorized_rerun_commands(colorizer = T.unsafe(nil)); end + + # Wraps the results line with colors based on the configured + # colors for failure, pending, and success. Defaults to red, + # yellow, green accordingly. + # + # @api public + # @param colorizer [#wrap] An object which supports wrapping text with + # specific colors. + # @return [String] A colorized results line. + # + # source://rspec-core//lib/rspec/core/notifications.rb#347 + def colorized_totals_line(colorizer = T.unsafe(nil)); end + + # the time taken (in seconds) to run the suite + # + # @return [Float] the current value of duration + def duration; end + + # the time taken (in seconds) to run the suite + # + # @param value [Float] the value to set the attribute duration to. + # @return [Float] the newly set value + def duration=(_); end + + # the number of errors that + # have occurred processing + # the spec suite + # + # @return [Integer] the current value of errors_outside_of_examples_count + def errors_outside_of_examples_count; end + + # the number of errors that + # have occurred processing + # the spec suite + # + # @param value [Integer] the value to set the attribute errors_outside_of_examples_count to. + # @return [Integer] the newly set value + def errors_outside_of_examples_count=(_); end + + # @api + # @return [Fixnum] the number of examples run + # + # source://rspec-core//lib/rspec/core/notifications.rb#306 + def example_count; end + + # the examples run + # + # @return [Array] the current value of examples + def examples; end + + # the examples run + # + # @param value [Array] the value to set the attribute examples to. + # @return [Array] the newly set value + def examples=(_); end + + # the failed examples + # + # @return [Array] the current value of failed_examples + def failed_examples; end + + # the failed examples + # + # @param value [Array] the value to set the attribute failed_examples to. + # @return [Array] the newly set value + def failed_examples=(_); end + + # @api + # @return [Fixnum] the number of failed examples + # + # source://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 + # + # source://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 + # + # source://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. + # + # source://rspec-core//lib/rspec/core/notifications.rb#386 + def fully_formatted(colorizer = T.unsafe(nil)); end + + # the number of seconds taken to boot RSpec + # and load the spec files + # + # @return [Float] the current value of load_time + def load_time; end + + # the number of seconds taken to boot RSpec + # and load the spec files + # + # @param value [Float] the value to set the attribute load_time to. + # @return [Float] the newly set value + def load_time=(_); end + + # @api + # @return [Fixnum] the number of pending examples + # + # source://rspec-core//lib/rspec/core/notifications.rb#318 + def pending_count; end + + # the pending examples + # + # @return [Array] the current value of pending_examples + def pending_examples; end + + # the pending examples + # + # @param value [Array] the value to set the attribute pending_examples to. + # @return [Array] the newly set value + def pending_examples=(_); end + + # @api + # @return [String] A line summarising the result totals of the spec run. + # + # source://rspec-core//lib/rspec/core/notifications.rb#324 + def totals_line; end + + private + + # source://rspec-core//lib/rspec/core/notifications.rb#408 + def duplicate_rerun_locations; end + + # source://rspec-core//lib/rspec/core/notifications.rb#402 + def rerun_argument_for(example); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# # Used in place of a {Reporter} for situations where we don't want reporting output. +# +# @private +# +# source://rspec-core//lib/rspec/core/reporter.rb#259 +class RSpec::Core::NullReporter + class << self + private + + # source://rspec-core//lib/rspec/core/reporter.rb#260 + def method_missing(*_arg0); end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/ordering.rb#4 +module RSpec::Core::Ordering; end + +# Manages ordering configuration. +# +# @note This is not intended to be used externally. Use +# the APIs provided by `RSpec::Core::Configuration` instead. +# @private +# +# source://rspec-core//lib/rspec/core/ordering.rb#144 +class RSpec::Core::Ordering::ConfigurationManager + # @return [ConfigurationManager] a new instance of ConfigurationManager + # + # source://rspec-core//lib/rspec/core/ordering.rb#147 + def initialize; end + + # source://rspec-core//lib/rspec/core/ordering.rb#190 + def force(hash); end + + # source://rspec-core//lib/rspec/core/ordering.rb#164 + def order=(type); end + + # Returns the value of attribute ordering_registry. + # + # source://rspec-core//lib/rspec/core/ordering.rb#145 + def ordering_registry; end + + # source://rspec-core//lib/rspec/core/ordering.rb#201 + def register_ordering(name, strategy = T.unsafe(nil)); end + + # Returns the value of attribute seed. + # + # source://rspec-core//lib/rspec/core/ordering.rb#145 + def seed; end + + # source://rspec-core//lib/rspec/core/ordering.rb#158 + def seed=(seed); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/ordering.rb#154 + def seed_used?; end +end + +# Orders items based on a custom block. +# +# @private +# +# source://rspec-core//lib/rspec/core/ordering.rb#71 +class RSpec::Core::Ordering::Custom + # @return [Custom] a new instance of Custom + # + # source://rspec-core//lib/rspec/core/ordering.rb#72 + def initialize(callable); end + + # source://rspec-core//lib/rspec/core/ordering.rb#76 + def order(list); end +end + +# A strategy which delays looking up the ordering until needed +# +# @private +# +# source://rspec-core//lib/rspec/core/ordering.rb#83 +class RSpec::Core::Ordering::Delayed + # @return [Delayed] a new instance of Delayed + # + # source://rspec-core//lib/rspec/core/ordering.rb#84 + def initialize(registry, name); end + + # source://rspec-core//lib/rspec/core/ordering.rb#89 + def order(list); end + + private + + # source://rspec-core//lib/rspec/core/ordering.rb#99 + def lookup_strategy; end + + # source://rspec-core//lib/rspec/core/ordering.rb#95 + def strategy; end +end + +# The default global ordering (defined order). +# +# @private +# +# source://rspec-core//lib/rspec/core/ordering.rb#7 +class RSpec::Core::Ordering::Identity + # source://rspec-core//lib/rspec/core/ordering.rb#8 + def order(items); end +end + +# Orders items randomly. +# +# @private +# +# source://rspec-core//lib/rspec/core/ordering.rb#15 +class RSpec::Core::Ordering::Random + # @return [Random] a new instance of Random + # + # source://rspec-core//lib/rspec/core/ordering.rb#16 + def initialize(configuration); end + + # source://rspec-core//lib/rspec/core/ordering.rb#25 + def order(items); end + + # @return [Boolean] + # + # source://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. + # + # source://rspec-core//lib/rspec/core/ordering.rb#39 + def jenkins_hash_digest(string); end +end + +# source://rspec-core//lib/rspec/core/ordering.rb#58 +RSpec::Core::Ordering::Random::MAX_32_BIT = T.let(T.unsafe(nil), Integer) + +# Orders items by modification time (most recent modified first). +# +# @private +# +# source://rspec-core//lib/rspec/core/ordering.rb#63 +class RSpec::Core::Ordering::RecentlyModified + # source://rspec-core//lib/rspec/core/ordering.rb#64 + def order(list); end +end + +# Stores the different ordering strategies. +# +# @private +# +# source://rspec-core//lib/rspec/core/ordering.rb#107 +class RSpec::Core::Ordering::Registry + # @return [Registry] a new instance of Registry + # + # source://rspec-core//lib/rspec/core/ordering.rb#108 + def initialize(configuration); end + + # source://rspec-core//lib/rspec/core/ordering.rb#122 + def fetch(name, &fallback); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/ordering.rb#126 + def has_strategy?(name); end + + # source://rspec-core//lib/rspec/core/ordering.rb#130 + def register(sym, strategy); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/ordering.rb#134 + def used_random_seed?; end +end + +# @private +# +# source://rspec-core//lib/rspec/core/output_wrapper.rb#4 +class RSpec::Core::OutputWrapper + # @private + # @return [OutputWrapper] a new instance of OutputWrapper + # + # source://rspec-core//lib/rspec/core/output_wrapper.rb#9 + def initialize(output); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def <<(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def advise(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def autoclose=(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def autoclose?(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def binmode(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def binmode?(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def close(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def close_on_exec=(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def close_on_exec?(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def close_read(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def close_write(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def closed?(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def each(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def each_byte(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def each_char(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def each_codepoint(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def each_line(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def eof(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def eof?(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def external_encoding(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def fcntl(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def fdatasync(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def fileno(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def flush(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def fsync(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def getbyte(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def getc(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def gets(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def inspect(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def internal_encoding(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def ioctl(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def isatty(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def lineno(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def lineno=(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#17 + def method_missing(name, *args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def nonblock(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def nonblock=(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def nonblock?(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def nread(*args, &block); end + + # @private + # + # source://rspec-core//lib/rspec/core/output_wrapper.rb#6 + def output; end + + # @private + # + # source://rspec-core//lib/rspec/core/output_wrapper.rb#6 + def output=(_arg0); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def path(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def pathconf(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def pid(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def pos(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def pos=(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def pread(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def print(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def printf(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def putc(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def puts(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def pwrite(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def read(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def read_nonblock(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def readbyte(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def readchar(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def readline(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def readlines(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def readpartial(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def ready?(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def reopen(*args, &block); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/output_wrapper.rb#13 + def respond_to?(name, priv = T.unsafe(nil)); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def rewind(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def seek(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def set_encoding(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def set_encoding_by_bom(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def stat(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def sync(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def sync=(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def sysread(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def sysseek(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def syswrite(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def tell(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def timeout(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def timeout=(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def to_i(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def to_io(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def to_path(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def tty?(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def ungetbyte(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def ungetc(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def wait(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def wait_priority(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def wait_readable(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def wait_writable(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def write(*args, &block); end + + # source://rspec-core//lib/rspec/core/output_wrapper.rb#23 + def write_nonblock(*args, &block); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/option_parser.rb#6 +class RSpec::Core::Parser + # @return [Parser] a new instance of Parser + # + # source://rspec-core//lib/rspec/core/option_parser.rb#13 + def initialize(original_args); end + + # Returns the value of attribute original_args. + # + # source://rspec-core//lib/rspec/core/option_parser.rb#11 + def original_args; end + + # source://rspec-core//lib/rspec/core/option_parser.rb#17 + def parse(source = T.unsafe(nil)); end + + private + + # source://rspec-core//lib/rspec/core/option_parser.rb#310 + def add_tag_filter(options, filter_type, tag_name, value = T.unsafe(nil)); end + + # source://rspec-core//lib/rspec/core/option_parser.rb#318 + def configure_only_failures(options); end + + # source://rspec-core//lib/rspec/core/option_parser.rb#39 + def parser(options); end + + # source://rspec-core//lib/rspec/core/option_parser.rb#314 + def set_fail_fast(options, value); end + + class << self + # source://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. +# +# source://rspec-core//lib/rspec/core/pending.rb#5 +module RSpec::Core::Pending + # 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. + # + # @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"`. + # @overload pending + # @overload pending + # @param message [String] optional message to add to the summary report. + # + # source://rspec-core//lib/rspec/core/pending.rb#62 + def pending(message = T.unsafe(nil), &_block); end + + # Marks an example as pending and skips execution. + # + # @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 + # @overload skip + # @overload skip + # @param message [String] optional message to add to the summary report. + # @raise [SkipDeclaredInExample] + # + # source://rspec-core//lib/rspec/core/pending.rb#110 + def skip(message = T.unsafe(nil)); end + + class << self + # Mark example as fixed. + # + # @param example [RSpec::Core::Example] the example to mark as fixed + # @private + # + # source://rspec-core//lib/rspec/core/pending.rb#152 + def mark_fixed!(example); end + + # 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 + # @private + # + # source://rspec-core//lib/rspec/core/pending.rb#135 + def mark_pending!(example, message_or_bool); end + + # 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 + # @private + # + # source://rspec-core//lib/rspec/core/pending.rb#124 + def mark_skipped!(example, message_or_bool); end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/pending.rb#29 +RSpec::Core::Pending::NOT_YET_IMPLEMENTED = T.let(T.unsafe(nil), String) + +# @private +# +# source://rspec-core//lib/rspec/core/pending.rb#26 +RSpec::Core::Pending::NO_REASON_GIVEN = T.let(T.unsafe(nil), String) + +# source://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. +# +# source://rspec-core//lib/rspec/core/pending.rb#8 +class RSpec::Core::Pending::SkipDeclaredInExample < ::StandardError + # @return [SkipDeclaredInExample] a new instance of SkipDeclaredInExample + # + # source://rspec-core//lib/rspec/core/pending.rb#11 + def initialize(argument); end + + # Returns the value of attribute argument. + # + # source://rspec-core//lib/rspec/core/pending.rb#9 + def argument; end +end + +# @private +# +# source://rspec-core//lib/rspec/core/profiler.rb#4 +class RSpec::Core::Profiler + # @return [Profiler] a new instance of Profiler + # + # source://rspec-core//lib/rspec/core/profiler.rb#7 + def initialize; end + + # source://rspec-core//lib/rspec/core/profiler.rb#20 + def example_group_finished(notification); end + + # source://rspec-core//lib/rspec/core/profiler.rb#13 + def example_group_started(notification); end + + # Returns the value of attribute example_groups. + # + # source://rspec-core//lib/rspec/core/profiler.rb#11 + def example_groups; end + + # source://rspec-core//lib/rspec/core/profiler.rb#28 + def example_started(notification); end +end + +# source://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. +# +# source://rspec-core//lib/rspec/core/reporter.rb#4 +class RSpec::Core::Reporter + # @return [Reporter] a new instance of Reporter + # + # source://rspec-core//lib/rspec/core/reporter.rb#14 + def initialize(configuration); end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#214 + def abort_with(msg, exit_status); end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#193 + def close_after; end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#155 + def deprecation(hash); end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#143 + def example_failed(example); end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#133 + def example_finished(example); end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#122 + def example_group_finished(group); end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#117 + def example_group_started(group); end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#138 + def example_passed(example); end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#149 + def example_pending(example); end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#127 + def example_started(example); end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#28 + def examples; end + + # Reports a run that exited early without having run any examples. + # + # @param exit_code [Integer] the exit_code to be return by the reporter + # + # source://rspec-core//lib/rspec/core/reporter.rb#84 + def exit_early(exit_code); end + + # @private + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/reporter.rb#221 + def fail_fast_limit_met?; end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#28 + def failed_examples; end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#173 + def finish; end + + # Send a custom message to supporting formatters. + # + # @param message [#to_s] A message object to send to formatters + # + # source://rspec-core//lib/rspec/core/reporter.rb#99 + def message(message); end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#206 + def notify(event, notification); end + + # 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. + # + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#163 + def notify_non_example_exception(exception, context_description); end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#28 + def pending_examples; end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#45 + def prepare_default(loader, output_stream, deprecation_stream); end + + # Publish a custom event to supporting registered formatters. + # + # @param event [Symbol] Name of the custom event to trigger on formatters + # @param options [Hash] Hash of arguments to provide via `CustomNotification` + # @see RSpec::Core::Notifications::CustomNotification + # + # source://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 + # + # source://rspec-core//lib/rspec/core/reporter.rb#37 + def register_listener(listener, *notifications); end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#52 + def registered_listeners(notification); end + + # 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 + # @overload report + # @overload report + # @param expected_example_count [Integer] the number of examples being run + # @yield [Block] block yields itself for further reporting. + # + # source://rspec-core//lib/rspec/core/reporter.rb#71 + def report(expected_example_count); end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#89 + def start(expected_example_count, time = T.unsafe(nil)); end + + # @private + # + # source://rspec-core//lib/rspec/core/reporter.rb#200 + def stop; end + + private + + # source://rspec-core//lib/rspec/core/reporter.rb#242 + def close; end + + # source://rspec-core//lib/rspec/core/reporter.rb#233 + def ensure_listeners_ready; end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/reporter.rb#246 + def mute_profile_output?; end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/reporter.rb#252 + def seed_used?; end +end + +# @private +# +# source://rspec-core//lib/rspec/core/reporter.rb#6 +RSpec::Core::Reporter::RSPEC_NOTIFICATIONS = T.let(T.unsafe(nil), RSpec::Core::Set) + +# @private +# +# source://rspec-core//lib/rspec/core/ruby_project.rb#7 +module RSpec::Core::RubyProject + private + + # source://rspec-core//lib/rspec/core/ruby_project.rb#12 + def add_dir_to_load_path(dir); end + + # source://rspec-core//lib/rspec/core/ruby_project.rb#8 + def add_to_load_path(*dirs); end + + # source://rspec-core//lib/rspec/core/ruby_project.rb#28 + def ascend_until; end + + # source://rspec-core//lib/rspec/core/ruby_project.rb#20 + def determine_root; end + + # source://rspec-core//lib/rspec/core/ruby_project.rb#24 + def find_first_parent_containing(dir); end + + # source://rspec-core//lib/rspec/core/ruby_project.rb#16 + def root; end + + class << self + # source://rspec-core//lib/rspec/core/ruby_project.rb#12 + def add_dir_to_load_path(dir); end + + # source://rspec-core//lib/rspec/core/ruby_project.rb#8 + def add_to_load_path(*dirs); end + + # source://rspec-core//lib/rspec/core/ruby_project.rb#28 + def ascend_until; end + + # source://rspec-core//lib/rspec/core/ruby_project.rb#20 + def determine_root; end + + # source://rspec-core//lib/rspec/core/ruby_project.rb#24 + def find_first_parent_containing(dir); end + + # source://rspec-core//lib/rspec/core/ruby_project.rb#16 + def root; end + end +end + +# Provides the main entry point to run a suite of RSpec examples. +# +# source://rspec-core//lib/rspec/core/runner.rb#4 +class RSpec::Core::Runner + # @return [Runner] a new instance of Runner + # + # source://rspec-core//lib/rspec/core/runner.rb#75 + def initialize(options, configuration = T.unsafe(nil), world = T.unsafe(nil)); end + + # @attr_reader + # @private + # + # source://rspec-core//lib/rspec/core/runner.rb#7 + def configuration; end + + # @private + # + # source://rspec-core//lib/rspec/core/runner.rb#129 + def configure(err, out); end + + # @private + # + # source://rspec-core//lib/rspec/core/runner.rb#194 + def exit_code(examples_passed = T.unsafe(nil)); end + + # @attr_reader + # @private + # + # source://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 + # + # source://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. + # + # source://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 + # + # source://rspec-core//lib/rspec/core/runner.rb#98 + def setup(err, out); end + + # @attr_reader + # @private + # + # source://rspec-core//lib/rspec/core/runner.rb#7 + def world; end + + private + + # source://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`. + # + # source://rspec-core//lib/rspec/core/runner.rb#16 + def autorun; end + + # @private + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/runner.rb#141 + def autorun_disabled?; end + + # @private + # + # source://rspec-core//lib/rspec/core/runner.rb#136 + def disable_autorun!; end + + # @private + # + # source://rspec-core//lib/rspec/core/runner.rb#180 + def handle_interrupt; end + + # @private + # @return [Boolean] + # + # source://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. + # + # source://rspec-core//lib/rspec/core/runner.rb#43 + def invoke; end + + # @private + # + # source://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. + # + # source://rspec-core//lib/rspec/core/runner.rb#64 + def run(args, err = T.unsafe(nil), out = T.unsafe(nil)); end + + # @private + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/runner.rb#151 + def running_in_drb?; end + + # @private + # + # source://rspec-core//lib/rspec/core/runner.rb#175 + def trap_interrupt; end + end +end + +# 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. +# +# @private +# +# source://rspec-core//lib/rspec/core/set.rb#11 +class RSpec::Core::Set + include ::Enumerable + + # @return [Set] a new instance of Set + # + # source://rspec-core//lib/rspec/core/set.rb#14 + def initialize(array = T.unsafe(nil)); end + + # source://rspec-core//lib/rspec/core/set.rb#23 + def <<(key); end + + # source://rspec-core//lib/rspec/core/set.rb#48 + def clear; end + + # source://rspec-core//lib/rspec/core/set.rb#28 + def delete(key); end + + # source://rspec-core//lib/rspec/core/set.rb#32 + def each(&block); end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/set.rb#19 + def empty?; end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/set.rb#37 + def include?(key); end + + # source://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 +# +# source://rspec-core//lib/rspec/core/shared_context.rb#19 +module RSpec::Core::SharedContext + # @private + # + # source://rspec-core//lib/rspec/core/shared_context.rb#28 + def __shared_context_recordings; end + + # source://rspec-core//lib/rspec/core/shared_context.rb#42 + def after(*args, &block); end + + # source://rspec-core//lib/rspec/core/shared_context.rb#42 + def append_after(*args, &block); end + + # source://rspec-core//lib/rspec/core/shared_context.rb#42 + def append_before(*args, &block); end + + # source://rspec-core//lib/rspec/core/shared_context.rb#42 + def around(*args, &block); end + + # source://rspec-core//lib/rspec/core/shared_context.rb#42 + def before(*args, &block); end + + # source://rspec-core//lib/rspec/core/shared_context.rb#42 + def context(*args, &block); end + + # source://rspec-core//lib/rspec/core/shared_context.rb#42 + def describe(*args, &block); end + + # source://rspec-core//lib/rspec/core/shared_context.rb#42 + def hooks(*args, &block); end + + # @private + # + # source://rspec-core//lib/rspec/core/shared_context.rb#21 + def included(group); end + + # source://rspec-core//lib/rspec/core/shared_context.rb#42 + def let(*args, &block); end + + # source://rspec-core//lib/rspec/core/shared_context.rb#42 + def let!(*args, &block); end + + # source://rspec-core//lib/rspec/core/shared_context.rb#42 + def prepend_after(*args, &block); end + + # source://rspec-core//lib/rspec/core/shared_context.rb#42 + def prepend_before(*args, &block); end + + # source://rspec-core//lib/rspec/core/shared_context.rb#42 + def subject(*args, &block); end + + # source://rspec-core//lib/rspec/core/shared_context.rb#42 + def subject!(*args, &block); end + + class << self + # @private + # + # source://rspec-core//lib/rspec/core/shared_context.rb#40 + def record(methods); end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core/shared_context.rb#33 +class RSpec::Core::SharedContext::Recording < ::Struct + # Returns the value of attribute args + # + # @return [Object] the current value of args + def args; end + + # Sets the attribute args + # + # @param value [Object] the value to set the attribute args to. + # @return [Object] the newly set value + def args=(_); end + + # Returns the value of attribute block + # + # @return [Object] the current value of block + def block; end + + # Sets the attribute block + # + # @param value [Object] the value to set the attribute block to. + # @return [Object] the newly set value + def block=(_); end + + # Returns the value of attribute method_name + # + # @return [Object] the current value of method_name + def method_name; end + + # Sets the attribute method_name + # + # @param value [Object] the value to set the attribute method_name to. + # @return [Object] the newly set value + def method_name=(_); end + + # source://rspec-core//lib/rspec/core/shared_context.rb#34 + def playback_onto(group); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + 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. +# +# source://rspec-core//lib/rspec/core/shared_example_group.rb#57 +module RSpec::Core::SharedExampleGroup + # 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 + # @overload shared_examples + # @overload shared_examples + # @see ExampleGroup.it_behaves_like + # @see ExampleGroup.include_examples + # @see ExampleGroup.include_context + # + # source://rspec-core//lib/rspec/core/shared_example_group.rb#90 + def shared_context(name, *args, &block); end + + # 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 + # @overload shared_examples + # @overload shared_examples + # @see ExampleGroup.it_behaves_like + # @see ExampleGroup.include_examples + # @see ExampleGroup.include_context + # + # source://rspec-core//lib/rspec/core/shared_example_group.rb#90 + def shared_examples(name, *args, &block); end + + # 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 + # @overload shared_examples + # @overload shared_examples + # @see ExampleGroup.it_behaves_like + # @see ExampleGroup.include_examples + # @see ExampleGroup.include_context + # + # source://rspec-core//lib/rspec/core/shared_example_group.rb#90 + def shared_examples_for(name, *args, &block); end +end + +# @private +# +# source://rspec-core//lib/rspec/core/shared_example_group.rb#149 +class RSpec::Core::SharedExampleGroup::Registry + # source://rspec-core//lib/rspec/core/shared_example_group.rb#150 + def add(context, name, *metadata_args, &block); end + + # source://rspec-core//lib/rspec/core/shared_example_group.rb#174 + def find(lookup_contexts, name); end + + private + + # :nocov: + # + # source://rspec-core//lib/rspec/core/shared_example_group.rb#257 + def ensure_block_has_source_location(_block); end + + # :nocov: + # + # source://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. + # + # source://rspec-core//lib/rspec/core/shared_example_group.rb#189 + def legacy_add(context, name, *metadata_args, &block); end + + # source://rspec-core//lib/rspec/core/shared_example_group.rb#204 + def shared_example_groups; end + + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/shared_example_group.rb#208 + def valid_name?(candidate); end + + # source://rspec-core//lib/rspec/core/shared_example_group.rb#215 + def warn_if_key_taken(context, key, new_block); end +end + +# Shared examples top level DSL. +# +# @api private +# +# source://rspec-core//lib/rspec/core/shared_example_group.rb#106 +module RSpec::Core::SharedExampleGroup::TopLevelDSL + class << self + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/shared_example_group.rb#108 + def definitions; end + + # Adds the top level DSL methods to Module and the top level binding. + # + # @api private + # + # source://rspec-core//lib/rspec/core/shared_example_group.rb#126 + def expose_globally!; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-core//lib/rspec/core/shared_example_group.rb#119 + def exposed_globally?; end + + # Removes the top level DSL methods to Module and the top level binding. + # + # @api private + # + # source://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. +# +# source://rspec-core//lib/rspec/core/example_group.rb#782 +class RSpec::Core::SharedExampleGroupInclusionStackFrame + # @private + # @return [SharedExampleGroupInclusionStackFrame] a new instance of SharedExampleGroupInclusionStackFrame + # + # source://rspec-core//lib/rspec/core/example_group.rb#789 + 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. + # + # source://rspec-core//lib/rspec/core/example_group.rb#805 + def description; end + + # @return [String] The {#inclusion_location}, formatted for display by a formatter. + # + # source://rspec-core//lib/rspec/core/example_group.rb#795 + def formatted_inclusion_location; end + + # @return [String] the location where the shared example was included + # + # source://rspec-core//lib/rspec/core/example_group.rb#786 + def inclusion_location; end + + # @return [String] the name of the shared example group + # + # source://rspec-core//lib/rspec/core/example_group.rb#784 + def shared_group_name; end + + class << self + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#811 + def current_backtrace; end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#829 + def shared_example_group_inclusions; end + + # @private + # + # source://rspec-core//lib/rspec/core/example_group.rb#816 + 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. +# +# source://rspec-core//lib/rspec/core/shared_example_group.rb#9 +class RSpec::Core::SharedExampleGroupModule < ::Module + # @return [SharedExampleGroupModule] a new instance of SharedExampleGroupModule + # + # source://rspec-core//lib/rspec/core/shared_example_group.rb#13 + def initialize(description, definition, metadata); end + + # @private + # + # source://rspec-core//lib/rspec/core/shared_example_group.rb#11 + def definition; end + + # @private + # + # source://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. + # + # source://rspec-core//lib/rspec/core/shared_example_group.rb#28 + def included(klass); end + + # Provides a human-readable representation of this module. + # + # source://rspec-core//lib/rspec/core/shared_example_group.rb#20 + def inspect; end + + # Provides a human-readable representation of this module. + # + # source://rspec-core//lib/rspec/core/shared_example_group.rb#20 + def to_s; end +end + +# Deals with the fact that `shellwords` only works on POSIX systems. +# +# @private +# +# source://rspec-core//lib/rspec/core/shell_escape.rb#5 +module RSpec::Core::ShellEscape + private + + # source://rspec-core//lib/rspec/core/shell_escape.rb#32 + def conditionally_quote(id); end + + # :nocov: + # + # source://rspec-core//lib/rspec/core/shell_escape.rb#19 + def escape(shell_command); end + + # source://rspec-core//lib/rspec/core/shell_escape.rb#8 + def quote(argument); end + + # source://rspec-core//lib/rspec/core/shell_escape.rb#37 + def shell_allows_unquoted_ids?; end + + class << self + # source://rspec-core//lib/rspec/core/shell_escape.rb#32 + def conditionally_quote(id); end + + # source://rspec-core//lib/rspec/core/shell_escape.rb#19 + def escape(shell_command); end + + # source://rspec-core//lib/rspec/core/shell_escape.rb#8 + def quote(argument); end + + # @return [Boolean] + # + # source://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 +# +# source://rspec-core//lib/rspec/core/shell_escape.rb#30 +RSpec::Core::ShellEscape::SHELLS_ALLOWING_UNQUOTED_IDS = T.let(T.unsafe(nil), Array) + +# Provides an execution context for before/after :suite hooks. +# +# @private +# +# source://rspec-core//lib/rspec/core/example.rb#651 +class RSpec::Core::SuiteHookContext < ::RSpec::Core::Example + # @return [SuiteHookContext] a new instance of SuiteHookContext + # + # source://rspec-core//lib/rspec/core/example.rb#652 + def initialize(hook_description, reporter); end + + # source://rspec-core//lib/rspec/core/example.rb#659 + def set_exception(exception); end +end + +# This avoids issues with reporting time caused by examples that +# change the value/meaning of Time.now without properly restoring +# it. +# +# @private +# +# source://rspec-core//lib/rspec/core.rb#174 +class RSpec::Core::Time + class << self + def now(in: T.unsafe(nil)); end + end +end + +# Version information for RSpec Core. +# +# source://rspec-core//lib/rspec/core/version.rb#4 +module RSpec::Core::Version; end + +# Current version of RSpec Core, in semantic versioning format. +# +# source://rspec-core//lib/rspec/core/version.rb#6 +RSpec::Core::Version::STRING = T.let(T.unsafe(nil), String) + +# @private +# +# source://rspec-core//lib/rspec/core/warnings.rb#6 +module RSpec::Core::Warnings + # Used internally to print deprecation warnings. + # + # @private + # + # source://rspec-core//lib/rspec/core/warnings.rb#10 + def deprecate(deprecated, data = T.unsafe(nil)); end + + # Used internally to print deprecation warnings. + # + # @private + # + # source://rspec-core//lib/rspec/core/warnings.rb#22 + def warn_deprecation(message, opts = T.unsafe(nil)); end + + # @private + # + # source://rspec-core//lib/rspec/core/warnings.rb#27 + def warn_with(message, options = T.unsafe(nil)); end +end + +# Internal container for global non-configuration data. +# +# @api private +# +# source://rspec-core//lib/rspec/core/world.rb#6 +class RSpec::Core::World + # @api private + # @return [World] a new instance of World + # + # source://rspec-core//lib/rspec/core/world.rb#26 + def initialize(configuration = T.unsafe(nil)); end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/world.rb#115 + def all_example_groups; end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/world.rb#120 + def all_examples; end + + # Add exclusion filters to announcement message. + # + # @api private + # + # source://rspec-core//lib/rspec/core/world.rb#226 + def announce_exclusion_filter(announcements); end + + # Notify reporter of filters. + # + # @api private + # + # source://rspec-core//lib/rspec/core/world.rb#171 + def announce_filters; end + + # Add inclusion filters to announcement message. + # + # @api private + # + # source://rspec-core//lib/rspec/core/world.rb#217 + def announce_inclusion_filter(announcements); end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/world.rb#210 + def everything_filtered_message; end + + # Get count of examples to be run. + # + # @api private + # + # source://rspec-core//lib/rspec/core/world.rb#109 + def example_count(groups = T.unsafe(nil)); end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/world.rb#8 + def example_group_counts_by_spec_file; end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/world.rb#8 + def example_groups; end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/world.rb#102 + def exclusion_filter; end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/world.rb#69 + def filter_manager; end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/world.rb#8 + def filtered_examples; end + + # @api private + # @private + # + # source://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. + # + # @api private + # @private + # + # source://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. + # + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/world.rb#24 + def non_example_failure=(_arg0); end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/world.rb#87 + def num_example_groups_defined_in(file); end + + # Apply ordering strategy from configuration to example groups. + # + # @api private + # + # source://rspec-core//lib/rspec/core/world.rb#52 + def ordered_example_groups; end + + # Find line number of previous declaration. + # + # @api private + # + # source://rspec-core//lib/rspec/core/world.rb#140 + def preceding_declaration_line(absolute_file_name, filter_line); end + + # 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. + # + # @api public + # + # source://rspec-core//lib/rspec/core/world.rb#43 + def prepare_example_filtering; end + + # Records an example group. + # + # @api private + # + # source://rspec-core//lib/rspec/core/world.rb#81 + def record(example_group); end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/world.rb#74 + def registered_example_group_files; end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/world.rb#205 + def report_filter_message(message); end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/world.rb#149 + def reporter; end + + # Reset world to 'scratch' before running suite. + # + # @api private + # + # source://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". + # + # @api private + # @private + # + # source://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". + # + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/world.rb#18 + def rspec_is_quitting=(_arg0); end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/world.rb#92 + def shared_example_group_registry; end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/world.rb#154 + def source_from_file(path); end + + # @api private + # @private + # + # source://rspec-core//lib/rspec/core/world.rb#164 + def syntax_highlighter; end + + # 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. + # + # @api private + # @private + # + # source://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. + # + # @api private + # + # source://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. + # + # @api private + # + # source://rspec-core//lib/rspec/core/world.rb#11 + def wants_to_quit=(_arg0); end + + private + + # @api private + # + # source://rspec-core//lib/rspec/core/world.rb#234 + def descending_declaration_line_numbers_by_file; end + + # @api private + # + # source://rspec-core//lib/rspec/core/world.rb#252 + def fail_if_config_and_cli_options_invalid; end +end + +# Provides a null implementation for initial use by configuration. +# +# @api private +# @private +# +# source://rspec-core//lib/rspec/core/world.rb#264 +module RSpec::Core::World::Null + class << self + # @api private + # + # source://rspec-core//lib/rspec/core/world.rb#280 + def all_example_groups; end + + # :nocov: + # + # @api private + # + # source://rspec-core//lib/rspec/core/world.rb#276 + def example_groups; end + + # @api private + # + # source://rspec-core//lib/rspec/core/world.rb#265 + def non_example_failure; end + + # @api private + # + # source://rspec-core//lib/rspec/core/world.rb#266 + def non_example_failure=(_); end + + # @api private + # + # source://rspec-core//lib/rspec/core/world.rb#268 + def registered_example_group_files; end + + # @api private + # + # source://rspec-core//lib/rspec/core/world.rb#272 + def traverse_example_group_trees_until; end + end +end + +# Namespace for the example group subclasses generated by top-level +# `describe`. +# +# @private +# +# source://rspec-core//lib/rspec/core/example_group.rb#839 +module RSpec::ExampleGroups + extend ::RSpec::Support::RecursiveConstMethods + + class << self + # source://rspec-core//lib/rspec/core/example_group.rb#842 + def assign_const(group); end + + # source://rspec-core//lib/rspec/core/example_group.rb#862 + def base_name_for(group); end + + # source://rspec-core//lib/rspec/core/example_group.rb#850 + def constant_scope_for(group); end + + # source://rspec-core//lib/rspec/core/example_group.rb#895 + def disambiguate(name, const_scope); end + + # source://rspec-core//lib/rspec/core/example_group.rb#856 + def remove_all_constants; end + end +end + +# @private +# +# source://rspec-core//lib/rspec/core.rb#187 +RSpec::MODULES_TO_AUTOLOAD = T.let(T.unsafe(nil), Hash) + +# @private +# +# source://rspec-core//lib/rspec/core/shared_context.rb#54 +RSpec::SharedContext = RSpec::Core::SharedContext diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec-expectations@3.13.3.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec-expectations@3.13.3.rbi new file mode 100644 index 0000000..6f12608 --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec-expectations@3.13.3.rbi @@ -0,0 +1,8183 @@ +# 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. +# +# source://rspec-expectations//lib/rspec/matchers/english_phrasing.rb#1 +module RSpec + class << self + # source://rspec-core/3.13.1/lib/rspec/core.rb#70 + def clear_examples; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#85 + def configuration; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#49 + def configuration=(_arg0); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#97 + def configure; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#194 + def const_missing(name); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def context(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#122 + def current_example; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#128 + def current_example=(example); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#154 + def current_scope; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#134 + def current_scope=(scope); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def describe(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def example_group(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def fcontext(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def fdescribe(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#58 + def reset; end + + # source://rspec-core/3.13.1/lib/rspec/core/shared_example_group.rb#110 + def shared_context(name, *args, &block); end + + # source://rspec-core/3.13.1/lib/rspec/core/shared_example_group.rb#110 + def shared_examples(name, *args, &block); end + + # source://rspec-core/3.13.1/lib/rspec/core/shared_example_group.rb#110 + def shared_examples_for(name, *args, &block); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#160 + def world; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#49 + def world=(_arg0); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def xcontext(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def xdescribe(*args, &example_group_block); end + end +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. +# +# source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#2 +module RSpec::Expectations + class << self + # The configuration object. + # + # @return [RSpec::Expectations::Configuration] the configuration object + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#228 + def configuration; end + + # @private + # + # source://rspec-expectations//lib/rspec/expectations/fail_with.rb#13 + def differ; end + + # Raises an RSpec::Expectations::ExpectationNotMetError with message. + # Adds a diff to the failure message when `expected` and `actual` are + # both present. + # + # @param message [String] + # @param expected [Object] + # @param actual [Object] + # + # source://rspec-expectations//lib/rspec/expectations/fail_with.rb#27 + def fail_with(message, expected = T.unsafe(nil), actual = T.unsafe(nil)); end + end +end + +# 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. +# +# @private +# +# source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#136 +class RSpec::Expectations::BlockExpectationTarget < ::RSpec::Expectations::ExpectationTarget + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#142 + def not_to(matcher, message = T.unsafe(nil), &block); end + + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#137 + def to(matcher, message = T.unsafe(nil), &block); end + + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#142 + def to_not(matcher, message = T.unsafe(nil), &block); end + + private + + # @raise [ExpectationNotMetError] + # + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#150 + def enforce_block_expectation(matcher); end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#158 + def supports_block_expectations?(matcher); end +end + +# @private +# +# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#4 +class RSpec::Expectations::BlockSnippetExtractor + # @return [BlockSnippetExtractor] a new instance of BlockSnippetExtractor + # + # source://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. + # + # source://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. + # + # source://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. + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#7 + def proc; end + + private + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#62 + def beginning_line_number; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#39 + def block_token_extractor; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#58 + def file_path; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#31 + def raw_body_lines; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#35 + def raw_body_snippet; end + + # @raise [TargetNotFoundError] + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#44 + def source; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#66 + def source_location; end + + class << self + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#9 + def try_extracting_single_line_body_of(proc, method_name); end + end +end + +# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#72 +class RSpec::Expectations::BlockSnippetExtractor::AmbiguousTargetError < ::RSpec::Expectations::BlockSnippetExtractor::Error; end + +# Locates target block with node information (semantics), which tokens don't have. +# +# @private +# +# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200 +class RSpec::Expectations::BlockSnippetExtractor::BlockLocator < ::Struct + # Returns the value of attribute beginning_line_number + # + # @return [Object] the current value of beginning_line_number + def beginning_line_number; end + + # Sets the attribute beginning_line_number + # + # @param value [Object] the value to set the attribute beginning_line_number to. + # @return [Object] the newly set value + def beginning_line_number=(_); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#205 + def body_content_locations; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#201 + def method_call_location; end + + # Returns the value of attribute method_name + # + # @return [Object] the current value of method_name + def method_name; end + + # Sets the attribute method_name + # + # @param value [Object] the value to set the attribute method_name to. + # @return [Object] the newly set value + def method_name=(_); end + + # Returns the value of attribute source + # + # @return [Object] the current value of source + def source; end + + # Sets the attribute source + # + # @param value [Object] the value to set the attribute source to. + # @return [Object] the newly set value + def source=(_); end + + private + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#218 + def block_body_node; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#223 + def block_wrapper_node; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#234 + def candidate_block_wrapper_nodes; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#243 + def candidate_method_ident_nodes; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#211 + def method_ident_node; end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#249 + def method_ident_node?(node); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# Performs extraction of block body snippet using tokens, +# which cannot be done with node information. +# +# @private +# +# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77 +class RSpec::Expectations::BlockSnippetExtractor::BlockTokenExtractor < ::Struct + # @return [BlockTokenExtractor] a new instance of BlockTokenExtractor + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#80 + def initialize(*_arg0); end + + # Returns the value of attribute beginning_line_number + # + # @return [Object] the current value of beginning_line_number + def beginning_line_number; end + + # Sets the attribute beginning_line_number + # + # @param value [Object] the value to set the attribute beginning_line_number to. + # @return [Object] the newly set value + def beginning_line_number=(_); end + + # Returns the value of attribute body_tokens. + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#78 + def body_tokens; end + + # Returns the value of attribute method_name + # + # @return [Object] the current value of method_name + def method_name; end + + # Sets the attribute method_name + # + # @param value [Object] the value to set the attribute method_name to. + # @return [Object] the newly set value + def method_name=(_); end + + # Returns the value of attribute source + # + # @return [Object] the current value of source + def source; end + + # Sets the attribute source + # + # @param value [Object] the value to set the attribute source to. + # @return [Object] the newly set value + def source=(_); end + + # Returns the value of attribute state. + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#78 + def state; end + + private + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#126 + def after_beginning_of_args_state(token); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#130 + def after_beginning_of_body_state(token); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#109 + def after_method_call_state(token); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#113 + def after_opener_state(token); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#193 + def block_locator; end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#187 + def correct_block?(body_tokens); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#143 + def finalize_pending_tokens!; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#97 + def finish!; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#149 + def finish_or_find_next_block_if_incorrect!; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#170 + def handle_closer_token(token); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#160 + def handle_opener_token(token); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#105 + def initial_state(token); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#101 + def invoke_state_handler(token); end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#166 + def opener_token?(token); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#179 + def opener_token_stack; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#87 + def parse!; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#139 + def pending_tokens; end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#183 + def pipe_token?(token); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#70 +class RSpec::Expectations::BlockSnippetExtractor::Error < ::StandardError; end + +# source://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 +# +# source://rspec-expectations//lib/rspec/expectations/configuration.rb#20 +class RSpec::Expectations::Configuration + # @return [Configuration] a new instance of Configuration + # + # source://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 modules [Array] the list of classes or modules + # to add `should` and `should_not` to. + # + # source://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). + # + # source://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). + # + # source://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. + # + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#88 + def color?; end + + # @private + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#221 + def false_positives_handler; end + + # Sets if custom matcher descriptions and failure messages + # should include clauses from methods defined using `chain`. + # + # @param value [Boolean] + # + # source://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. + # + # @return [Boolean] + # + # source://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. + # + # @example + # RSpec.configure do |rspec| + # rspec.expect_with :rspec do |c| + # c.max_formatted_output_length = 200 + # end + # end + # @param length [Fixnum] the number of characters to limit the formatted output to. + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#70 + def max_formatted_output_length=(length); end + + # Indicates what RSpec will do about matcher use which will + # potentially cause false positives in tests, generally you want to + # avoid such scenarios so this defaults to `true`. + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#211 + def on_potential_false_positives; end + + # Configures what RSpec will do about matcher use which will + # potentially cause false positives in tests. + # + # @param behavior [Symbol] can be set to :warn, :raise or :nothing + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#187 + def on_potential_false_positives=(behavior); end + + # @private + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#155 + def reset_syntaxes_to_default; end + + # Returns the value of attribute strict_predicate_matchers. + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#202 + def strict_predicate_matchers; 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. + # + # @raise [ArgumentError] + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#197 + def strict_predicate_matchers=(flag); end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#204 + def strict_predicate_matchers?; end + + # 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 + # @return [Array] the list of configured syntaxes. + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#80 + def syntax; end + + # Configures the supported syntax. + # + # @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 + # @param values [Array, Symbol] the syntaxes to enable + # + # source://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] + # + # source://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`. + # + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#216 + def warn_about_potential_false_positives?; end +end + +# @private +# +# source://rspec-expectations//lib/rspec/expectations/configuration.rb#22 +RSpec::Expectations::Configuration::FALSE_POSITIVE_BEHAVIOURS = T.let(T.unsafe(nil), Hash) + +# Null implementation of a backtrace formatter used by default +# when rspec-core is not loaded. Does no filtering. +# +# @api private +# +# source://rspec-expectations//lib/rspec/expectations/configuration.rb#163 +module RSpec::Expectations::Configuration::NullBacktraceFormatter + class << self + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#164 + def format_backtrace(backtrace); end + end +end + +# @private +# +# source://rspec-expectations//lib/rspec/expectations/handler.rb#4 +module RSpec::Expectations::ExpectationHelper + class << self + # source://rspec-expectations//lib/rspec/expectations/handler.rb#5 + def check_message(msg); end + + # source://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 + # + # source://rspec-expectations//lib/rspec/expectations/handler.rb#18 + def modern_matcher_from(matcher); end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#23 + def with_matcher(handler, matcher, message); end + end +end + +# Exception raised when an expectation fails. +# +# the user sets an expectation, it can't be caught in their +# code by a bare `rescue`. +# +# @api public +# @note We subclass Exception so that in a stub implementation if +# +# source://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. +# +# source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#17 +class RSpec::Expectations::ExpectationTarget + include ::RSpec::Expectations::ExpectationTarget::InstanceMethods + + # @api private + # @return [ExpectationTarget] a new instance of ExpectationTarget + # + # source://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 + # + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#28 + def target; end + + class << self + # @private + # + # source://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. +# +# source://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 message [String, Proc] optional message to display when the expectation fails + # @return [Boolean] false if the negative expectation succeeds (else raises) + # @see RSpec::Matchers + # + # source://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 message [String, Proc] optional message to display when the expectation fails + # @return [Boolean] true if the expectation succeeds (else raises) + # @see RSpec::Matchers + # + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#63 + def to(matcher = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # Runs the given expectation, passing if `matcher` returns false. + # + # @example + # expect(value).not_to eq(5) + # @param matcher [Matcher] + # @param message [String, Proc] optional message to display when the expectation fails + # @return [Boolean] false if the negative expectation succeeds (else raises) + # @see RSpec::Matchers + # + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#76 + def to_not(matcher = T.unsafe(nil), message = T.unsafe(nil), &block); end + + private + + # @raise [ArgumentError] + # + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#84 + def prevent_operator_matchers(verb); 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 +# `nil` is a valid value to pass. +# +# @private +# +# source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#22 +module RSpec::Expectations::ExpectationTarget::UndefinedValue; end + +# @private +# +# source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#4 +class RSpec::Expectations::FailureAggregator + # @return [FailureAggregator] a new instance of FailureAggregator + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#97 + def initialize(block_label, metadata); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#27 + def aggregate; end + + # Returns the value of attribute block_label. + # + # source://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`. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#64 + def call(failure, options); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#54 + def failures; end + + # Returns the value of attribute metadata. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#5 + def metadata; end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#58 + def other_errors; end + + private + + # Using `caller` performs better (and is simpler) than `raise` on most Rubies. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#92 + def assign_backtrace(failure); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#103 + def notify_aggregated_failures; end +end + +# source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#25 +RSpec::Expectations::FailureAggregator::AGGREGATED_FAILURE = T.let(T.unsafe(nil), RSpec::Expectations::FailureAggregator::AggregatedFailure) + +# @private +# +# source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#8 +class RSpec::Expectations::FailureAggregator::AggregatedFailure + # source://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 +# +# source://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 +# +# source://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 +# +# source://rspec-expectations//lib/rspec/expectations/handler.rb#112 +class RSpec::Expectations::LegacyMatcherAdapter < ::RSpec::Matchers::MatcherDelegator + # @return [LegacyMatcherAdapter] a new instance of LegacyMatcherAdapter + # + # source://rspec-expectations//lib/rspec/expectations/handler.rb#113 + def initialize(matcher); end + + class << self + # source://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 +# +# source://rspec-expectations//lib/rspec/expectations/handler.rb#156 +class RSpec::Expectations::LegacyMatcherAdapter::RSpec1 < ::RSpec::Expectations::LegacyMatcherAdapter + # source://rspec-expectations//lib/rspec/expectations/handler.rb#157 + def failure_message; end + + # source://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. + # + # @return [Boolean] + # + # source://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 +# +# source://rspec-expectations//lib/rspec/expectations/handler.rb#132 +class RSpec::Expectations::LegacyMatcherAdapter::RSpec2 < ::RSpec::Expectations::LegacyMatcherAdapter + # source://rspec-expectations//lib/rspec/expectations/handler.rb#133 + def failure_message; end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#137 + def failure_message_when_negated; end + + class << self + # @return [Boolean] + # + # source://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. +# +# source://rspec-expectations//lib/rspec/expectations.rb#76 +class RSpec::Expectations::MultipleExpectationsNotMetError < ::RSpec::Expectations::ExpectationNotMetError + # @return [MultipleExpectationsNotMetError] a new instance of MultipleExpectationsNotMetError + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#160 + def initialize(failure_aggregator); end + + # @return [String] The user-assigned label for the aggregation block. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#135 + def aggregation_block_label; end + + # @return [Hash] The metadata hash passed to `aggregate_failures`. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#140 + def aggregation_metadata; end + + # @return [Array] The list of expectation failures and other exceptions, combined. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#132 + def all_exceptions; end + + # return [String] A description of the failure/error counts. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#151 + def exception_count_description; end + + # @return [Array] The list of expectation failures. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#122 + def failures; end + + # @return [String] The fully formatted exception message. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#117 + def message; end + + # @return [Array] The list of other exceptions. + # + # source://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. + # + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#145 + def summary; end + + private + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#192 + def backtrace_line(line); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#165 + def block_description; end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#174 + def enumerated(exceptions, index_offset); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#204 + def enumerated_errors; end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#200 + def enumerated_failures; end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#182 + def exclusion_patterns; end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#188 + def format_backtrace(backtrace); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#219 + def indentation; end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#210 + def indented(failure_message, index); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#231 + def index_label(index); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#223 + def longest_index_label_width; end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#170 + def pluralize(noun, count); end + + # source://rspec-expectations//lib/rspec/expectations/failure_aggregator.rb#227 + def width_of_label(index); end +end + +# @private +# +# source://rspec-expectations//lib/rspec/expectations/handler.rb#73 +class RSpec::Expectations::NegativeExpectationHandler + class << self + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/handler.rb#87 + def does_not_match?(matcher, actual, &block); end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#74 + def handle_matcher(actual, initial_matcher, custom_message = T.unsafe(nil), &block); end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#103 + def opposite_should_method; end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#99 + def should_method; end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#95 + def verb; end + end +end + +# @private +# +# source://rspec-expectations//lib/rspec/expectations/handler.rb#45 +class RSpec::Expectations::PositiveExpectationHandler + class << self + # source://rspec-expectations//lib/rspec/expectations/handler.rb#46 + def handle_matcher(actual, initial_matcher, custom_message = T.unsafe(nil), &block); end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#67 + def opposite_should_method; end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#63 + def should_method; end + + # source://rspec-expectations//lib/rspec/expectations/handler.rb#59 + def verb; end + end +end + +# Provides methods for enabling and disabling the available +# syntaxes provided by rspec-expectations. +# +# @api private +# +# source://rspec-expectations//lib/rspec/expectations/syntax.rb#6 +module RSpec::Expectations::Syntax + private + + # Determines where we add `should` and `should_not`. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#11 + def default_should_host; end + + # Disables the `expect` syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#80 + def disable_expect(syntax_host = T.unsafe(nil)); end + + # Disables the `should` syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#57 + def disable_should(syntax_host = T.unsafe(nil)); end + + # Enables the `expect` syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#68 + def enable_expect(syntax_host = T.unsafe(nil)); end + + # Enables the `should` syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#38 + def enable_should(syntax_host = T.unsafe(nil)); end + + # Indicates whether or not the `expect` syntax is enabled. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#96 + def expect_enabled?(syntax_host = T.unsafe(nil)); end + + # Indicates whether or not the `should` syntax is enabled. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#90 + def should_enabled?(syntax_host = T.unsafe(nil)); end + + # Instructs rspec-expectations to warn on first usage of `should` or `should_not`. + # Enabled by default. This is largely here to facilitate testing. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#18 + def warn_about_should!; end + + # Generates a deprecation warning for the given method if no warning + # has already been issued. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#25 + def warn_about_should_unless_configured(method_name); end + + class << self + # Determines where we add `should` and `should_not`. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#11 + def default_should_host; end + + # Disables the `expect` syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#80 + def disable_expect(syntax_host = T.unsafe(nil)); end + + # Disables the `should` syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#57 + def disable_should(syntax_host = T.unsafe(nil)); end + + # Enables the `expect` syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#68 + def enable_expect(syntax_host = T.unsafe(nil)); end + + # Enables the `should` syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#38 + def enable_should(syntax_host = T.unsafe(nil)); end + + # Indicates whether or not the `expect` syntax is enabled. + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#96 + def expect_enabled?(syntax_host = T.unsafe(nil)); end + + # Indicates whether or not the `should` syntax is enabled. + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#90 + def should_enabled?(syntax_host = T.unsafe(nil)); end + + # Instructs rspec-expectations to warn on first usage of `should` or `should_not`. + # Enabled by default. This is largely here to facilitate testing. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#18 + def warn_about_should!; end + + # Generates a deprecation warning for the given method if no warning + # has already been issued. + # + # @api private + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#25 + def warn_about_should_unless_configured(method_name); end + end +end + +# 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. +# +# @private +# +# source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#98 +class RSpec::Expectations::ValueExpectationTarget < ::RSpec::Expectations::ExpectationTarget + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#104 + def not_to(matcher = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#99 + def to(matcher = T.unsafe(nil), message = T.unsafe(nil), &block); end + + private + + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#111 + def enforce_value_expectation(matcher); end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#126 + def supports_value_expectations?(matcher); end +end + +# @private +# +# source://rspec-expectations//lib/rspec/expectations/version.rb#4 +module RSpec::Expectations::Version; end + +# source://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`. +# +# source://rspec-expectations//lib/rspec/matchers/english_phrasing.rb#2 +module RSpec::Matchers + extend ::RSpec::Matchers::DSL + + # Applied to a proc, specifies that its execution will cause some value to + # change. + # + # 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` + # + # == 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`. + # + # @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) + # @param receiver [Object] + # @param message [Symbol] the message to send the receiver + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_block_changing(*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`. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_block_outputting(*args, **_arg1, &block); 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 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_block_raising(*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') + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_block_throwing(*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. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_block_yielding_control(*args, **_arg1, &block); 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. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_block_yielding_successive_args(*args, **_arg1, &block); 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. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_block_yielding_with_args(*args, **_arg1, &block); 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. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_block_yielding_with_no_args(*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. + # + # @example + # expect([1, 2, 3]).to contain_exactly(1, 2, 3) + # expect([1, 2, 3]).to contain_exactly(1, 3, 2) + # @note This is also available using the `=~` operator with `should`, + # but `=~` is not supported with `expect`. + # @see #match_array + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_collection_containing_exactly(*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 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_collection_ending_with(*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) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_collection_including(*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 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_collection_starting_with(*args, **_arg1, &block); end + + # Passes if actual is falsey (false or nil) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_falsey_value(*args, **_arg1, &block); end + + # Passes if actual is falsey (false or nil) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_falsy_value(*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) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_hash_including(*args, **_arg1, &block); 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) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_kind_of(*args, **_arg1, &block); end + + # Passes if actual is nil + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_nil_value(*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. + # + # ### Warning:: Ruby >= 1.9 only + # + # @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 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_range_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 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_string_ending_with(*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) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_string_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. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_string_matching(*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 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_string_starting_with(*args, **_arg1, &block); end + + # Passes if actual is truthy (anything but false or nil) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_truthy_value(*args, **_arg1, &block); end + + # 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. + # + # @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) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_value(*args, **_arg1, &block); 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 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def a_value_between(*args, **_arg1, &block); 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) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + 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). + # + # @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. + # @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. + # @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. + # @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. + # + # source://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 + # @example + # expect([1, 3, 5]).to all( be_odd.and be_an(Integer) ) + # @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. + # + # source://rspec-expectations//lib/rspec/matchers.rb#662 + def all(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 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_array_matching(*args, **_arg1, &block); 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) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_instance_of(*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) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_object_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) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_object_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 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_object_equal_to(*args, **_arg1, &block); end + + # Passes if `actual.exist?` or `actual.exists?` + # + # @example + # expect(File).to exist("path/to/file") + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_object_existing(*args, **_arg1, &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) ) + # @example + # expect(person).to have_attributes(:color => "red") + # @note It will fail if actual doesn't respond to any of the expected attributes. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_object_having_attributes(*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. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_object_matching(*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) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_object_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. + # + # @example + # expect(5).to satisfy { |n| n > 3 } + # expect(5).to satisfy("be greater than 3") { |n| n > 3 } + # @param description [String] optional description to be used for this matcher. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def an_object_satisfying(*args, **_arg1, &block); end + + # 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. + # + # @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) + # + # source://rspec-expectations//lib/rspec/matchers.rb#349 + def be(*args); end + + # passes if target.kind_of?(klass) + # + # source://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) + # + # source://rspec-expectations//lib/rspec/matchers.rb#378 + def be_a_kind_of(expected); end + + # passes if target.kind_of?(klass) + # + # source://rspec-expectations//lib/rspec/matchers.rb#355 + 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) + # + # source://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 + # + # source://rspec-expectations//lib/rspec/matchers.rb#395 + def be_between(min, max); end + + # Passes if actual is falsey (false or nil) + # + # source://rspec-expectations//lib/rspec/matchers.rb#316 + def be_falsey; end + + # Passes if actual is falsey (false or nil) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def be_falsy(*args, **_arg1, &block); 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) + # + # source://rspec-expectations//lib/rspec/matchers.rb#366 + def be_instance_of(expected); 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) + # + # source://rspec-expectations//lib/rspec/matchers.rb#378 + def be_kind_of(expected); end + + # Passes if actual is nil + # + # source://rspec-expectations//lib/rspec/matchers.rb#324 + def be_nil; end + + # Passes if actual is truthy (anything but false or nil) + # + # source://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) + # + # source://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. + # + # 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` + # + # == 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`. + # + # @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) + # @param receiver [Object] + # @param message [Symbol] the message to send the receiver + # + # source://rspec-expectations//lib/rspec/matchers.rb#492 + def change(receiver = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # Applied to a proc, specifies that its execution will cause some value to + # change. + # + # 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` + # + # == 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`. + # + # @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) + # @param receiver [Object] + # @param message [Symbol] the message to send the receiver + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + 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. + # + # @example + # expect([1, 2, 3]).to contain_exactly(1, 2, 3) + # expect([1, 2, 3]).to contain_exactly(1, 3, 2) + # @note This is also available using the `=~` operator with `should`, + # but `=~` is not supported with `expect`. + # @see #match_array + # + # source://rspec-expectations//lib/rspec/matchers.rb#510 + def contain_exactly(*items); 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. + # + # @example + # expect([1, 2, 3]).to contain_exactly(1, 2, 3) + # expect([1, 2, 3]).to contain_exactly(1, 3, 2) + # @note This is also available using the `=~` operator with `should`, + # but `=~` is not supported with `expect`. + # @see #match_array + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + 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. + # + # ### Warning:: Ruby >= 1.9 only + # + # @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 + # + # source://rspec-expectations//lib/rspec/matchers.rb#528 + def cover(*values); 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. + # + # ### Warning:: Ruby >= 1.9 only + # + # @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 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + 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 + # + # source://rspec-expectations//lib/rspec/matchers.rb#543 + def end_with(*expected); 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 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + 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) + # + # source://rspec-expectations//lib/rspec/matchers.rb#558 + def eq(expected); 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) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + 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) + # + # source://rspec-expectations//lib/rspec/matchers.rb#572 + def eql(expected); 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) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + 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 + # + # source://rspec-expectations//lib/rspec/matchers.rb#586 + def equal(expected); 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 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def equal_to(*args, **_arg1, &block); end + + # Passes if `actual.exist?` or `actual.exists?` + # + # @example + # expect(File).to exist("path/to/file") + # + # source://rspec-expectations//lib/rspec/matchers.rb#596 + def exist(*args); end + + # Passes if `actual.exist?` or `actual.exists?` + # + # @example + # expect(File).to exist("path/to/file") + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def existing(*args, **_arg1, &block); end + + # Supports `expect(actual).to matcher` syntax by wrapping `actual` in an + # `ExpectationTarget`. + # + # @example + # expect(actual).to eq(expected) + # expect(actual).not_to eq(expected) + # @return [Expectations::ExpectationTarget] + # @see Expectations::ExpectationTarget#to + # @see Expectations::ExpectationTarget#not_to + # + # source://rspec-expectations//lib/rspec/expectations/syntax.rb#72 + 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) ) + # @example + # expect(person).to have_attributes(:color => "red") + # @note It will fail if actual doesn't respond to any of the expected attributes. + # + # source://rspec-expectations//lib/rspec/matchers.rb#616 + def have_attributes(expected); 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) ) + # @example + # expect(person).to have_attributes(:color => "red") + # @note It will fail if actual doesn't respond to any of the expected attributes. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + 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) + # + # source://rspec-expectations//lib/rspec/matchers.rb#639 + def include(*expected); 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) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + 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. + # + # source://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 + # + # source://rspec-expectations//lib/rspec/matchers.rb#715 + def match_array(items); 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. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def match_regex(*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. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + 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`. + # + # source://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 + # + # source://rspec-expectations//lib/rspec/matchers.rb#773 + def raise_error(error = T.unsafe(nil), message = T.unsafe(nil), &block); 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 + # + # source://rspec-expectations//lib/rspec/matchers.rb#773 + def raise_exception(error = T.unsafe(nil), message = T.unsafe(nil), &block); 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 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + 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) + # + # source://rspec-expectations//lib/rspec/matchers.rb#792 + def respond_to(*names); 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) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + 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. + # + # @example + # expect(5).to satisfy { |n| n > 3 } + # expect(5).to satisfy("be greater than 3") { |n| n > 3 } + # @param description [String] optional description to be used for this matcher. + # + # source://rspec-expectations//lib/rspec/matchers.rb#813 + def satisfy(description = T.unsafe(nil), &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. + # + # @example + # expect(5).to satisfy { |n| n > 3 } + # expect(5).to satisfy("be greater than 3") { |n| n > 3 } + # @param description [String] optional description to be used for this matcher. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + 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 + # + # source://rspec-expectations//lib/rspec/matchers.rb#828 + def start_with(*expected); 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 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + 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') + # + # source://rspec-expectations//lib/rspec/matchers.rb#850 + def throw_symbol(expected_symbol = T.unsafe(nil), expected_arg = T.unsafe(nil)); 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') + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def throwing(*args, **_arg1, &block); 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) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + 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. + # + # source://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. + # + # source://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. + # + # source://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. + # + # source://rspec-expectations//lib/rspec/matchers.rb#889 + def yield_with_no_args; 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. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def yielding_control(*args, **_arg1, &block); 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. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def yielding_successive_args(*args, **_arg1, &block); 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. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def yielding_with_args(*args, **_arg1, &block); 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. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + def yielding_with_no_args(*args, **_arg1, &block); end + + private + + # source://rspec-expectations//lib/rspec/matchers.rb#961 + def method_missing(method, *args, **_arg2, &block); end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers.rb#974 + def respond_to_missing?(method, *_arg1); end + + class << self + # Extended from {RSpec::Matchers::DSL#alias_matcher}. + # + # source://rspec-expectations//lib/rspec/matchers.rb#250 + def alias_matcher(*args, &block); end + + # Used by rspec-core to clear the state used to generate + # descriptions after an example. + # + # @api private + # + # source://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 + # + # source://rspec-expectations//lib/rspec/matchers.rb#951 + def configuration; end + + # Generates an an example description based on the last expectation. + # Used by rspec-core's one-liner syntax. + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/generated_descriptions.rb#19 + def generated_description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers.rb#1008 + def is_a_describable_matcher?(obj); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers.rb#988 + def is_a_matcher?(obj); end + + # @private + # + # source://rspec-expectations//lib/rspec/matchers/generated_descriptions.rb#25 + def last_description; end + + # @private + # + # source://rspec-expectations//lib/rspec/matchers/generated_descriptions.rb#5 + def last_expectation_handler; end + + # @private + # + # source://rspec-expectations//lib/rspec/matchers/generated_descriptions.rb#5 + def last_expectation_handler=(_arg0); end + + # @private + # + # source://rspec-expectations//lib/rspec/matchers/generated_descriptions.rb#5 + def last_matcher; end + + # @private + # + # source://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 +# +# source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#12 +class RSpec::Matchers::AliasedMatcher < ::RSpec::Matchers::MatcherDelegator + # @api private + # @return [AliasedMatcher] a new instance of AliasedMatcher + # + # source://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 + # + # source://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 + # + # source://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 + # + # source://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. + # + # @api private + # + # source://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 +# +# source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#64 +class RSpec::Matchers::AliasedMatcherWithOperatorSupport < ::RSpec::Matchers::AliasedMatcher; end + +# @private +# +# source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#71 +class RSpec::Matchers::AliasedNegatedMatcher < ::RSpec::Matchers::AliasedMatcher + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#80 + def does_not_match?(*args, &block); end + + # source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#84 + def failure_message; end + + # source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#88 + def failure_message_when_negated; end + + # @return [Boolean] + # + # source://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). + # + # source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#105 + def optimal_failure_message(same, inverted); end +end + +# source://rspec-expectations//lib/rspec/matchers/aliased_matcher.rb#94 +RSpec::Matchers::AliasedNegatedMatcher::DefaultFailureMessages = RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages + +# source://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 +# +# source://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. +# +# source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#3 +module RSpec::Matchers::BuiltIn; end + +# Provides the implementation for `all`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#7 +class RSpec::Matchers::BuiltIn::All < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [All] a new instance of All + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#11 + def initialize(matcher); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#37 + def description; end + + # @api private + # @private + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#17 + def does_not_match?(_actual); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#9 + def failed_objects; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#23 + def failure_message; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#9 + def matcher; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#63 + def add_new_line_if_needed(message); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#58 + def failure_message_for_item(index, failure_message); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#67 + def indent_multiline_message(message); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#50 + def index_failed_objects; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#74 + def initialize_copy(other); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#80 + def iterable?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/all.rb#43 + def match(_expected, _actual); end +end + +# 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. +# +# @api private +# +# source://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 + + # @api private + # @return [BaseMatcher] a new instance of BaseMatcher + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#28 + def initialize(expected = T.unsafe(nil)); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#23 + def actual; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#97 + def actual_formatted; end + + # Generates a description using {EnglishPhrasing}. + # + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#60 + def description; end + + # Matchers are not diffable by default. Override this to make your + # subclass diffable. + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#69 + def diffable?; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#23 + def expected; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#92 + def expected_formatted; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#87 + def expects_call_stack_jump?; end + + # 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. + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#47 + def match_unless_raises(*exceptions); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#107 + def matcher_name; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#26 + def matcher_name=(_arg0); end + + # Indicates if the match is successful. Delegates to `match`, which + # should be defined on a subclass. Takes care of consistently + # initializing the `actual` attribute. + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#36 + def matches?(actual); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#23 + def rescued_exception; end + + # 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. + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#77 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#82 + def supports_value_expectations?; end + + class << self + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#102 + def matcher_name; end + + private + + # Borrowed from ActiveSupport. + # + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#117 + def underscore(camel_cased_word); end + end +end + +# Provides default implementations of failure messages, based on the `description`. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#193 +module RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages + # 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`. + # + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#199 + def failure_message; end + + # 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`. + # + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#208 + def failure_message_when_negated; end + + class << self + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#213 + def has_default_failure_messages?(matcher); end + end +end + +# @api private +# @private +# +# source://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. + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#138 + def improve_hash_formatting(inspect_string); end + + class << self + # `{ :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. + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#138 + def improve_hash_formatting(inspect_string); end + end +end + +# @api private +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#147 +module RSpec::Matchers::BuiltIn::BaseMatcher::StringEncodingFormatting + private + + # Formats a String's encoding as a human readable string + # :nocov: + # + # @api private + # @param _value [String] + # @return [nil] nil as the curent Ruby version does not support String encoding + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#172 + def format_encoding(value); end + + # :nocov: + # + # @api private + # @return [Boolean] False always as the curent Ruby version does not support String encoding + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#153 + def string_encoding_differs?; end + + class << self + # Formats a String's encoding as a human readable string + # :nocov: + # + # @api private + # @param _value [String] + # @return [nil] nil as the curent Ruby version does not support String encoding + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#172 + def format_encoding(value); end + + # :nocov: + # + # @api private + # @return [Boolean] False always as the curent Ruby version does not support String encoding + # + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#153 + def string_encoding_differs?; end + end +end + +# Used to detect when no arg is passed to `initialize`. +# `nil` cannot be used because it's a valid value to pass. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#20 +RSpec::Matchers::BuiltIn::BaseMatcher::UNDEFINED = T.let(T.unsafe(nil), Object) + +# Provides the implementation for `be`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#101 +class RSpec::Matchers::BuiltIn::Be < ::RSpec::Matchers::BuiltIn::BaseMatcher + include ::RSpec::Matchers::BuiltIn::BeHelpers + + # @api private + # @return [Be] a new instance of Be + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#104 + def initialize(*args); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#121 + def <(operand); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#121 + def <=(operand); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#121 + def ==(operand); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#121 + def ===(operand); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#121 + def =~(operand); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#121 + def >(operand); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#121 + def >=(operand); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#110 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#116 + def failure_message_when_negated; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#128 + def match(_, actual); end +end + +# Provides the implementation for `be_a_kind_of`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be_kind_of.rb#7 +class RSpec::Matchers::BuiltIn::BeAKindOf < ::RSpec::Matchers::BuiltIn::BaseMatcher + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_kind_of.rb#10 + def match(expected, actual); end +end + +# Provides the implementation for `be_an_instance_of`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://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] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_instance_of.rb#10 + def description; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_instance_of.rb#16 + def match(expected, actual); end +end + +# Provides the implementation for `be_between`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#7 +class RSpec::Matchers::BuiltIn::BeBetween < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [BeBetween] a new instance of BeBetween + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#8 + def initialize(min, max); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#57 + def description; end + + # Makes the between comparison exclusive. + # + # @api public + # @example + # expect(3).to be_between(2, 4).exclusive + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#33 + def exclusive; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#51 + def failure_message; end + + # Makes the between comparison inclusive. + # + # @api public + # @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. + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#21 + def inclusive; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#42 + def matches?(actual); end + + private + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#63 + def comparable?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#71 + def compare; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_between.rb#67 + def not_comparable_clause; end +end + +# Provides the implementation of `be value`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#136 +class RSpec::Matchers::BuiltIn::BeComparedTo < ::RSpec::Matchers::BuiltIn::BaseMatcher + include ::RSpec::Matchers::BuiltIn::BeHelpers + + # @api private + # @return [BeComparedTo] a new instance of BeComparedTo + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#139 + def initialize(operand, operator); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#178 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#151 + def does_not_match?(actual); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#159 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#166 + def failure_message_when_negated; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#145 + def matches?(actual); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#184 + def perform_match(actual); end +end + +# Provides the implementation for `be_falsey`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#30 +class RSpec::Matchers::BuiltIn::BeFalsey < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#33 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#39 + def failure_message_when_negated; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#45 + def match(_, actual); end +end + +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#74 +module RSpec::Matchers::BuiltIn::BeHelpers + private + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#77 + def args_to_s; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#93 + def args_to_sentence; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#89 + def expected_to_sentence; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#85 + def inspected_args; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#81 + def parenthesize(string); end +end + +# Provides the implementation for `be_nil`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#53 +class RSpec::Matchers::BuiltIn::BeNil < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#56 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#62 + def failure_message_when_negated; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#68 + def match(_, actual); end +end + +# Provides the implementation of `be_`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#164 +class RSpec::Matchers::BuiltIn::BePredicate < ::RSpec::Matchers::BuiltIn::DynamicPredicate + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#176 + def failure_to_respond_explanation; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#168 + def predicate; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#184 + def predicate_accessible?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#172 + def predicate_method_name; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#188 + def present_tense_predicate; end +end + +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#166 +RSpec::Matchers::BuiltIn::BePredicate::REGEX = T.let(T.unsafe(nil), Regexp) + +# Provides the implementation for `be_truthy`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#7 +class RSpec::Matchers::BuiltIn::BeTruthy < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#10 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#16 + def failure_message_when_negated; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be.rb#22 + def match(_, actual); end +end + +# Provides the implementation for `be_within`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#7 +class RSpec::Matchers::BuiltIn::BeWithin < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [BeWithin] a new instance of BeWithin + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#8 + def initialize(delta); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#52 + def description; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#40 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#46 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#32 + def matches?(actual); end + + # Sets the expected value. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#14 + def of(expected); end + + # Sets the expected value, and makes the matcher do + # a percent comparison. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#24 + def percent_of(expected); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#62 + def needs_expected; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#66 + def not_numeric_clause; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/be_within.rb#58 + def numeric?; end +end + +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#159 +module RSpec::Matchers::BuiltIn::CaptureStderr + class << self + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#164 + def capture(block); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#160 + def name; end + end +end + +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#139 +module RSpec::Matchers::BuiltIn::CaptureStdout + class << self + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#144 + def capture(block); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#140 + def name; end + end +end + +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#179 +class RSpec::Matchers::BuiltIn::CaptureStreamToTempfile < ::Struct + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#180 + def capture(block); end +end + +# Provides the implementation for `change`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#7 +class RSpec::Matchers::BuiltIn::Change < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Change] a new instance of Change + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#87 + def initialize(receiver = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # Specifies the delta of the expected change. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#10 + def by(expected_delta); end + + # Specifies a minimum delta of the expected change. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#18 + def by_at_least(minimum); end + + # Specifies a maximum delta of the expected change. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#26 + def by_at_most(maximum); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#71 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#50 + def does_not_match?(event_proc); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#57 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#64 + def failure_message_when_negated; end + + # Specifies the original value. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#40 + def from(value); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#45 + def matches?(event_proc); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#76 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#81 + def supports_value_expectations?; end + + # Specifies the new value you expect. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#34 + def to(value); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#93 + def change_details; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#119 + def negative_failure_reason; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#97 + def perform_change(event_proc); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#114 + def positive_failure_reason; end + + # @api private + # @raise [SyntaxError] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#109 + def raise_block_syntax_error; end +end + +# 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. +# +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#352 +class RSpec::Matchers::BuiltIn::ChangeDetails + # @return [ChangeDetails] a new instance of ChangeDetails + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#357 + def initialize(matcher_name, receiver = T.unsafe(nil), message = T.unsafe(nil), &block); end + + # Returns the value of attribute actual_after. + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#353 + def actual_after; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#418 + def actual_delta; end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#402 + def changed?; end + + # @yield [@actual_before] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#389 + def perform_change(event_proc); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#378 + def value_representation; end + + private + + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#424 + def evaluate_value_proc; end + + # :nocov: + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#438 + def extract_value_block_snippet; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#428 + def message_notation(receiver, message); end +end + +# source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#355 +module RSpec::Matchers::BuiltIn::ChangeDetails::UNDEFINED; end + +# Used to specify a change from a specific value +# (and, optionally, to a specific value). +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#270 +class RSpec::Matchers::BuiltIn::ChangeFromValue < ::RSpec::Matchers::BuiltIn::SpecificValuesChange + # @api private + # @return [ChangeFromValue] a new instance of ChangeFromValue + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#271 + def initialize(change_details, expected_before); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#285 + def does_not_match?(event_proc); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#295 + def failure_message_when_negated; end + + # Specifies the new value you expect. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#278 + def to(value); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#303 + def change_description; end +end + +# Used to specify a relative change. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#128 +class RSpec::Matchers::BuiltIn::ChangeRelatively < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [ChangeRelatively] a new instance of ChangeRelatively + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#129 + def initialize(change_details, expected_delta, relativity, &comparer); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#156 + def description; end + + # @api private + # @private + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#150 + def does_not_match?(_event_proc); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#137 + def failure_message; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#144 + def matches?(event_proc); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#162 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#167 + def supports_value_expectations?; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#173 + def failure_reason; end +end + +# Used to specify a change to a specific value +# (and, optionally, from a specific value). +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#311 +class RSpec::Matchers::BuiltIn::ChangeToValue < ::RSpec::Matchers::BuiltIn::SpecificValuesChange + # @api private + # @return [ChangeToValue] a new instance of ChangeToValue + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#312 + def initialize(change_details, expected_after); end + + # @api private + # @private + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#326 + def does_not_match?(_event_proc); end + + # Specifies the original value. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#319 + def from(value); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#333 + def change_description; end +end + +# Base class for `and` and `or` compound matchers. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#6 +class RSpec::Matchers::BuiltIn::Compound < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Compound] a new instance of Compound + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#10 + def initialize(matcher_1, matcher_2); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#25 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#49 + def diffable?; end + + # @api private + # @private + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#16 + def does_not_match?(_actual); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#8 + def evaluator; end + + # @api private + # @return [RSpec::Matchers::MultiMatcherDiff] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#55 + def expected; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#42 + def expects_call_stack_jump?; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#8 + def matcher_1; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#8 + def matcher_2; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#30 + def supports_block_expectations?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#36 + def supports_value_expectations?; end + + protected + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#62 + def diffable_matcher_list; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#96 + def compound_failure_message; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#128 + def diffable_matcher_list_for(matcher); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#90 + def indent_multiline_message(message); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#71 + def initialize_copy(other); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#77 + def match(_expected, actual); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#102 + def matcher_1_matches?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#106 + def matcher_2_matches?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#122 + def matcher_is_diffable?(matcher); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#110 + def matcher_supports_block_expectations?(matcher); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#116 + def matcher_supports_value_expectations?(matcher); end +end + +# Matcher used to represent a compound `and` expectation. +# +# @api public +# +# source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#245 +class RSpec::Matchers::BuiltIn::Compound::And < ::RSpec::Matchers::BuiltIn::Compound + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#248 + def failure_message; end + + private + + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#265 + def conjunction; end + + # @api public + # + # source://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. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#159 +class RSpec::Matchers::BuiltIn::Compound::NestedEvaluator + # @api private + # @return [NestedEvaluator] a new instance of NestedEvaluator + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#160 + def initialize(actual, matcher_1, matcher_2); end + + # @api private + # @return [Boolean] + # + # source://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. + # + # @api private + # + # source://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. + # + # @api private + # @raise [ArgumentError] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#227 + def order_block_matchers; end + + class << self + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#236 + def matcher_expects_call_stack_jump?(matcher); end + end +end + +# Matcher used to represent a compound `or` expectation. +# +# @api public +# +# source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#272 +class RSpec::Matchers::BuiltIn::Compound::Or < ::RSpec::Matchers::BuiltIn::Compound + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#275 + def failure_message; end + + private + + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#286 + def conjunction; end + + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#281 + def match(*_arg0); end +end + +# For value expectations, we can evaluate the matchers sequentially. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#135 +class RSpec::Matchers::BuiltIn::Compound::SequentialEvaluator + # @api private + # @return [SequentialEvaluator] a new instance of SequentialEvaluator + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#136 + def initialize(actual, *_arg1); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/compound.rb#140 + def matcher_matches?(matcher); end +end + +# Provides the implementation for `contain_exactly` and `match_array`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#8 +class RSpec::Matchers::BuiltIn::ContainExactly < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#29 + def description; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#11 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#22 + def failure_message_when_negated; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#34 + def matches?(actual); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#56 + def actual_collection_line; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#137 + def best_solution; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#94 + def convert_actual_to_an_array; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#68 + def describe_collection(collection, surface_descriptions = T.unsafe(nil)); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#52 + def expected_collection_line; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#64 + def extra_elements_line; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#131 + def extra_items; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#44 + def generate_failure_message; end + + # @api private + # + # source://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. + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#90 + def match_when_sorted?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#76 + def message_line(prefix, collection, surface_descriptions = T.unsafe(nil)); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#60 + def missing_elements_line; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#125 + def missing_items; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#141 + def pairings_maximizer; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#104 + def safe_sort(array); end + + # :nocov: + # + # @api private + # @return [Boolean] + # + # source://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. +# +# @api private +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#188 +class RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer + # @api private + # @return [PairingsMaximizer] a new instance of PairingsMaximizer + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#225 + def initialize(expected_to_actual_matched_indexes, actual_to_expected_matched_indexes); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#223 + def actual_to_expected_matched_indexes; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#223 + def expected_to_actual_matched_indexes; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#239 + def find_best_solution; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#223 + def solution; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#301 + def apply_pairing_to(indeterminates, original_matches, other_list_index); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#285 + def best_solution_for_pairing(expected_index, actual_index); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#265 + def categorize_indexes(indexes_to_categorize, other_indexes); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#280 + def reciprocal_single_match?(matches, index, other_list); end +end + +# Starting solution that is worse than any other real solution. +# +# @api private +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#259 +class RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer::NullSolution + class << self + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#260 + def worse_than?(_other); end + end +end + +# @api private +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190 +class RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer::Solution < ::Struct + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#212 + def +(derived_candidate_solution); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#196 + def candidate?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#201 + def ideal?; end + + # Returns the value of attribute indeterminate_actual_indexes + # + # @return [Object] the current value of indeterminate_actual_indexes + def indeterminate_actual_indexes; end + + # Sets the attribute indeterminate_actual_indexes + # + # @param value [Object] the value to set the attribute indeterminate_actual_indexes to. + # @return [Object] the newly set value + def indeterminate_actual_indexes=(_); end + + # Returns the value of attribute indeterminate_expected_indexes + # + # @return [Object] the current value of indeterminate_expected_indexes + def indeterminate_expected_indexes; end + + # Sets the attribute indeterminate_expected_indexes + # + # @param value [Object] the value to set the attribute indeterminate_expected_indexes to. + # @return [Object] the newly set value + def indeterminate_expected_indexes=(_); end + + # Returns the value of attribute unmatched_actual_indexes + # + # @return [Object] the current value of unmatched_actual_indexes + def unmatched_actual_indexes; end + + # Sets the attribute unmatched_actual_indexes + # + # @param value [Object] the value to set the attribute unmatched_actual_indexes to. + # @return [Object] the newly set value + def unmatched_actual_indexes=(_); end + + # Returns the value of attribute unmatched_expected_indexes + # + # @return [Object] the current value of unmatched_expected_indexes + def unmatched_expected_indexes; end + + # Sets the attribute unmatched_expected_indexes + # + # @param value [Object] the value to set the attribute unmatched_expected_indexes to. + # @return [Object] the newly set value + def unmatched_expected_indexes=(_); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#208 + def unmatched_item_count; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#192 + def worse_than?(other); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# Abstract class to implement `once`, `at_least` and other +# count constraints. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#7 +module RSpec::Matchers::BuiltIn::CountExpectation + # Specifies the minimum number of times the method is expected to match + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#42 + def at_least(number); end + + # Specifies the maximum number of times the method is expected to match + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#35 + def at_most(number); end + + # Specifies that the method is expected to match the given number of times. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#28 + def exactly(number); end + + # Specifies that the method is expected to match once. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#10 + def once; end + + # Specifies that the method is expected to match thrice. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#22 + def thrice; end + + # No-op. Provides syntactic sugar. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#49 + def times; end + + # Specifies that the method is expected to match twice. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#16 + def twice; end + + protected + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#55 + def count_expectation_type; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#55 + def expected_count; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#122 + def count_constraint_to_number(n); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#141 + def count_expectation_description; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#145 + def count_failure_reason(action); end + + # :nocov: + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#60 + def cover?(count, number); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#71 + def expected_count_matches?(actual_count); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#79 + def has_expected_count?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#159 + def human_readable_count(count); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#150 + def human_readable_expectation_type; end + + # @api private + # @raise [ArgumentError] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#102 + def raise_impossible_count_expectation(count); end + + # @api private + # @raise [ArgumentError] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#111 + def raise_unsupported_count_expectation; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#83 + def set_expected_count(relativity, n); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/count_expectation.rb#134 + def unsupported_count_expectation?(relativity); end +end + +# Provides the implementation for `cover`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/cover.rb#7 +class RSpec::Matchers::BuiltIn::Cover < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Cover] a new instance of Cover + # + # source://rspec-expectations//lib/rspec/matchers/built_in/cover.rb#8 + def initialize(*expected); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/cover.rb#17 + def does_not_match?(range); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/cover.rb#12 + def matches?(range); end +end + +# Provides the implementation for dynamic predicate matchers. +# Not intended to be inherited directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#7 +class RSpec::Matchers::BuiltIn::DynamicPredicate < ::RSpec::Matchers::BuiltIn::BaseMatcher + include ::RSpec::Matchers::BuiltIn::BeHelpers + + # @api private + # @return [DynamicPredicate] a new instance of DynamicPredicate + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#10 + def initialize(method_name, *args, **_arg2, &block); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#43 + def description; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#23 + def does_not_match?(actual, &block); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#31 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#37 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#16 + def matches?(actual, &block); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#126 + def expectation_of(value); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#121 + def failure_message_expecting(value); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#142 + def failure_to_respond_explanation; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#117 + def method_description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#88 + def methods_include?(method); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#68 + def predicate_accessible?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#101 + def predicate_matches?(value = T.unsafe(nil)); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#97 + def predicate_method_name; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#93 + def predicate_result; end + + # :nocov: + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#84 + def private_predicate?; end + + # :nocov: + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#62 + def really_responds_to?(method); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#109 + def root; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#136 + def validity_message; end +end + +# Provides the implementation for `end_with`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#81 +class RSpec::Matchers::BuiltIn::EndWith < ::RSpec::Matchers::BuiltIn::StartOrEndWith + private + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#88 + def element_matches?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#84 + def subset_matches?; end +end + +# Provides the implementation for `eq`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/eq.rb#7 +class RSpec::Matchers::BuiltIn::Eq < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eq.rb#26 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eq.rb#32 + def diffable?; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eq.rb#10 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eq.rb#20 + def failure_message_when_negated; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eq.rb#38 + def match(expected, actual); end +end + +# Provides the implementation for `eql`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/eql.rb#7 +class RSpec::Matchers::BuiltIn::Eql < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eql.rb#26 + def diffable?; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eql.rb#10 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eql.rb#20 + def failure_message_when_negated; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/eql.rb#32 + def match(expected, actual); end +end + +# Provides the implementation for `equal`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#7 +class RSpec::Matchers::BuiltIn::Equal < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#33 + def diffable?; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#10 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#20 + def failure_message_when_negated; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#49 + def actual_inspected; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#61 + def detailed_failure_message; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#45 + def expected_is_a_literal_singleton?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#75 + def inspect_object(o); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#39 + def match(expected, actual); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#57 + def simple_failure_message; end +end + +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/equal.rb#43 +RSpec::Matchers::BuiltIn::Equal::LITERAL_SINGLETONS = T.let(T.unsafe(nil), Array) + +# Provides the implementation for `exist`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#7 +class RSpec::Matchers::BuiltIn::Exist < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Exist] a new instance of Exist + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#8 + def initialize(*expected); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#22 + def does_not_match?(actual); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#30 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#36 + def failure_message_when_negated; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#14 + def matches?(actual); end +end + +# Simple class for memoizing actual/expected for this matcher +# and examining the match +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#43 +class RSpec::Matchers::BuiltIn::Exist::ExistenceTest < ::Struct + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#52 + def actual_exists?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#46 + def valid_test?; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#58 + def validity_message; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#83 + def deprecated(predicate, actual); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#75 + def existence_values; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#79 + def predicates; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/exist.rb#71 + def uniq_truthy_values; end +end + +# Provides the implementation for `has_`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#152 +class RSpec::Matchers::BuiltIn::Has < ::RSpec::Matchers::BuiltIn::DynamicPredicate + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#156 + def predicate; end +end + +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/has.rb#154 +RSpec::Matchers::BuiltIn::Has::REGEX = T.let(T.unsafe(nil), Regexp) + +# Provides the implementation for `have_attributes`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#7 +class RSpec::Matchers::BuiltIn::HaveAttributes < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [HaveAttributes] a new instance of HaveAttributes + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#11 + def initialize(expected); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#19 + def actual; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#43 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#50 + def diffable?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#34 + def does_not_match?(actual); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#56 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#64 + def failure_message_when_negated; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#25 + def matches?(actual); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#9 + def respond_to_failed; end + + private + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#85 + def actual_has_attribute?(attribute_key, attribute_value); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#70 + def cache_all_values; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#107 + def formatted_values; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#78 + def perform_match(predicate); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#89 + def respond_to_attributes?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#99 + def respond_to_failure_message_or; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/have_attributes.rb#95 + def respond_to_matcher; end +end + +# Provides the implementation for `include`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://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 + # @raise [ArgumentError] + # @return [Include] a new instance of Include + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#15 + def initialize(*expecteds); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#44 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#62 + def diffable?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#33 + def does_not_match?(actual); end + + # @api private + # @return [Array, Hash] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#68 + def expected; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#12 + def expecteds; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#50 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#56 + def failure_message_when_negated; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#22 + def matches?(actual); end + + private + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#168 + def actual_collection_includes?(expected_item); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#154 + def actual_hash_has_key?(expected_key); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#142 + def actual_hash_includes?(expected_key, expected_value); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#78 + def check_actual?(actual); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#84 + def check_expected_count?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#150 + def comparing_hash_keys?(expected_item); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#138 + def comparing_hash_to_a_subset?(expected_item); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#212 + def convert_to_hash?(obj); end + + # :nocov: + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#185 + def count_enumerable(expected_item); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#190 + def count_inclusions; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#202 + def diff_would_wrongly_highlight_matched_item?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#121 + def excluded_from_actual; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#96 + def format_failure_message(preposition); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#116 + def perform_match(&block); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/include.rb#107 + def readable_list_of(items); end +end + +# Provides the implementation for `match`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#7 +class RSpec::Matchers::BuiltIn::Match < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Match] a new instance of Match + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#8 + def initialize(expected); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#15 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#25 + def diffable?; end + + # Used to specify the captures we match against + # + # @api private + # @return [self] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#31 + def with_captures(*captures); end + + private + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#45 + def can_safely_call_match?(expected, actual); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#38 + def match(expected, actual); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#52 + def match_captures(expected, actual); end +end + +# Handles operator matcher for `should_not`. +# +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#116 +class RSpec::Matchers::BuiltIn::NegativeOperatorMatcher < ::RSpec::Matchers::BuiltIn::OperatorMatcher + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#117 + def __delegate_operator(actual, operator, expected); end +end + +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#128 +module RSpec::Matchers::BuiltIn::NullCapture + class << self + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#133 + def capture(_block); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#129 + def name; end + end +end + +# Provides the implementation for operator matchers. +# Not intended to be instantiated directly. +# Only available for use with `should`. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#10 +class RSpec::Matchers::BuiltIn::OperatorMatcher + # @api private + # @return [OperatorMatcher] a new instance of OperatorMatcher + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#41 + def initialize(actual); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#57 + def !=(_expected); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#57 + def !~(_expected); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#47 + def <(expected); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#47 + def <=(expected); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#47 + def ==(expected); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#47 + def ===(expected); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#47 + def =~(expected); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#47 + def >(expected); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#47 + def >=(expected); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#76 + def description; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#70 + def fail_with_message(message); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#88 + def eval_match(actual, operator, expected); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#82 + def has_non_generic_implementation_of?(op); end + + class << self + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#29 + def get(klass, operator); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#18 + def register(klass, operator, matcher); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#13 + def registry; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#24 + def unregister(klass, operator); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#46 + def use_custom_matcher_or_delegate(operator); end + end +end + +# Provides the implementation for `output`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#9 +class RSpec::Matchers::BuiltIn::Output < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Output] a new instance of Output + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#10 + def initialize(expected); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#76 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#86 + def diffable?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#24 + def does_not_match?(block); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#64 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#70 + def failure_message_when_negated; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#17 + def matches?(block); end + + # Indicates this matcher matches against a block. + # + # @api private + # @return [True] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#93 + def supports_block_expectations?; end + + # Indicates this matcher matches against a block only. + # + # @api private + # @return [False] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#100 + def supports_value_expectations?; end + + # Tells the matcher to match against stderr. + # Works only when the main Ruby process prints to stderr + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#39 + def to_stderr; end + + # Tells the matcher to match against stderr. + # Works when subprocesses print to stderr as well. + # This is significantly (~30x) slower than `to_stderr` + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#57 + def to_stderr_from_any_process; end + + # Tells the matcher to match against stdout. + # Works only when the main Ruby process prints to stdout + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#31 + def to_stdout; end + + # Tells the matcher to match against stdout. + # Works when subprocesses print to stdout as well. + # This is significantly (~30x) slower than `to_stdout` + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#48 + def to_stdout_from_any_process; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#121 + def actual_output_description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#106 + def captured?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#116 + def negative_failure_reason; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/output.rb#110 + def positive_failure_reason; end +end + +# Handles operator matcher for `should`. +# +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#97 +class RSpec::Matchers::BuiltIn::PositiveOperatorMatcher < ::RSpec::Matchers::BuiltIn::OperatorMatcher + # source://rspec-expectations//lib/rspec/matchers/built_in/operators.rb#98 + def __delegate_operator(actual, operator, expected); end +end + +# Provides the implementation for `raise_error`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#9 +class RSpec::Matchers::BuiltIn::RaiseError + include ::RSpec::Matchers::Composable + + # @api private + # @return [RaiseError] a new instance of RaiseError + # + # source://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] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#117 + def description; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#83 + def does_not_match?(given_proc); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#99 + def expects_call_stack_jump?; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#105 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#111 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#52 + def matches?(given_proc, negative_expectation = T.unsafe(nil), &block); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#89 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#94 + def supports_value_expectations?; end + + # Specifies the expected error message. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#43 + def with_message(expected_message); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#123 + def actual_error_message; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#137 + def block_matches?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#133 + def error_and_message_match?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#145 + def eval_block; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#129 + def expectation_matched?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#226 + def expected_error; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#257 + def expecting_specific_exception?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#241 + def format_backtrace(backtrace); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#246 + def given_error; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#176 + def handle_warning(message); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#261 + def raise_message_already_set; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#141 + def ready_to_eval_block?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#155 + def verify_message; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#188 + def warn_about_bare_error!; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#180 + def warn_about_bare_error?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#214 + def warn_about_negative_false_positive!(expression); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#201 + def warn_about_nil_error!; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#184 + def warn_about_nil_error?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#160 + def warn_for_negative_false_positives!; end + + # @api private + # + # source://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` +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/raise_error.rb#20 +RSpec::Matchers::BuiltIn::RaiseError::UndefinedValue = T.let(T.unsafe(nil), Object) + +# Used to wrap match data and make it reliable for 1.8.7 +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#72 +class RSpec::Matchers::BuiltIn::ReliableMatchData + # @api private + # @return [ReliableMatchData] a new instance of ReliableMatchData + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#73 + def initialize(match_data); end + + # returns an array of captures from the match data + # + # @api private + # @return Array + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#98 + def captures; end + + # Returns match data names for named captures + # + # @api private + # @return Array + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#90 + def names; end + + protected + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/match.rb#104 + def match_data; end +end + +# Provides the implementation for `respond_to`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#9 +class RSpec::Matchers::BuiltIn::RespondTo < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [RespondTo] a new instance of RespondTo + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#10 + def initialize(*names); end + + # Specifies that the method accepts any keyword, i.e. the method has + # a splatted keyword parameter of the form **kw_args. + # + # @api public + # @example + # expect(obj).to respond_to(:message).with_any_keywords + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#48 + def and_any_keywords; end + + # Specifies keyword arguments, if any. + # + # @api public + # @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) + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#36 + def and_keywords(*keywords); end + + # Specifies that the number of arguments has no upper limit, i.e. the + # method has a splatted parameter of the form *args. + # + # @api public + # @example + # expect(obj).to respond_to(:message).with_unlimited_arguments + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#60 + def and_unlimited_arguments; end + + # No-op. Intended to be used as syntactic sugar when using `with`. + # + # @api public + # @example + # expect(obj).to respond_to(:message).with(3).arguments + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#71 + def argument; end + + # No-op. Intended to be used as syntactic sugar when using `with`. + # + # @api public + # @example + # expect(obj).to respond_to(:message).with(3).arguments + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#71 + def arguments; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#100 + def description; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#82 + def does_not_match?(actual); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#88 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#94 + def failure_message_when_negated; end + + # Used by other matchers to suppress a check + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#106 + def ignoring_method_signature_failure!; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#77 + def matches?(actual); end + + # Specifies the number of expected arguments. + # + # @api public + # @example + # expect(obj).to respond_to(:message).with(3).arguments + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#24 + def with(n); end + + # Specifies that the method accepts any keyword, i.e. the method has + # a splatted keyword parameter of the form **kw_args. + # + # @api public + # @example + # expect(obj).to respond_to(:message).with_any_keywords + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#48 + def with_any_keywords; end + + # Specifies keyword arguments, if any. + # + # @api public + # @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) + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#36 + def with_keywords(*keywords); end + + # Specifies that the number of arguments has no upper limit, i.e. the + # method has a splatted parameter of the form *args. + # + # @api public + # @example + # expect(obj).to respond_to(:message).with_unlimited_arguments + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#60 + def with_unlimited_arguments; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#112 + def find_failing_method_names(actual, filter_method); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#119 + def matches_arity?(actual, name); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#156 + def pp_names; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#130 + def with_arity; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#139 + def with_arity_string; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#143 + def with_keywords_string; end +end + +# @api private +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#161 +class RSpec::Matchers::BuiltIn::RespondTo::ArityCheck + # @api private + # @return [ArityCheck] a new instance of ArityCheck + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#162 + def initialize(expected_arity, expected_keywords, arbitrary_keywords, unlimited_arguments); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#178 + def matches?(actual, name); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#187 + def method_signature_for(actual, name); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#183 + def verifier_for(actual, name); end +end + +# Provides the implementation for `satisfy`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/satisfy.rb#7 +class RSpec::Matchers::BuiltIn::Satisfy < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [Satisfy] a new instance of Satisfy + # + # source://rspec-expectations//lib/rspec/matchers/built_in/satisfy.rb#8 + def initialize(description = T.unsafe(nil), &block); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/satisfy.rb#21 + def description; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/satisfy.rb#27 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/satisfy.rb#33 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/satisfy.rb#14 + def matches?(actual, &block); end + + private + + # :nocov: + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/satisfy.rb#40 + def block_representation; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/satisfy.rb#48 + def extract_block_snippet; end +end + +# Base class for specifying a change from and/or to specific values. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#181 +class RSpec::Matchers::BuiltIn::SpecificValuesChange < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [SpecificValuesChange] a new instance of SpecificValuesChange + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#185 + def initialize(change_details, from, to); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#197 + def description; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#202 + def failure_message; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#192 + def matches?(event_proc); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#210 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#215 + def supports_value_expectations?; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#244 + def after_value_failure; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#238 + def before_value_failure; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#255 + def did_change_failure; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#250 + def did_not_change_failure; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#234 + def matches_after?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#261 + def not_given_a_block_failure; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/change.rb#221 + def perform_change(event_proc); end +end + +# @api private +# @private +# +# source://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 +# +# source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#61 +RSpec::Matchers::BuiltIn::StartAndEndWith = RSpec::Matchers::BuiltIn::StartOrEndWith + +# Base class for the `end_with` and `start_with` matchers. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#7 +class RSpec::Matchers::BuiltIn::StartOrEndWith < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [StartOrEndWith] a new instance of StartOrEndWith + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#8 + def initialize(*expected); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#27 + def description; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#15 + def failure_message; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#36 + def match(_expected, actual); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#48 + def subsets_comparable?; end +end + +# Provides the implementation for `start_with`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#66 +class RSpec::Matchers::BuiltIn::StartWith < ::RSpec::Matchers::BuiltIn::StartOrEndWith + private + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#73 + def element_matches?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/start_or_end_with.rb#69 + def subset_matches?; end +end + +# Provides the implementation for `throw_symbol`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#7 +class RSpec::Matchers::BuiltIn::ThrowSymbol + include ::RSpec::Matchers::Composable + + # @api private + # @return [ThrowSymbol] a new instance of ThrowSymbol + # + # source://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] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#86 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#68 + def does_not_match?(given_proc); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#103 + def expects_call_stack_jump?; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#74 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#80 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#18 + def matches?(given_proc); end + + # Indicates this matcher matches against a block. + # + # @api private + # @return [True] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#93 + def supports_block_expectations?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#98 + def supports_value_expectations?; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#109 + def actual_result; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#118 + def caught; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#114 + def expected(symbol_desc = T.unsafe(nil)); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/throw_symbol.rb#122 + def throw_description(symbol, arg); end +end + +# Provides the implementation for `yield_control`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#101 +class RSpec::Matchers::BuiltIn::YieldControl < ::RSpec::Matchers::BuiltIn::BaseMatcher + include ::RSpec::Matchers::BuiltIn::CountExpectation + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#111 + def does_not_match?(block); end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#117 + def failure_message; end + + # @api private + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#123 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#104 + def matches?(block); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#128 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#133 + def supports_value_expectations?; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#139 + def failure_reason; end +end + +# 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. +# +# @private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#12 +class RSpec::Matchers::BuiltIn::YieldProbe + # @return [YieldProbe] a new instance of YieldProbe + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#21 + def initialize(block, &callback); end + + # source://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. + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#78 + def assert_valid_expect_block!; end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#29 + def has_block?; end + + # Returns the value of attribute num_yields. + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#19 + def num_yields; end + + # Sets the attribute num_yields + # + # @param value the value to set the attribute num_yields to. + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#19 + def num_yields=(_arg0); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#33 + def probe; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#53 + def single_yield_args; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#40 + def to_proc; end + + # Returns the value of attribute yielded_args. + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#19 + def yielded_args; end + + # Sets the attribute yielded_args + # + # @param value the value to set the attribute yielded_args to. + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#19 + def yielded_args=(_arg0); end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#57 + def yielded_once?(matcher_name); end + + class << self + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#13 + def probe(block, &callback); end + end +end + +# Provides the implementation for `yield_successive_args`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#296 +class RSpec::Matchers::BuiltIn::YieldSuccessiveArgs < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [YieldSuccessiveArgs] a new instance of YieldSuccessiveArgs + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#297 + def initialize(*args); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#337 + def description; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#320 + def does_not_match?(block); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#325 + def failure_message; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#331 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#302 + def matches?(block); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#342 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#347 + def supports_value_expectations?; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#353 + def expected_arg_description; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#365 + def negative_failure_reason; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#357 + def positive_failure_reason; end +end + +# Provides the implementation for `yield_with_args`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#199 +class RSpec::Matchers::BuiltIn::YieldWithArgs < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @return [YieldWithArgs] a new instance of YieldWithArgs + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#200 + def initialize(*args); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#233 + def description; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#218 + def does_not_match?(block); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#223 + def failure_message; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#228 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#205 + def matches?(block); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#240 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#245 + def supports_value_expectations?; end + + private + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#288 + def all_args_match?; end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#273 + def args_currently_match?; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#257 + def expected_arg_description; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#261 + def negative_failure_reason; end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#251 + def positive_failure_reason; end +end + +# Provides the implementation for `yield_with_no_args`. +# Not intended to be instantiated directly. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#149 +class RSpec::Matchers::BuiltIn::YieldWithNoArgs < ::RSpec::Matchers::BuiltIn::BaseMatcher + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#158 + def does_not_match?(block); end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#163 + def failure_message; end + + # @api private + # @private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#168 + def failure_message_when_negated; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#151 + def matches?(block); end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#173 + def supports_block_expectations?; end + + # @api private + # @private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#178 + def supports_value_expectations?; end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/built_in/yield.rb#190 + def negative_failure_reason; end + + # @api private + # + # source://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 +# +# source://rspec-expectations//lib/rspec/matchers/composable.rb#10 +module RSpec::Matchers::Composable + # 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. + # + # @api public + # @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. + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#22 + def &(matcher); end + + # Delegates to `#matches?`. Allows matchers to be used in composable + # fashion and also supports using matchers in case statements. + # + # @api public + # + # source://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. + # + # @api public + # @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. + # + # source://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. + # + # @api public + # @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. + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#38 + def or(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. + # + # @api public + # @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. + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#38 + 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. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#82 + def description_of(object); end + + # We should enumerate arrays as long as they are not recursive. + # + # @api private + # @return [Boolean] + # + # source://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. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#98 + def surface_descriptions_in(item); end + + # @api private + # @return [Boolean] + # + # source://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. + # + # @api public + # @param expected [Object] what is expected + # @param actual [Object] the actual value + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#66 + def values_match?(expected, actual); end + + # 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. + # + # @api public + # @private + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#128 + def with_matchers_cloned(object); end + + class << self + # We should enumerate arrays as long as they are not recursive. + # + # @api private + # @return [Boolean] + # + # source://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. + # + # @api public + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#98 + def surface_descriptions_in(item); end + + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#147 + def unreadable_io?(object); end + end +end + +# Wraps an item in order to surface its `description` via `inspect`. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/composable.rb#158 +class RSpec::Matchers::Composable::DescribableItem < ::Struct + # Inspectable version of the item description + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#160 + def inspect; end + + # Returns the value of attribute item + # + # @return [Object] the current value of item + def item; end + + # Sets the attribute item + # + # @param value [Object] the value to set the attribute item to. + # @return [Object] the newly set value + def item=(_); end + + # A pretty printed version of the item description. + # + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#165 + def pretty_print(pp); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# Defines the custom matcher DSL. +# +# source://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_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" + # @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" + # @option options + # @param old_name [Symbol] the original name for the matcher + # @param new_name [Symbol] the new name for the matcher + # @param options [Hash] options for the aliased matcher + # @see RSpec::Matchers + # @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. + # + # source://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 + # @see RSpec::Matchers + # @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). + # + # source://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 + # @see RSpec::Matchers + # @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. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#61 + def define_negated_matcher(negated_name, base_name, &description_override); end + + # Defines a custom matcher. + # + # @param name [Symbol] the name for the matcher + # @see RSpec::Matchers + # @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). + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#73 + def matcher(name, &declarations); end + + private + + # :nocov: + # + # source://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. +# +# source://rspec-expectations//lib/rspec/matchers/dsl.rb#385 +module RSpec::Matchers::DSL::DefaultImplementations + include ::RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages + + # The default description. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#395 + def description; end + + # Used internally by objects returns by `should` and `should_not`. + # + # @api private + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#390 + def diffable?; end + + # Most matchers do not expect call stack jumps. + # + # @return [Boolean] + # + # source://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. + # + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#403 + def supports_block_expectations?; end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#407 + def supports_value_expectations?; end + + private + + # source://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. +# +# source://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") + # + # source://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`) + # + # source://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. + # + # source://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`) + # + # source://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`) + # + # source://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. + # + # 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`. + # + # @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 + # @param options [Hash] for defining the behavior of the match block. + # @yield [Object] actual the actual value (i.e. the value wrapped by `expect`) + # + # source://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`) + # + # source://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 options [Hash] for defining the behavior of the match block. + # @yield [Object] actual the actual value (i.e. the value wrapped by `expect`) + # + # source://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`). + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#267 + def supports_block_expectations; end + + private + + # source://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. + # + # source://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. +# +# source://rspec-expectations//lib/rspec/matchers/dsl.rb#354 +module RSpec::Matchers::DSL::Macros::Deprecated + # @deprecated Use {Macros#failure_message} instead. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#368 + def failure_message_for_should(&definition); end + + # @deprecated Use {Macros#failure_message_when_negated} instead. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#374 + def failure_message_for_should_not(&definition); end + + # @deprecated Use {Macros#match} instead. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#356 + def match_for_should(&definition); end + + # @deprecated Use {Macros#match_when_negated} instead. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#362 + def match_for_should_not(&definition); end +end + +# @private +# +# source://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. +# +# source://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 + # @return [Matcher] a new instance of Matcher + # + # source://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`. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#449 + def actual; end + + # The block parameter used in the expectation + # + # source://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 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#482 + 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 + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#494 + 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`) + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#499 + def inspect; end + + # The name of the matcher. + # + # source://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. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#453 + def rescued_exception; end + + private + + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#522 + 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. + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#532 + 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. + # + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#507 + def respond_to_missing?(method, include_private = T.unsafe(nil)); end +end + +# source://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. +# +# source://rspec-expectations//lib/rspec/matchers/english_phrasing.rb#4 +module RSpec::Matchers::EnglishPhrasing + class << self + # 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([]) #=> "" + # + # @note The returned string has a leading space except + # + # source://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" + # + # source://rspec-expectations//lib/rspec/matchers/english_phrasing.rb#9 + def split_words(sym); end + end +end + +# source://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 +# +# source://rspec-expectations//lib/rspec/matchers/matcher_delegator.rb#31 +class RSpec::Matchers::MatcherDelegator < ::RSpec::Matchers::BaseDelegator + include ::RSpec::Matchers::Composable + + # @return [MatcherDelegator] a new instance of MatcherDelegator + # + # source://rspec-expectations//lib/rspec/matchers/matcher_delegator.rb#35 + def initialize(base_matcher); end + + # Returns the value of attribute base_matcher. + # + # source://rspec-expectations//lib/rspec/matchers/matcher_delegator.rb#33 + def base_matcher; end + + # source://rspec-expectations//lib/rspec/matchers/matcher_delegator.rb#39 + def method_missing(*args, &block); end + + private + + # source://rspec-expectations//lib/rspec/matchers/matcher_delegator.rb#55 + def initialize_copy(other); end + + # @return [Boolean] + # + # source://rspec-expectations//lib/rspec/matchers/matcher_delegator.rb#44 + def respond_to_missing?(name, include_all = T.unsafe(nil)); end +end + +# Handles list of expected and actual value pairs when there is a need +# to render multiple diffs. Also can handle one pair. +# +# @api private +# +# source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#6 +class RSpec::Matchers::MultiMatcherDiff + # @api private + # @return [MultiMatcherDiff] a new instance of MultiMatcherDiff + # + # source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#16 + def initialize(expected_list); end + + # Returns message with diff(s) appended for provided differ + # factory and actual value if there are any + # + # @api private + # @param message [String] original failure message + # @param differ [Proc] + # @return [String] + # + # source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#47 + def message_with_diff(message, differ); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#68 + def diffs(differ); end + + class << self + # Wraps provided matcher list in instance of + # MultiMatcherDiff. + # + # @api private + # @param matchers [Array] list of matchers to wrap + # @return [RSpec::Matchers::MultiMatcherDiff] + # + # source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#37 + def for_many_matchers(matchers); end + + # Wraps provided expected value in instance of + # MultiMatcherDiff. If provided value is already an + # MultiMatcherDiff then it just returns it. + # + # @api private + # @param expected [Any] value to be wrapped + # @param actual [Any] value + # @return [RSpec::Matchers::MultiMatcherDiff] + # + # source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#27 + def from(expected, actual); end + + private + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#58 + def diff_label_for(matcher); end + + # @api private + # + # source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#62 + def truncated(description); end + end +end + +# Default diff label when there is only one matcher in diff +# output +# +# @api private +# @private +# +# source://rspec-expectations//lib/rspec/matchers/multi_matcher_diff.rb#10 +RSpec::Matchers::MultiMatcherDiff::DEFAULT_DIFF_LABEL = T.let(T.unsafe(nil), String) + +# Maximum readable matcher description length +# +# @api private +# @private +# +# source://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/examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec-mocks@3.13.1.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec-mocks@3.13.1.rbi new file mode 100644 index 0000000..a86c634 --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec-mocks@3.13.1.rbi @@ -0,0 +1,5341 @@ +# 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. +# +# source://rspec-mocks//lib/rspec/mocks/instance_method_stasher.rb#1 +module RSpec + class << self + # source://rspec-core/3.13.1/lib/rspec/core.rb#70 + def clear_examples; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#85 + def configuration; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#49 + def configuration=(_arg0); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#97 + def configure; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#194 + def const_missing(name); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def context(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#122 + def current_example; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#128 + def current_example=(example); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#154 + def current_scope; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#134 + def current_scope=(scope); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def describe(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def example_group(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def fcontext(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def fdescribe(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#58 + def reset; end + + # source://rspec-core/3.13.1/lib/rspec/core/shared_example_group.rb#110 + def shared_context(name, *args, &block); end + + # source://rspec-core/3.13.1/lib/rspec/core/shared_example_group.rb#110 + def shared_examples(name, *args, &block); end + + # source://rspec-core/3.13.1/lib/rspec/core/shared_example_group.rb#110 + def shared_examples_for(name, *args, &block); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#160 + def world; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#49 + def world=(_arg0); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def xcontext(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def xdescribe(*args, &example_group_block); end + end +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). +# +# source://rspec-mocks//lib/rspec/mocks/instance_method_stasher.rb#2 +module RSpec::Mocks + class << self + # Adds an allowance (stub) on `subject` + # + # @example Defines the implementation of `foo` on `bar`, using the passed block + # x = 0 + # RSpec::Mocks.allow_message(bar, :foo) { x += 1 } + # @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 + # + # source://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. + # + # source://rspec-mocks//lib/rspec/mocks/configuration.rb#206 + def configuration; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#386 + def error_generator; end + + # Sets a message expectation on `subject`. + # + # @example Expect the message `foo` to receive `bar`, then call it + # RSpec::Mocks.expect_message(bar, :foo) + # bar.foo + # @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 + # + # source://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. + # + # source://rspec-mocks//lib/rspec/mocks.rb#38 + def setup; end + + # @private + # + # source://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. + # + # source://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. + # + # source://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 + # + # source://rspec-mocks//lib/rspec/mocks.rb#92 + def with_temporary_scope; end + end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/targets.rb#92 +class RSpec::Mocks::AllowanceTarget < ::RSpec::Mocks::TargetBase + # source://rspec-mocks//lib/rspec/mocks/targets.rb#93 + def expression; end + + # source://rspec-mocks//lib/rspec/mocks/targets.rb#29 + def not_to(matcher, *_args); end + + # source://rspec-mocks//lib/rspec/mocks/targets.rb#6 + def to(matcher, &block); end + + # source://rspec-mocks//lib/rspec/mocks/targets.rb#29 + def to_not(matcher, *_args); end +end + +# Handles the implementation of an `and_invoke` implementation. +# +# @private +# +# source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#737 +class RSpec::Mocks::AndInvokeImplementation + # @return [AndInvokeImplementation] a new instance of AndInvokeImplementation + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#738 + def initialize(procs_to_invoke); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#742 + def call(*args, &block); end +end + +# Handles the implementation of an `and_return` implementation. +# +# @private +# +# source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#721 +class RSpec::Mocks::AndReturnImplementation + # @return [AndReturnImplementation] a new instance of AndReturnImplementation + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#722 + def initialize(values_to_return); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#726 + def call(*_args_to_ignore, &_block); end +end + +# Represents an `and_call_original` implementation. +# +# @private +# +# source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#779 +class RSpec::Mocks::AndWrapOriginalImplementation + # @return [AndWrapOriginalImplementation] a new instance of AndWrapOriginalImplementation + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#780 + def initialize(method, block); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#807 + def call(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#787 + def initial_action=(_value); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#803 + def inner_action; end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#791 + def inner_action=(_value); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#799 + def present?; end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#795 + def terminal_action=(_value); end + + private + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#814 + def cannot_modify_further_error; end +end + +# source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#785 +class RSpec::Mocks::AndWrapOriginalImplementation::CannotModifyFurtherError < ::StandardError; end + +# Handles the implementation of an `and_yield` declaration. +# +# @private +# +# source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#694 +class RSpec::Mocks::AndYieldImplementation + # @return [AndYieldImplementation] a new instance of AndYieldImplementation + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#695 + def initialize(args_to_yield, eval_context, error_generator); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#701 + def call(*_args_to_ignore, &block); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#4 +module RSpec::Mocks::AnyInstance + class << self + # source://rspec-mocks//lib/rspec/mocks/any_instance/error_generator.rb#26 + def error_generator; end + end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#6 +class RSpec::Mocks::AnyInstance::Chain + include ::RSpec::Mocks::AnyInstance::Chain::Customizations + + # @return [Chain] a new instance of Chain + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#7 + def initialize(recorder, *args, &block); end + + # @private + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#61 + def constrained_to_any_of?(*constraints); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#75 + def expectation_fulfilled!; end + + # @private + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#70 + def matches_args?(*args); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#79 + def never; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#53 + def playback!(instance); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#84 + def with(*args, &block); end + + private + + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#99 + def last_message; end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#95 + def messages; end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#91 + def negated?; end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#103 + def record(rspec_method_name, *args, &block); end +end + +# Provides convenience methods for recording customizations on message +# expectations. +# +# @private +# +# source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#18 +module RSpec::Mocks::AnyInstance::Chain::Customizations + # Records the `and_call_original` message for playback against an instance that + # invokes a method stubbed or mocked using `any_instance`. + # + # @see RSpec::Mocks::MessageExpectation#and_call_original + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#27 + def and_call_original(*args, &block); end + + # Records the `and_raise` message for playback against an instance that + # invokes a method stubbed or mocked using `any_instance`. + # + # @see RSpec::Mocks::MessageExpectation#and_raise + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#27 + def and_raise(*args, &block); end + + # Records the `and_return` message for playback against an instance that + # invokes a method stubbed or mocked using `any_instance`. + # + # @see RSpec::Mocks::MessageExpectation#and_return + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#27 + def and_return(*args, &block); end + + # Records the `and_throw` message for playback against an instance that + # invokes a method stubbed or mocked using `any_instance`. + # + # @see RSpec::Mocks::MessageExpectation#and_throw + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#27 + def and_throw(*args, &block); end + + # Records the `and_wrap_original` message for playback against an instance that + # invokes a method stubbed or mocked using `any_instance`. + # + # @see RSpec::Mocks::MessageExpectation#and_wrap_original + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#27 + def and_wrap_original(*args, &block); end + + # Records the `and_yield` message for playback against an instance that + # invokes a method stubbed or mocked using `any_instance`. + # + # @see RSpec::Mocks::MessageExpectation#and_yield + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#27 + def and_yield(*args, &block); end + + # Records the `at_least` message for playback against an instance that + # invokes a method stubbed or mocked using `any_instance`. + # + # @see RSpec::Mocks::MessageExpectation#at_least + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#27 + def at_least(*args, &block); end + + # Records the `at_most` message for playback against an instance that + # invokes a method stubbed or mocked using `any_instance`. + # + # @see RSpec::Mocks::MessageExpectation#at_most + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#27 + def at_most(*args, &block); end + + # Records the `exactly` message for playback against an instance that + # invokes a method stubbed or mocked using `any_instance`. + # + # @see RSpec::Mocks::MessageExpectation#exactly + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#27 + def exactly(*args, &block); end + + # Records the `never` message for playback against an instance that + # invokes a method stubbed or mocked using `any_instance`. + # + # @see RSpec::Mocks::MessageExpectation#never + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#27 + def never(*args, &block); end + + # Records the `once` message for playback against an instance that + # invokes a method stubbed or mocked using `any_instance`. + # + # @see RSpec::Mocks::MessageExpectation#once + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#27 + def once(*args, &block); end + + # Records the `thrice` message for playback against an instance that + # invokes a method stubbed or mocked using `any_instance`. + # + # @see RSpec::Mocks::MessageExpectation#thrice + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#27 + def thrice(*args, &block); end + + # Records the `time` message for playback against an instance that + # invokes a method stubbed or mocked using `any_instance`. + # + # @see RSpec::Mocks::MessageExpectation#time + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#27 + def time(*args, &block); end + + # Records the `times` message for playback against an instance that + # invokes a method stubbed or mocked using `any_instance`. + # + # @see RSpec::Mocks::MessageExpectation#times + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#27 + def times(*args, &block); end + + # Records the `twice` message for playback against an instance that + # invokes a method stubbed or mocked using `any_instance`. + # + # @see RSpec::Mocks::MessageExpectation#twice + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#27 + def twice(*args, &block); end + + # Records the `with` message for playback against an instance that + # invokes a method stubbed or mocked using `any_instance`. + # + # @see RSpec::Mocks::MessageExpectation#with + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#27 + def with(*args, &block); end + + class << self + # source://rspec-mocks//lib/rspec/mocks/any_instance/chain.rb#26 + def record(method_name); end + end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/any_instance/error_generator.rb#5 +class RSpec::Mocks::AnyInstance::ErrorGenerator < ::RSpec::Mocks::ErrorGenerator + # source://rspec-mocks//lib/rspec/mocks/any_instance/error_generator.rb#11 + def raise_does_not_implement_error(klass, method_name); end + + # source://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 + + # source://rspec-mocks//lib/rspec/mocks/any_instance/error_generator.rb#20 + def raise_not_supported_with_prepend_error(method_name, problem_mod); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/error_generator.rb#6 + def raise_second_instance_received_message_error(unfulfilled_expectations); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/any_instance/expect_chain_chain.rb#5 +class RSpec::Mocks::AnyInstance::ExpectChainChain < ::RSpec::Mocks::AnyInstance::StubChain + # @return [ExpectChainChain] a new instance of ExpectChainChain + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/expect_chain_chain.rb#6 + def initialize(*args); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/expect_chain_chain.rb#11 + def expectation_fulfilled?; end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/expect_chain_chain.rb#15 + def playback!(instance); end + + private + + # source://rspec-mocks//lib/rspec/mocks/any_instance/expect_chain_chain.rb#21 + def create_message_expectation_on(instance); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/expect_chain_chain.rb#25 + def invocation_order; end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/any_instance/expectation_chain.rb#5 +class RSpec::Mocks::AnyInstance::ExpectationChain < ::RSpec::Mocks::AnyInstance::Chain + # @return [ExpectationChain] a new instance of ExpectationChain + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/expectation_chain.rb#10 + def initialize(*args, &block); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/expectation_chain.rb#6 + def expectation_fulfilled?; end + + private + + # source://rspec-mocks//lib/rspec/mocks/any_instance/expectation_chain.rb#17 + def verify_invocation_order(_rspec_method_name, *_args, &_block); end +end + +# 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). +# +# @private +# +# source://rspec-mocks//lib/rspec/mocks/any_instance/proxy.rb#103 +class RSpec::Mocks::AnyInstance::FluentInterfaceProxy < ::BasicObject + # @return [FluentInterfaceProxy] a new instance of FluentInterfaceProxy + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/proxy.rb#104 + def initialize(targets); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/proxy.rb#118 + def method_missing(*args, &block); end + + private + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/proxy.rb#109 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/any_instance/message_chains.rb#5 +class RSpec::Mocks::AnyInstance::MessageChains + # @return [MessageChains] a new instance of MessageChains + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/message_chains.rb#6 + def initialize; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/message_chains.rb#11 + def [](method_name); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/message_chains.rb#16 + def add(method_name, chain); end + + # @private + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/message_chains.rb#43 + def all_expectations_fulfilled?; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/message_chains.rb#36 + def each_unfulfilled_expectation_matching(method_name, *args); end + + # @private + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/message_chains.rb#29 + def has_expectation?(method_name); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/message_chains.rb#64 + def playback!(instance, method_name); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/message_chains.rb#57 + def received_expected_message!(method_name); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/message_chains.rb#22 + def remove_stub_chains_for!(method_name); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/message_chains.rb#50 + def unfulfilled_expectations; end + + private + + # source://rspec-mocks//lib/rspec/mocks/any_instance/message_chains.rb#73 + def raise_if_second_instance_to_receive_message(instance); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/any_instance/expectation_chain.rb#22 +class RSpec::Mocks::AnyInstance::PositiveExpectationChain < ::RSpec::Mocks::AnyInstance::ExpectationChain + private + + # source://rspec-mocks//lib/rspec/mocks/any_instance/expectation_chain.rb#25 + def create_message_expectation_on(instance); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/expectation_chain.rb#44 + def invocation_order; end +end + +# source://rspec-mocks//lib/rspec/mocks/any_instance/expectation_chain.rb#38 +RSpec::Mocks::AnyInstance::PositiveExpectationChain::ExpectationInvocationOrder = T.let(T.unsafe(nil), Hash) + +# 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. +# +# @private +# +# source://rspec-mocks//lib/rspec/mocks/any_instance/proxy.rb#21 +class RSpec::Mocks::AnyInstance::Proxy + # @return [Proxy] a new instance of Proxy + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/proxy.rb#22 + def initialize(recorder, target_proxies); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/proxy.rb#55 + def expect_chain(*chain, &block); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/proxy.rb#27 + def klass; end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/proxy.rb#71 + def should_not_receive(method_name, &block); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/proxy.rb#61 + def should_receive(method_name, &block); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/proxy.rb#31 + def stub(method_name_or_method_map, &block); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/proxy.rb#49 + def stub_chain(*chain, &block); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/proxy.rb#43 + def unstub(method_name); end + + private + + # source://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 +# +# source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#12 +class RSpec::Mocks::AnyInstance::Recorder + # @return [Recorder] a new instance of Recorder + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#16 + def initialize(klass); end + + # @private + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#127 + def already_observing?(method_name); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#122 + def build_alias_method_name(method_name); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#53 + def expect_chain(*method_names_and_optional_return_values, &block); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#117 + def instance_that_received(method_name); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#14 + def klass; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#14 + def message_chains; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#132 + def notify_received_message(_object, message, args, _blk); end + + # @private + # + # source://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 + # + # source://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 + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#66 + def should_receive(method_name, &block); end + + # @private + # + # source://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 + # + # source://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 + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#45 + def stub_chain(*method_names_and_optional_return_values, &block); end + + # @private + # + # source://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 + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#83 + def unstub(method_name); end + + # Used internally to verify that message expectations have been + # fulfilled. + # + # @api private + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#96 + def verify; end + + protected + + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#148 + def stop_observing!(method_name); end + + private + + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#282 + def allow_no_prepended_module_definition_of(method_name); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#159 + def ancestor_is_an_observer?(ancestor, method_name); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#235 + def backup_method!(method_name); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#269 + def mark_invoked!(method_name); end + + # @yield [args.first, args] + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#178 + def normalize_chain(*args); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#249 + def observe!(method_name); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#245 + def public_protected_or_private_method_defined?(method_name); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#183 + def received_expected_message!(method_name); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#229 + def remove_dummy_method!(method_name); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#189 + def restore_method!(method_name); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#197 + def restore_original_method!(method_name); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#166 + def super_class_observers_for(method_name); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/recorder.rb#172 + def super_class_observing?(method_name); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/any_instance/stub_chain.rb#5 +class RSpec::Mocks::AnyInstance::StubChain < ::RSpec::Mocks::AnyInstance::Chain + # @private + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/stub_chain.rb#7 + def expectation_fulfilled?; end + + private + + # source://rspec-mocks//lib/rspec/mocks/any_instance/stub_chain.rb#13 + def create_message_expectation_on(instance); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/stub_chain.rb#40 + def invocation_order; end + + # @raise [NoMethodError] + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/stub_chain.rb#44 + def verify_invocation_order(rspec_method_name, *_args, &_block); end +end + +# source://rspec-mocks//lib/rspec/mocks/any_instance/stub_chain.rb#38 +RSpec::Mocks::AnyInstance::StubChain::EmptyInvocationOrder = T.let(T.unsafe(nil), Hash) + +# source://rspec-mocks//lib/rspec/mocks/any_instance/stub_chain.rb#28 +RSpec::Mocks::AnyInstance::StubChain::InvocationOrder = T.let(T.unsafe(nil), Hash) + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/any_instance/stub_chain_chain.rb#5 +class RSpec::Mocks::AnyInstance::StubChainChain < ::RSpec::Mocks::AnyInstance::StubChain + # @return [StubChainChain] a new instance of StubChainChain + # + # source://rspec-mocks//lib/rspec/mocks/any_instance/stub_chain_chain.rb#6 + def initialize(*args); end + + private + + # source://rspec-mocks//lib/rspec/mocks/any_instance/stub_chain_chain.rb#13 + def create_message_expectation_on(instance); end + + # source://rspec-mocks//lib/rspec/mocks/any_instance/stub_chain_chain.rb#17 + def invocation_order; end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/targets.rb#103 +class RSpec::Mocks::AnyInstanceAllowanceTarget < ::RSpec::Mocks::TargetBase + # source://rspec-mocks//lib/rspec/mocks/targets.rb#104 + def expression; end + + # source://rspec-mocks//lib/rspec/mocks/targets.rb#29 + def not_to(matcher, *_args); end + + # source://rspec-mocks//lib/rspec/mocks/targets.rb#6 + def to(matcher, &block); end + + # source://rspec-mocks//lib/rspec/mocks/targets.rb#29 + def to_not(matcher, *_args); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/targets.rb#114 +class RSpec::Mocks::AnyInstanceExpectationTarget < ::RSpec::Mocks::TargetBase + # source://rspec-mocks//lib/rspec/mocks/targets.rb#115 + def expression; end + + # source://rspec-mocks//lib/rspec/mocks/targets.rb#16 + def not_to(matcher, &block); end + + # source://rspec-mocks//lib/rspec/mocks/targets.rb#6 + def to(matcher, &block); end + + # source://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 +# +# source://rspec-mocks//lib/rspec/mocks/argument_list_matcher.rb#33 +class RSpec::Mocks::ArgumentListMatcher + # Initializes an `ArgumentListMatcher` with a collection of literal + # values and/or argument matchers. + # + # @api public + # @param expected_args [Array] a list of expected literals and/or argument matchers + # @return [ArgumentListMatcher] a new instance of ArgumentListMatcher + # @see ArgumentMatchers + # @see #args_match? + # + # source://rspec-mocks//lib/rspec/mocks/argument_list_matcher.rb#45 + def initialize(*expected_args, **_arg1); end + + # Matches each element in the `expected_args` against the element in the same + # position of the arguments passed to `new`. + # + # @api public + # @param actual_args [Array] + # @return [Boolean] + # @see #initialize + # + # source://rspec-mocks//lib/rspec/mocks/argument_list_matcher.rb#58 + def args_match?(*actual_args, **_arg1); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/argument_list_matcher.rb#35 + def expected_args; end + + # Resolves abstract arg placeholders like `no_args` and `any_args` into + # a more concrete arg list based on the provided `actual_args`. + # + # @private + # + # source://rspec-mocks//lib/rspec/mocks/argument_list_matcher.rb#81 + def resolve_expected_args_based_on(actual_args); end + + private + + # source://rspec-mocks//lib/rspec/mocks/argument_list_matcher.rb#100 + def ensure_expected_args_valid!; end + + # source://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 +# +# source://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 +# +# source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#16 +module RSpec::Mocks::ArgumentMatchers + # Matches if `arg.kind_of?(klass)` + # + # @example + # expect(object).to receive(:message).with(kind_of(Thing)) + # + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#121 + def a_kind_of(klass); end + + # Matches if `arg.instance_of?(klass)` + # + # @example + # expect(object).to receive(:message).with(instance_of(Thing)) + # + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#111 + 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) + # + # source://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) + # + # source://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])) + # + # source://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])) + # + # source://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()) + # + # source://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)) + # + # source://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)) + # + # source://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)) + # + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#70 + def hash_including(*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)) + # + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#80 + def hash_not_including(*args); end + + # Matches if `arg.instance_of?(klass)` + # + # @example + # expect(object).to receive(:message).with(instance_of(Thing)) + # + # source://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)) + # + # source://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) + # + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#42 + def no_args; end + + class << self + # @private + # + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#128 + def anythingize_lonely_keys(*args); end + end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#159 +class RSpec::Mocks::ArgumentMatchers::AnyArgMatcher < ::RSpec::Mocks::ArgumentMatchers::SingletonMatcher + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#160 + def ===(_other); end + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#164 + def description; end +end + +# source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#147 +RSpec::Mocks::ArgumentMatchers::AnyArgMatcher::INSTANCE = T.let(T.unsafe(nil), RSpec::Mocks::ArgumentMatchers::AnyArgMatcher) + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#152 +class RSpec::Mocks::ArgumentMatchers::AnyArgsMatcher < ::RSpec::Mocks::ArgumentMatchers::SingletonMatcher + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#153 + def description; end +end + +# source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#147 +RSpec::Mocks::ArgumentMatchers::AnyArgsMatcher::INSTANCE = T.let(T.unsafe(nil), RSpec::Mocks::ArgumentMatchers::AnyArgsMatcher) + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#274 +class RSpec::Mocks::ArgumentMatchers::ArrayExcludingMatcher + # @return [ArrayExcludingMatcher] a new instance of ArrayExcludingMatcher + # + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#275 + def initialize(unexpected); end + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#279 + def ===(actual); end + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#292 + def description; end + + private + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#298 + def formatted_unexpected_values; end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#242 +class RSpec::Mocks::ArgumentMatchers::ArrayIncludingMatcher + # @return [ArrayIncludingMatcher] a new instance of ArrayIncludingMatcher + # + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#243 + def initialize(expected); end + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#247 + def ===(actual); end + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#260 + def description; end + + private + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#266 + def formatted_expected_values; end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#188 +class RSpec::Mocks::ArgumentMatchers::BaseHashMatcher + # @return [BaseHashMatcher] a new instance of BaseHashMatcher + # + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#189 + def initialize(expected); end + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#193 + def ===(predicate, actual); end + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#201 + def description(name); end + + private + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#207 + def formatted_expected_hash; end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#177 +class RSpec::Mocks::ArgumentMatchers::BooleanMatcher < ::RSpec::Mocks::ArgumentMatchers::SingletonMatcher + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#178 + def ===(value); end + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#182 + def description; end +end + +# source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#147 +RSpec::Mocks::ArgumentMatchers::BooleanMatcher::INSTANCE = T.let(T.unsafe(nil), RSpec::Mocks::ArgumentMatchers::BooleanMatcher) + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#306 +class RSpec::Mocks::ArgumentMatchers::DuckTypeMatcher + # @return [DuckTypeMatcher] a new instance of DuckTypeMatcher + # + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#307 + def initialize(*methods_to_respond_to); end + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#311 + def ===(value); end + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#315 + def description; end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#231 +class RSpec::Mocks::ArgumentMatchers::HashExcludingMatcher < ::RSpec::Mocks::ArgumentMatchers::BaseHashMatcher + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#232 + def ===(actual); end + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#236 + def description; end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#220 +class RSpec::Mocks::ArgumentMatchers::HashIncludingMatcher < ::RSpec::Mocks::ArgumentMatchers::BaseHashMatcher + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#221 + def ===(actual); end + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#225 + def description; end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#321 +class RSpec::Mocks::ArgumentMatchers::InstanceOf + # @return [InstanceOf] a new instance of InstanceOf + # + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#322 + def initialize(klass); end + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#326 + def ===(actual); end + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#330 + def description; end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#336 +class RSpec::Mocks::ArgumentMatchers::KindOf + # @return [KindOf] a new instance of KindOf + # + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#337 + def initialize(klass); end + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#341 + def ===(actual); end + + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#345 + def description; end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#170 +class RSpec::Mocks::ArgumentMatchers::NoArgsMatcher < ::RSpec::Mocks::ArgumentMatchers::SingletonMatcher + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#171 + def description; end +end + +# source://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 +# +# source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#143 +class RSpec::Mocks::ArgumentMatchers::SingletonMatcher + class << self + # @private + # + # source://rspec-mocks//lib/rspec/mocks/argument_matchers.rb#146 + def inherited(subklass); end + + private + + def new(*_arg0); end + end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#7 +class RSpec::Mocks::CallbackInvocationStrategy + # source://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. +# +# source://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 +# +# source://rspec-mocks//lib/rspec/mocks/method_reference.rb#184 +class RSpec::Mocks::ClassNewMethodReference < ::RSpec::Mocks::ObjectMethodReference + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#207 + def with_signature; end + + class << self + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#185 + def applies_to?(method_name); end + + # Ruby 2's Method#== is too strict + # + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#198 + def uses_class_new?(klass); end + end +end + +# source://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 +# +# source://rspec-mocks//lib/rspec/mocks/verifying_double.rb#119 +class RSpec::Mocks::ClassVerifyingDouble < ::Module + include ::RSpec::Mocks::TestDouble + include ::RSpec::Mocks::VerifyingDouble + include ::RSpec::Mocks::ObjectVerifyingDoubleMethods +end + +# Provides configuration options for rspec-mocks. +# +# source://rspec-mocks//lib/rspec/mocks/configuration.rb#4 +class RSpec::Mocks::Configuration + # @return [Configuration] a new instance of Configuration + # + # source://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 + # + # source://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 + # + # source://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 + # + # source://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 + # + # source://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. + # + # @return [Boolean] + # + # source://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. + # + # source://rspec-mocks//lib/rspec/mocks/configuration.rb#188 + def patch_marshal_to_support_partial_doubles=(val); end + + # Resets the configured syntax to the default. + # + # @api private + # + # source://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 + # + # source://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. + # + # end + # + # @example + # RSpec.configure do |rspec| + # rspec.mock_with :rspec do |mocks| + # mocks.syntax = [:expect, :should] + # end + # + # source://rspec-mocks//lib/rspec/mocks/configuration.rb#81 + def syntax=(*values); end + + # Used to track whether we are temporarily suppressing verifying partial + # doubles with `without_partial_double_verification { ... }` + # + # @private + # + # source://rspec-mocks//lib/rspec/mocks/configuration.rb#161 + def temporarily_suppress_partial_double_verification; end + + # Used to track whether we are temporarily suppressing verifying partial + # doubles with `without_partial_double_verification { ... }` + # + # @private + # + # source://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. + # + # source://rspec-mocks//lib/rspec/mocks/configuration.rb#145 + def transfer_nested_constants=(_arg0); end + + # @return [Boolean] + # + # source://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! + # + # source://rspec-mocks//lib/rspec/mocks/configuration.rb#120 + def verify_doubled_constant_names=(_arg0); end + + # @return [Boolean] + # + # source://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. + # + # source://rspec-mocks//lib/rspec/mocks/configuration.rb#150 + def verify_partial_doubles=(val); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/configuration.rb#154 + def verify_partial_doubles?; end + + # Returns an array of blocks to call when verifying doubles + # + # @api private + # + # source://rspec-mocks//lib/rspec/mocks/configuration.rb#135 + def verifying_double_callbacks; end + + # Provides a way to perform customisations when verifying doubles. + # + # @example + # RSpec::Mocks.configuration.before_verifying_doubles do |ref| + # ref.some_method! + # end + # + # source://rspec-mocks//lib/rspec/mocks/configuration.rb#128 + 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 + # + # source://rspec-mocks//lib/rspec/mocks/configuration.rb#46 + def yield_receiver_to_any_instance_implementation_blocks=(_arg0); end + + # @return [Boolean] + # + # source://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. +# +# source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#7 +class RSpec::Mocks::Constant + extend ::RSpec::Support::RecursiveConstMethods + + # @api private + # @return [Constant] a new instance of Constant + # @yield [_self] + # @yieldparam _self [RSpec::Mocks::Constant] the object that the method was called on + # + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#11 + def initialize(name); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#29 + def hidden=(_arg0); end + + # @return [Boolean] Whether or not rspec-mocks has hidden + # this constant. + # + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#51 + def hidden?; end + + # The default `to_s` isn't very useful, so a custom version is provided. + # + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#62 + def inspect; end + + # @return [Boolean] Whether or not rspec-mocks has mutated + # (stubbed or hidden) this constant. + # + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#39 + def mutated?; end + + # @return [String] The fully qualified name of the constant. + # + # source://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. + # + # source://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. + # + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#26 + def original_value=(_arg0); end + + # @private + # + # source://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. + # + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#33 + def previously_defined?; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#29 + def stubbed=(_arg0); end + + # @return [Boolean] Whether or not rspec-mocks has stubbed + # this constant. + # + # source://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. + # + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#62 + def to_s; end + + # @private + # + # source://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. + # + # source://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 name [String] the name of the constant + # @return [Constant] an object containing information about the named + # constant. + # + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#86 + def original(name); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#68 + def unmutated(name); end + end +end + +# Provides a means to stub constants. +# +# source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#93 +class RSpec::Mocks::ConstantMutator + extend ::RSpec::Support::RecursiveConstMethods + + class << self + # Hides a constant. + # + # @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). + # @param constant_name [String] The fully qualified name of the constant. + # The current constant scoping at the point of call is not considered. + # @see ExampleMethods#hide_const + # + # source://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 + # + # source://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 + # + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#331 + def raise_on_invalid_const; end + + # Stubs a constant. + # + # @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). + # @option options + # @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. + # @return [Object] the stubbed value of the constant + # @see ExampleMethods#stub_const + # + # source://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 +# +# source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#139 +class RSpec::Mocks::ConstantMutator::BaseMutator + include ::RSpec::Support::RecursiveConstMethods + + # @return [BaseMutator] a new instance of BaseMutator + # + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#144 + def initialize(full_constant_name, mutated_value, transfer_nested_constants); end + + # Returns the value of attribute full_constant_name. + # + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#142 + def full_constant_name; end + + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#160 + def idempotently_reset; end + + # Returns the value of attribute original_value. + # + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#142 + def original_value; end + + # source://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 +# +# source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#169 +class RSpec::Mocks::ConstantMutator::ConstantHider < ::RSpec::Mocks::ConstantMutator::BaseMutator + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#170 + def mutate; end + + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#188 + def reset; end + + # source://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 +# +# source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#197 +class RSpec::Mocks::ConstantMutator::DefinedConstantReplacer < ::RSpec::Mocks::ConstantMutator::BaseMutator + # @return [DefinedConstantReplacer] a new instance of DefinedConstantReplacer + # + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#198 + def initialize(*args); end + + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#203 + def mutate; end + + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#223 + def reset; end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#268 + def should_transfer_nested_constants?; end + + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#215 + def to_constant; end + + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#232 + def transfer_nested_constants; end + + # source://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 +# +# source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#278 +class RSpec::Mocks::ConstantMutator::UndefinedConstantSetter < ::RSpec::Mocks::ConstantMutator::BaseMutator + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#279 + def mutate; end + + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#299 + def reset; end + + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#291 + def to_constant; end + + private + + # source://rspec-mocks//lib/rspec/mocks/mutate_const.rb#305 + def name_for(parent, name); end +end + +# @private +# +# source://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 +# +# source://rspec-mocks//lib/rspec/mocks/object_reference.rb#56 +class RSpec::Mocks::DirectObjectReference + # @param object [Object] the object to which this refers + # @return [DirectObjectReference] a new instance of DirectObjectReference + # + # source://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`. + # + # @raise [ArgumentError] + # + # source://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] + # + # source://rspec-mocks//lib/rspec/mocks/object_reference.rb#85 + def defined?; end + + # @return [String] the object's description (via `#inspect`). + # + # source://rspec-mocks//lib/rspec/mocks/object_reference.rb#63 + def description; end + + # The target of the verifying double (the object itself). + # + # @return [Object] + # + # source://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. + # + # source://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. +# +# source://rspec-mocks//lib/rspec/mocks/test_double.rb#132 +class RSpec::Mocks::Double + include ::RSpec::Mocks::TestDouble +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/error_generator.rb#36 +class RSpec::Mocks::ErrorGenerator + # @return [ErrorGenerator] a new instance of ErrorGenerator + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#39 + def initialize(target = T.unsafe(nil)); end + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#71 + def default_error_message(expectation, expected_args, actual_args); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#132 + def describe_expectation(verb, message, expected_received_count, _actual_received_count, args); end + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#215 + def expectation_on_nil_message(method_name); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#222 + def intro(unwrapped = T.unsafe(nil)); end + + # @private + # + # source://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 + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#44 + def opts; end + + # Sets the attribute opts + # + # @param value the value to set the attribute opts to. + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#37 + def opts=(_arg0); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#203 + def raise_already_invoked_error(message, calling_customization); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#193 + def raise_cant_constrain_count_for_negated_have_received_error(count_constraint); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#170 + def raise_double_negation_error(wrapped_expression); end + + # @private + # + # source://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 + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#164 + def raise_expectation_on_mocked_method(method); end + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#211 + def raise_expectation_on_nil_error(method_name); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#158 + def raise_expectation_on_unstubbed_method(method); end + + # @private + # @raise [ExpiredTestDoubleError] + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#123 + def raise_expired_test_double_error; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#187 + def raise_have_received_disallowed(type, reason); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#118 + def raise_invalid_arguments_error(verifier); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#198 + def raise_method_not_stubbed_error(method_name); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#142 + def raise_missing_block_error(args_to_yield); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#59 + def raise_missing_default_stub_error(expectation, args_for_multiple_calls); end + + # @private + # @raise [NoMethodError] + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#111 + def raise_non_public_error(method_name, visibility); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#152 + def raise_only_valid_on_a_partial_double(method); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#137 + def raise_out_of_order_error(message); end + + # @private + # + # source://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 + # + # source://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 + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#49 + def raise_unexpected_message_error(message, args); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#87 + def raise_unimplemented_error(doubled_module, method_name, object); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#178 + def raise_verifying_double_not_defined_error(ref); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#147 + def raise_wrong_arity_error(args_to_yield, signature); end + + private + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#328 + def __raise(message, backtrace_line = T.unsafe(nil), source_id = T.unsafe(nil)); end + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#356 + def arg_list(args); end + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#366 + def count_message(count, expectation_count_type = T.unsafe(nil)); end + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#302 + def diff_message(expected_args, actual_args); end + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#324 + def differ; end + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#268 + def error_message(expectation, args_for_multiple_calls); end + + # source://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 + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#351 + def format_args(args); end + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#360 + def format_received_args(args_for_multiple_calls); end + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#380 + def group_count(index, args); end + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#376 + def grouped_args(args); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#320 + def list_of_exactly_one_string?(args); end + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#347 + def notify(*args); end + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#342 + def prepend_to_backtrace(exception, line); end + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#250 + def received_part_of_expectation_error(actual_received_count, args); end + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#372 + def times(count); end + + # source://rspec-mocks//lib/rspec/mocks/error_generator.rb#264 + def unexpected_arguments_message(expected_args_string, actual_args_string); end + + # source://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. +# +# source://rspec-mocks//lib/rspec/mocks/example_methods.rb#9 +module RSpec::Mocks::ExampleMethods + include ::RSpec::Mocks::ArgumentMatchers + include ::RSpec::Mocks::ExampleMethods::ExpectHost + + # Used to wrap an object in preparation for stubbing a method + # on it. + # + # @example + # allow(dbl).to receive(:foo).with(5).and_return(:return_value) + # @note If you disable the `:expect` syntax this method will be undefined. + # + # source://rspec-mocks//lib/rspec/mocks/syntax.rb#128 + def allow(target); end + + # Used to wrap a class in preparation for stubbing a method + # on instances of it. + # + # @example + # allow_any_instance_of(MyClass).to receive(:foo) + # @note This is only available when you have enabled the `expect` syntax. + # + # source://rspec-mocks//lib/rspec/mocks/syntax.rb#136 + 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. + # + # source://rspec-mocks//lib/rspec/mocks/example_methods.rb#201 + def allow_message_expectations_on_nil; end + + # 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). + # + # @overload class_double + # @overload class_double + # @overload class_double + # @overload class_double + # @return ClassVerifyingDouble + # + # source://rspec-mocks//lib/rspec/mocks/example_methods.rb#79 + def class_double(doubled_class, *args); end + + # 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. + # + # @overload class_spy + # @overload class_spy + # @overload class_spy + # @overload class_spy + # @return ClassVerifyingDouble + # + # source://rspec-mocks//lib/rspec/mocks/example_methods.rb#191 + def class_spy(*args); end + + # 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" + # @overload double + # @overload double + # @overload double + # @overload double + # @return [Double] + # + # source://rspec-mocks//lib/rspec/mocks/example_methods.rb#34 + def double(*args); end + + # Used to wrap a class in preparation for setting a mock expectation + # on instances of it. + # + # @example + # expect_any_instance_of(MyClass).to receive(:foo) + # @note If you disable the `:expect` syntax this method will be undefined. + # + # source://rspec-mocks//lib/rspec/mocks/syntax.rb#132 + 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. + # + # @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. + # @param method_name [Symbol] name of the method expected to have been + # called. + # + # source://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. + # + # @example + # hide_const("MyClass") # => MyClass is now an undefined constant + # @param constant_name [String] The fully qualified name of the constant. + # The current constant scoping at the point of call is not considered. + # + # source://rspec-mocks//lib/rspec/mocks/example_methods.rb#256 + def hide_const(constant_name); end + + # 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). + # + # @overload instance_double + # @overload instance_double + # @overload instance_double + # @overload instance_double + # @return InstanceVerifyingDouble + # + # source://rspec-mocks//lib/rspec/mocks/example_methods.rb#56 + def instance_double(doubled_class, *args); end + + # 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. + # + # @overload instance_spy + # @overload instance_spy + # @overload instance_spy + # @overload instance_spy + # @return InstanceVerifyingDouble + # + # source://rspec-mocks//lib/rspec/mocks/example_methods.rb#144 + def instance_spy(*args); end + + # 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). + # + # @overload object_double + # @overload object_double + # @overload object_double + # @overload object_double + # @return ObjectVerifyingDouble + # + # source://rspec-mocks//lib/rspec/mocks/example_methods.rb#102 + def object_double(object_or_name, *args); end + + # 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. + # + # @overload object_spy + # @overload object_spy + # @overload object_spy + # @overload object_spy + # @return ObjectVerifyingDouble + # + # source://rspec-mocks//lib/rspec/mocks/example_methods.rb#167 + def object_spy(*args); end + + # Used to specify a message that you expect or allow an object + # to receive. The object returned by `receive` supports the same + # fluent interface that `should_receive` and `stub` have always + # supported, allowing you to constrain the arguments or number of + # times, and configure how the object should respond to the message. + # + # @example + # expect(obj).to receive(:hello).with("world").exactly(3).times + # @note If you disable the `:expect` syntax this method will be undefined. + # + # source://rspec-mocks//lib/rspec/mocks/syntax.rb#114 + def receive(method_name, &block); end + + # stubs/mocks a chain of messages on an object or test double. + # + # ## Warning: + # + # Chains can be arbitrarily long, which makes it quite painless to + # violate the Law of Demeter in violent ways, so you should consider any + # use of `receive_message_chain` a code smell. Even though not all code smells + # indicate real problems (think fluent interfaces), `receive_message_chain` still + # results in brittle examples. For example, if you write + # `allow(foo).to receive_message_chain(:bar, :baz => 37)` in a spec and then the + # implementation calls `foo.baz.bar`, the stub will not work. + # + # @example + # allow(double).to receive_message_chain("foo.bar") { :baz } + # allow(double).to receive_message_chain(:foo, :bar => :baz) + # allow(double).to receive_message_chain(:foo, :bar) { :baz } + # + # # Given any of ^^ these three forms ^^: + # double.foo.bar # => :baz + # + # # Common use in Rails/ActiveRecord: + # allow(Article).to receive_message_chain("recent.published") { [Article.new] } + # @note If you disable the `:expect` syntax this method will be undefined. + # @overload receive_message_chain + # @overload receive_message_chain + # @overload receive_message_chain + # + # source://rspec-mocks//lib/rspec/mocks/syntax.rb#124 + def receive_message_chain(*messages, &block); end + + # Shorthand syntax used to setup message(s), and their return value(s), + # that you expect or allow an object to receive. The method takes a hash + # of messages and their respective return values. Unlike with `receive`, + # you cannot apply further customizations using a block or the fluent + # interface. + # + # @example + # allow(obj).to receive_messages(:speak => "Hello World") + # allow(obj).to receive_messages(:speak => "Hello", :meow => "Meow") + # @note If you disable the `:expect` syntax this method will be undefined. + # + # source://rspec-mocks//lib/rspec/mocks/syntax.rb#118 + def receive_messages(message_return_value_hash); end + + # 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. + # + # @overload spy + # @overload spy + # @overload spy + # @overload spy + # @return [Double] + # + # source://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. + # + # @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 + # @option options + # @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. + # @return [Object] the stubbed value of the constant + # + # source://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). + # + # source://rspec-mocks//lib/rspec/mocks/example_methods.rb#289 + def without_partial_double_verification; end + + class << self + # @private + # + # source://rspec-mocks//lib/rspec/mocks/example_methods.rb#423 + def declare_double(type, *args); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/example_methods.rb#408 + def declare_verifying_double(type, ref, *args); end + + # @private + # @private + # + # source://rspec-mocks//lib/rspec/mocks/example_methods.rb#401 + def extended(object); end + + # @private + # @private + # + # source://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. +# +# source://rspec-mocks//lib/rspec/mocks/example_methods.rb#430 +module RSpec::Mocks::ExampleMethods::ExpectHost + # source://rspec-mocks//lib/rspec/mocks/syntax.rb#142 + def expect(target); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/message_chain.rb#61 +class RSpec::Mocks::ExpectChain < ::RSpec::Mocks::MessageChain + private + + # source://rspec-mocks//lib/rspec/mocks/message_chain.rb#69 + def expectation(object, message, &return_block); end + + class << self + # @api private + # + # source://rspec-mocks//lib/rspec/mocks/message_chain.rb#63 + def expect_chain_on(object, *chain, &blk); end + end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/targets.rb#87 +class RSpec::Mocks::ExpectationTarget < ::RSpec::Mocks::TargetBase + include ::RSpec::Mocks::ExpectationTargetMethods +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/targets.rb#73 +module RSpec::Mocks::ExpectationTargetMethods + include ::RSpec::Mocks::TargetDelegationInstanceMethods + extend ::RSpec::Mocks::TargetDelegationClassMethods + + # source://rspec-mocks//lib/rspec/mocks/targets.rb#81 + def expression; end + + # source://rspec-mocks//lib/rspec/mocks/targets.rb#16 + def not_to(matcher, &block); end + + # source://rspec-mocks//lib/rspec/mocks/targets.rb#6 + def to(matcher, &block); end + + # source://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). +# +# source://rspec-mocks//lib/rspec/mocks/error_generator.rb#10 +class RSpec::Mocks::ExpiredTestDoubleError < ::RSpec::Mocks::MockExpectationError; end + +# @private +# +# source://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 +# +# source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#756 +class RSpec::Mocks::Implementation + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#759 + def call(*args, **_arg1, &block); end + + # Returns the value of attribute initial_action. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#757 + def initial_action; end + + # Sets the attribute initial_action + # + # @param value the value to set the attribute initial_action to. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#757 + def initial_action=(_arg0); end + + # Returns the value of attribute inner_action. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#757 + def inner_action; end + + # Sets the attribute inner_action + # + # @param value the value to set the attribute inner_action to. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#757 + def inner_action=(_arg0); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#766 + def present?; end + + # Returns the value of attribute terminal_action. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#757 + def terminal_action; end + + # Sets the attribute terminal_action + # + # @param value the value to set the attribute terminal_action to. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#757 + def terminal_action=(_arg0); end + + private + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#772 + def actions; end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/method_reference.rb#113 +class RSpec::Mocks::InstanceMethodReference < ::RSpec::Mocks::MethodReference + private + + # source://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. + # + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#116 + def method_defined?(mod); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#116 + def method_implemented?(mod); end + + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#143 + def visibility_from(mod); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/instance_method_stasher.rb#4 +class RSpec::Mocks::InstanceMethodStasher + # @return [InstanceMethodStasher] a new instance of InstanceMethodStasher + # + # source://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 + # + # source://rspec-mocks//lib/rspec/mocks/instance_method_stasher.rb#91 + def handle_restoration_failures; end + + # @private + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/instance_method_stasher.rb#49 + def method_is_stashed?; end + + # Returns the value of attribute original_method. + # + # source://rspec-mocks//lib/rspec/mocks/instance_method_stasher.rb#14 + def original_method; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/instance_method_stasher.rb#61 + def restore; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/instance_method_stasher.rb#54 + def stash; end + + private + + # @private + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/instance_method_stasher.rb#100 + def method_defined_directly_on_klass?; end + + # @private + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/instance_method_stasher.rb#105 + def method_defined_on_klass?(klass = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://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 +# +# source://rspec-mocks//lib/rspec/mocks/verifying_double.rb#71 +class RSpec::Mocks::InstanceVerifyingDouble + include ::RSpec::Mocks::TestDouble + include ::RSpec::Mocks::VerifyingDouble + + # source://rspec-mocks//lib/rspec/mocks/verifying_double.rb#75 + def __build_mock_proxy(order_group); end +end + +# Support for `patch_marshal_to_support_partial_doubles` configuration. +# +# @private +# +# source://rspec-mocks//lib/rspec/mocks/marshal_extension.rb#6 +class RSpec::Mocks::MarshalExtension + class << self + # source://rspec-mocks//lib/rspec/mocks/marshal_extension.rb#7 + def patch!; end + + # source://rspec-mocks//lib/rspec/mocks/marshal_extension.rb#27 + def unpatch!; end + end +end + +# Namespace for mock-related matchers. +# +# source://rspec-mocks//lib/rspec/mocks.rb#122 +module RSpec::Mocks::Matchers; end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/matchers/expectation_customization.rb#5 +class RSpec::Mocks::Matchers::ExpectationCustomization + # @return [ExpectationCustomization] a new instance of ExpectationCustomization + # + # source://rspec-mocks//lib/rspec/mocks/matchers/expectation_customization.rb#8 + def initialize(method_name, args, block); end + + # Returns the value of attribute block. + # + # source://rspec-mocks//lib/rspec/mocks/matchers/expectation_customization.rb#6 + def block; end + + # Sets the attribute block + # + # @param value the value to set the attribute block to. + # + # source://rspec-mocks//lib/rspec/mocks/matchers/expectation_customization.rb#6 + def block=(_arg0); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/expectation_customization.rb#14 + def playback_onto(expectation); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#5 +class RSpec::Mocks::Matchers::HaveReceived + include ::RSpec::Mocks::Matchers::Matcher + + # @return [HaveReceived] a new instance of HaveReceived + # + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#12 + def initialize(method_name, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#53 + def at_least(*args); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#53 + def at_most(*args); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#48 + def description; end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#32 + def does_not_match?(subject); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#53 + def exactly(*args); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#40 + def failure_message; end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#44 + def failure_message_when_negated; end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#19 + def matcher_name; end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#23 + def matches?(subject, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#53 + def once(*args); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#53 + def ordered(*args); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#67 + def setup_allowance(_subject, &_block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#71 + def setup_any_instance_allowance(_subject, &_block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#75 + def setup_any_instance_expectation(_subject, &_block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#79 + def setup_any_instance_negative_expectation(_subject, &_block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#59 + def setup_expectation(subject, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#63 + def setup_negative_expectation(subject, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#53 + def thrice(*args); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#53 + def time(*args); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#53 + def times(*args); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#53 + def twice(*args); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#53 + def with(*args); end + + private + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#95 + def apply_constraints_to(expectation); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#112 + def capture_failure_message; end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#106 + def count_constraint; end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#85 + def disallow(type, reason = T.unsafe(nil)); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#101 + def ensure_count_unconstrained; end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#89 + def expect; end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#123 + def expected_messages_received_in_order?; end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#128 + def mock_proxy; end + + # source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#118 + def notify_failure_message; end +end + +# source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#9 +RSpec::Mocks::Matchers::HaveReceived::ARGS_CONSTRAINTS = T.let(T.unsafe(nil), Array) + +# source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#10 +RSpec::Mocks::Matchers::HaveReceived::CONSTRAINTS = T.let(T.unsafe(nil), Array) + +# source://rspec-mocks//lib/rspec/mocks/matchers/have_received.rb#8 +RSpec::Mocks::Matchers::HaveReceived::COUNT_CONSTRAINTS = T.let(T.unsafe(nil), Array) + +# just a "tag" for rspec-mock matchers detection +# +# @private +# +# source://rspec-mocks//lib/rspec/mocks.rb#125 +module RSpec::Mocks::Matchers::Matcher; end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#7 +class RSpec::Mocks::Matchers::Receive + include ::RSpec::Mocks::Matchers::Matcher + + # @return [Receive] a new instance of Receive + # + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#10 + def initialize(message, block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def and_call_original(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def and_invoke(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def and_raise(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def and_return(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def and_throw(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def and_wrap_original(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def and_yield(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def at_least(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def at_most(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#20 + def description; end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#30 + def does_not_match?(subject, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def exactly(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def inspect(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#16 + def matcher_name; end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#24 + def matches?(subject, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def never(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def once(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def ordered(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#41 + def setup_allowance(subject, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#54 + def setup_any_instance_allowance(subject, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#46 + def setup_any_instance_expectation(subject, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#50 + def setup_any_instance_negative_expectation(subject, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#24 + def setup_expectation(subject, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#30 + def setup_negative_expectation(subject, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def thrice(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def time(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def times(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def to_s(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def twice(*args, **_arg1, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#62 + def with(*args, **_arg1, &block); end + + private + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#71 + def describable; end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#108 + def move_block_to_last_customization(block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#91 + def setup_any_instance_method_substitute(subject, method, block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#96 + def setup_method_substitute(host, method, block, *args); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#86 + def setup_mock_proxy_method_substitute(subject, method, block); end + + # source://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 +# +# source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#119 +class RSpec::Mocks::Matchers::Receive::DefaultDescribable + # @return [DefaultDescribable] a new instance of DefaultDescribable + # + # source://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 :(. + # + # source://rspec-mocks//lib/rspec/mocks/matchers/receive.rb#127 + def description_for(verb); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#7 +class RSpec::Mocks::Matchers::ReceiveMessageChain + include ::RSpec::Mocks::Matchers::Matcher + + # @return [ReceiveMessageChain] a new instance of ReceiveMessageChain + # + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#10 + def initialize(chain, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#17 + def and_call_original(*args, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#17 + def and_invoke(*args, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#17 + def and_raise(*args, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#17 + def and_return(*args, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#17 + def and_throw(*args, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#17 + def and_yield(*args, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#27 + def description; end + + # @raise [NegationUnsupportedError] + # + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#53 + def does_not_match?(*_args); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#23 + def matcher_name; end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#48 + def matches?(subject, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#31 + def setup_allowance(subject, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#36 + def setup_any_instance_allowance(subject, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#42 + def setup_any_instance_expectation(subject, &block); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#48 + def setup_expectation(subject, &block); end + + # @raise [NegationUnsupportedError] + # + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#53 + def setup_negative_expectation(*_args); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#17 + def with(*args, &block); end + + private + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#70 + def formatted_chain; end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_message_chain.rb#64 + def replay_customizations(chain); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/matchers/receive_messages.rb#5 +class RSpec::Mocks::Matchers::ReceiveMessages + include ::RSpec::Mocks::Matchers::Matcher + + # @return [ReceiveMessages] a new instance of ReceiveMessages + # + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_messages.rb#8 + def initialize(message_return_value_hash); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_messages.rb#17 + def description; end + + # @raise [NegationUnsupportedError] + # + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_messages.rb#29 + def does_not_match?(_subject); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_messages.rb#13 + def matcher_name; end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_messages.rb#21 + def matches?(subject); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_messages.rb#36 + def setup_allowance(subject); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_messages.rb#50 + def setup_any_instance_allowance(subject); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_messages.rb#43 + def setup_any_instance_expectation(subject); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_messages.rb#21 + def setup_expectation(subject); end + + # @raise [NegationUnsupportedError] + # + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_messages.rb#29 + def setup_negative_expectation(_subject); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_messages.rb#55 + def warn_about_block; end + + private + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_messages.rb#65 + def any_instance_of(subject); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_messages.rb#69 + def each_message_on(host); end + + # source://rspec-mocks//lib/rspec/mocks/matchers/receive_messages.rb#61 + def proxy_on(subject); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/message_chain.rb#4 +class RSpec::Mocks::MessageChain + # @return [MessageChain] a new instance of MessageChain + # + # source://rspec-mocks//lib/rspec/mocks/message_chain.rb#7 + def initialize(object, *chain, &blk); end + + # Returns the value of attribute block. + # + # source://rspec-mocks//lib/rspec/mocks/message_chain.rb#5 + def block; end + + # Returns the value of attribute chain. + # + # source://rspec-mocks//lib/rspec/mocks/message_chain.rb#5 + def chain; end + + # Returns the value of attribute object. + # + # source://rspec-mocks//lib/rspec/mocks/message_chain.rb#5 + def object; end + + # @api private + # + # source://rspec-mocks//lib/rspec/mocks/message_chain.rb#13 + def setup_chain; end + + private + + # source://rspec-mocks//lib/rspec/mocks/message_chain.rb#33 + def chain_on(object, *chain, &block); end + + # source://rspec-mocks//lib/rspec/mocks/message_chain.rb#54 + def find_matching_expectation; end + + # source://rspec-mocks//lib/rspec/mocks/message_chain.rb#49 + def find_matching_stub; end + + # source://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. +# +# source://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. + # + # @example + # expect(counter).to receive(:increment).and_call_original + # original_count = counter.count + # counter.increment + # expect(counter.count).to eq(original_count + 1) + # @note This is only available on partial doubles. + # @return [nil] No further chaining is supported after this. + # + # source://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. + # + # @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 + # @return [nil] No further chaining is supported after this. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#109 + def and_invoke(first_proc, *procs); end + + # Tells the object to raise an exception when the message is received. + # + # @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)) + # @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. + # @overload and_raise + # @overload and_raise + # @overload and_raise + # @overload and_raise + # @return [nil] No further chaining is supported after this. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#186 + def and_raise(*args); end + + # 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. + # + # @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 + # @overload and_return + # @overload and_return + # @return [nil] No further chaining is supported after this. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#71 + def and_return(first_value, *values); end + + # Tells the object to throw a symbol (with the object if that form is + # used) when the message is received. + # + # @example + # allow(car).to receive(:go).and_throw(:out_of_gas) + # allow(car).to receive(:go).and_throw(:out_of_gas, :level => 0.1) + # @overload and_throw + # @overload and_throw + # @return [nil] No further chaining is supported after this. + # + # source://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. + # + # @example + # expect(api).to receive(:large_list).and_wrap_original do |original_method, *args, &block| + # original_method.call(*args, &block).first(10) + # end + # @note This is only available on partial doubles. + # @return [nil] No further chaining is supported after this. + # + # source://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. + # + # @example + # stream.stub(:open).and_yield(StringIO.new) + # @return [MessageExpectation] self, to support further chaining. + # @yield [@eval_context = Object.new] + # + # source://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. + # + # @example + # expect(dealer).to receive(:deal_card).at_least(9).times + # @return [MessageExpectation] self, to support further chaining. + # + # source://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. + # + # @example + # expect(dealer).to receive(:deal_card).at_most(10).times + # @return [MessageExpectation] self, to support further chaining. + # + # source://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. + # + # @example + # expect(dealer).to receive(:deal_card).exactly(10).times + # @return [MessageExpectation] self, to support further chaining. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#236 + def exactly(n, &block); end + + # @return [String] a nice representation of the message expectation + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#396 + def inspect; end + + # Expect a message not to be received at all. + # + # @example + # expect(car).to receive(:stop).never + # @return [MessageExpectation] self, to support further chaining. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#293 + def never; end + + # Expect a message to be received exactly one time. + # + # @example + # expect(car).to receive(:go).once + # @return [MessageExpectation] self, to support further chaining. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#304 + def once(&block); end + + # Expect messages to be received in a specific order. + # + # @example + # expect(api).to receive(:prepare).ordered + # expect(api).to receive(:run).ordered + # expect(api).to receive(:finish).ordered + # @return [MessageExpectation] self, to support further chaining. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#379 + def ordered(&block); end + + # Expect a message to be received exactly three times. + # + # @example + # expect(car).to receive(:go).thrice + # @return [MessageExpectation] self, to support further chaining. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#326 + def thrice(&block); end + + # Syntactic sugar for `exactly`, `at_least` and `at_most` + # + # @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 + # @return [MessageExpectation] self, to support further chaining. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#282 + def time(&block); end + + # Syntactic sugar for `exactly`, `at_least` and `at_most` + # + # @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 + # @return [MessageExpectation] self, to support further chaining. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#282 + def times(&block); end + + # @return [String] a nice representation of the message expectation + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#396 + def to_s; end + + # Expect a message to be received exactly two times. + # + # @example + # expect(car).to receive(:go).twice + # @return [MessageExpectation] self, to support further chaining. + # + # source://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. + # + # @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 + # @return [MessageExpectation] self, to support further chaining. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#359 + def with(*args, **_arg1, &block); end +end + +# 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. +# +# @private +# +# source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#409 +module RSpec::Mocks::MessageExpectation::ImplementationDetails + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#420 + def initialize(error_generator, expectation_ordering, expected_from, method_double, type = T.unsafe(nil), opts = T.unsafe(nil), &implementation_block); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#588 + def actual_received_count_matters?; end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#575 + def additional_expected_calls; end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#532 + def advise(*args); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#454 + def and_yield_receiver_to_implementation; end + + # Sets the attribute argument_list_matcher + # + # @param value the value to set the attribute argument_list_matcher to. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#413 + def argument_list_matcher=(_arg0); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#487 + def called_max_times?; end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#564 + def description_for(verb); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#507 + def ensure_expected_ordering_received!; end + + # Returns the value of attribute error_generator. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#410 + def error_generator; end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#558 + def expectation_count_type; end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#450 + def expected_args; end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#503 + def expected_messages_received?; end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#540 + def generate_error; end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#512 + def ignoring_args?; end + + # Returns the value of attribute implementation. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#410 + def implementation; end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#592 + def increase_actual_received_count!; end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#473 + def invoke(parent_stub, *args, **_arg2, &block); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#478 + def invoke_without_incrementing_received_count(parent_stub, *args, **_arg2, &block); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#463 + def matches?(message, *args, **_arg2); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#516 + def matches_at_least_count?; end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#520 + def matches_at_most_count?; end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#524 + def matches_exact_count?; end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#494 + def matches_name_but_not_args(message, *args); end + + # Returns the value of attribute message. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#411 + def message; end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#483 + def negative?; end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#584 + def negative_expectation_for?(message); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#580 + def ordered?; end + + # Returns the value of attribute orig_object. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#412 + def orig_object; end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#571 + def raise_out_of_order_error; end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#554 + def raise_unexpected_message_args_error(args_for_multiple_calls); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#468 + def safe_invoke(parent_stub, *args, **_arg2, &block); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#528 + def similar_messages; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#417 + def type; end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#536 + def unadvise(args); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#498 + def verify_messages_received; end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#459 + def yield_receiver_to_implementation_block?; end + + protected + + # Sets the attribute error_generator + # + # @param value the value to set the attribute error_generator to. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#410 + def error_generator=(_arg0); end + + # Sets the attribute expected_from + # + # @param value the value to set the attribute expected_from to. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#413 + def expected_from=(_arg0); end + + # Sets the attribute expected_received_count + # + # @param value the value to set the attribute expected_received_count to. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#413 + def expected_received_count=(_arg0); end + + # Sets the attribute implementation + # + # @param value the value to set the attribute implementation to. + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#410 + def implementation=(_arg0); end + + private + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#600 + def exception_source_id; end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#632 + def has_been_invoked?; end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#655 + def initial_implementation_action=(action); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#659 + def inner_implementation_action=(action); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#604 + def invoke_incrementing_actual_calls_by(increment, allowed_to_fail, parent_stub, *args, **_arg4, &block); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#636 + def raise_already_invoked_error_if_necessary(calling_customization); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#642 + def set_expected_received_count(relativity, n); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#665 + def terminal_implementation_action=(action); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#669 + def warn_about_stub_override; end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#676 + def wrap_original(method_name, &block); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/method_double.rb#4 +class RSpec::Mocks::MethodDouble + # @private + # @return [MethodDouble] a new instance of MethodDouble + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#12 + def initialize(object, method_name, proxy); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#216 + def add_default_stub(*args, &implementation); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#166 + def add_expectation(error_generator, expectation_ordering, expected_from, opts, &implementation); end + + # @private + # + # source://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 + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#197 + def add_simple_stub(method_name, response); end + + # @private + # + # source://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 + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#175 + def build_expectation(error_generator, expectation_ordering); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#152 + def clear; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#61 + def configure_method; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#68 + def define_proxy_method; end + + # @private + # + # source://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 + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#161 + def message_expectation_class; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#41 + def method_missing_block; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#9 + def method_name; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#9 + def method_stasher; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#9 + def object; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#56 + def object_singleton_class; end + + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#24 + def original_implementation_callable; end + + # source://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 + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#97 + def proxy_method_invoked(_obj, *args, **_arg2, &block); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#233 + def raise_method_not_stubbed_error; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#222 + def remove_stub; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#228 + def remove_stub_if_present; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#146 + def reset; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#103 + def restore_original_method; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#133 + def restore_original_visibility; end + + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#24 + def save_original_implementation_callable!; end + + # @private + # + # source://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 + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#122 + def show_frozen_warning; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#9 + def stubs; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#141 + def verify; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#51 + def visibility; end + + private + + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#255 + def definition_target; end + + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#275 + def new_rspec_prepended_module; end + + # source://rspec-mocks//lib/rspec/mocks/method_double.rb#293 + def remove_method_from_definition_target; end + + # source://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+ +# +# source://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. +# +# source://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 +# +# source://rspec-mocks//lib/rspec/mocks/method_reference.rb#10 +class RSpec::Mocks::MethodReference + # @return [MethodReference] a new instance of MethodReference + # + # source://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. + # + # @return [Boolean] + # + # source://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`. + # + # @return [Boolean] + # + # source://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. + # + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#35 + def unimplemented?; end + + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#57 + def visibility; end + + # @yield [Support::MethodSignature.new(original)] + # + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#52 + def with_signature; end + + private + + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#105 + def original_method; end + + class << self + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#11 + def for(object_reference, method_name); end + + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#67 + def instance_method_visibility_for(klass, method_name); end + + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#67 + def method_defined_at_any_visibility?(klass, method_name); end + + # source://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. +# +# source://rspec-mocks//lib/rspec/mocks/error_generator.rb#18 +class RSpec::Mocks::MockExpectationAlreadyInvokedError < ::Exception; end + +# Raised when a message expectation is not satisfied. +# +# source://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 +# +# source://rspec-mocks//lib/rspec/mocks/object_reference.rb#109 +class RSpec::Mocks::NamedObjectReference + # @param const_name [String] constant name + # @return [NamedObjectReference] a new instance of NamedObjectReference + # + # source://rspec-mocks//lib/rspec/mocks/object_reference.rb#111 + def initialize(const_name); end + + # @return [String] the constant name to replace with a double. + # + # source://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. + # + # source://rspec-mocks//lib/rspec/mocks/object_reference.rb#116 + def defined?; end + + # @return [String] the constant name to replace with a double. + # + # source://rspec-mocks//lib/rspec/mocks/object_reference.rb#121 + def description; end + + # @return [Object, nil] the target of the verifying double (the named object), or + # nil if it is not defined. + # + # source://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 + # + # source://rspec-mocks//lib/rspec/mocks/object_reference.rb#137 + def when_loaded; end + + private + + # source://rspec-mocks//lib/rspec/mocks/object_reference.rb#143 + def object; end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/error_generator.rb#31 +class RSpec::Mocks::NegationUnsupportedError < ::StandardError; end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/space.rb#209 +class RSpec::Mocks::NestedSpace < ::RSpec::Mocks::Space + # @return [NestedSpace] a new instance of NestedSpace + # + # source://rspec-mocks//lib/rspec/mocks/space.rb#210 + def initialize(parent); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#219 + def constant_mutator_for(name); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#215 + def proxies_of(klass); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/space.rb#223 + def registered?(object); end + + private + + # source://rspec-mocks//lib/rspec/mocks/space.rb#233 + def any_instance_recorder_not_found_for(id, klass); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#229 + def proxy_not_found_for(id, object); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#16 +class RSpec::Mocks::NoCallbackInvocationStrategy + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#17 + def call(_doubled_module); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/method_reference.rb#149 +class RSpec::Mocks::ObjectMethodReference < ::RSpec::Mocks::MethodReference + private + + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#168 + def find_method(object); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#164 + def method_defined?(object); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#160 + def method_implemented?(object); end + + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#172 + def visibility_from(object); end + + class << self + # source://rspec-mocks//lib/rspec/mocks/method_reference.rb#150 + def for(object_reference, method_name); end + end +end + +# @private +# +# source://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. + # + # source://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 + # + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/object_reference.rb#31 + def anonymous_module?(mod); end + + # source://rspec-mocks//lib/rspec/mocks/object_reference.rb#41 + def name_of(mod); end + end +end + +# @private +# +# source://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 +# +# source://rspec-mocks//lib/rspec/mocks/verifying_double.rb#110 +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 +# +# source://rspec-mocks//lib/rspec/mocks/verifying_double.rb#87 +module RSpec::Mocks::ObjectVerifyingDoubleMethods + include ::RSpec::Mocks::TestDouble + include ::RSpec::Mocks::VerifyingDouble + + # source://rspec-mocks//lib/rspec/mocks/verifying_double.rb#91 + def as_stubbed_const(options = T.unsafe(nil)); end + + private + + # source://rspec-mocks//lib/rspec/mocks/verifying_double.rb#98 + def __build_mock_proxy(order_group); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/order_group.rb#4 +class RSpec::Mocks::OrderGroup + # @return [OrderGroup] a new instance of OrderGroup + # + # source://rspec-mocks//lib/rspec/mocks/order_group.rb#5 + def initialize; end + + # source://rspec-mocks//lib/rspec/mocks/order_group.rb#48 + def clear; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/order_group.rb#26 + def consume; end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/order_group.rb#54 + def empty?; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/order_group.rb#37 + def handle_order_constraint(expectation); end + + # source://rspec-mocks//lib/rspec/mocks/order_group.rb#16 + def invoked(message); end + + # @private + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/order_group.rb#21 + def ready_for?(expectation); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/order_group.rb#12 + def register(expectation); end + + # source://rspec-mocks//lib/rspec/mocks/order_group.rb#43 + def verify_invocation_order(expectation); end + + private + + # source://rspec-mocks//lib/rspec/mocks/order_group.rb#76 + def expectation_for(message); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/order_group.rb#64 + def expectations_invoked_in_order?; end + + # source://rspec-mocks//lib/rspec/mocks/order_group.rb#72 + def expected_invocations; end + + # source://rspec-mocks//lib/rspec/mocks/order_group.rb#68 + def invoked_expectations; end + + # source://rspec-mocks//lib/rspec/mocks/order_group.rb#60 + def remaining_expectations; end +end + +# Raised when doubles or partial doubles are used outside of the per-test lifecycle. +# +# source://rspec-mocks//lib/rspec/mocks/error_generator.rb#13 +class RSpec::Mocks::OutsideOfExampleError < ::StandardError; end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/proxy.rb#456 +class RSpec::Mocks::PartialClassDoubleProxy < ::RSpec::Mocks::PartialDoubleProxy + include ::RSpec::Mocks::PartialClassDoubleProxyMethods +end + +# 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. +# +# @private +# +# source://rspec-mocks//lib/rspec/mocks/proxy.rb#380 +module RSpec::Mocks::PartialClassDoubleProxyMethods + # source://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. + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#406 + def original_method_handle_for(message); end + + protected + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#434 + def method_double_from_ancestor_for(message); end + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#429 + def original_unbound_method_handle_from_ancestor_for(message); end + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#444 + def superclass_proxy; end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/proxy.rb#317 +class RSpec::Mocks::PartialDoubleProxy < ::RSpec::Mocks::Proxy + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#331 + def add_simple_expectation(method_name, response, location); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#337 + def add_simple_stub(method_name, response); end + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#354 + def message_received(message, *args, **_arg2, &block); end + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#318 + def original_method_handle_for(message); end + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#349 + def reset; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#343 + def visibility_for(method_name); end + + private + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#364 + def any_instance_class_recorder_observing_method?(klass, method_name); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/proxy.rb#6 +class RSpec::Mocks::Proxy + # @private + # @return [Proxy] a new instance of Proxy + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#20 + def initialize(object, order_group, options = T.unsafe(nil)); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#65 + def add_message_expectation(method_name, opts = T.unsafe(nil), &block); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#79 + def add_simple_expectation(method_name, response, location); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#140 + def add_simple_stub(method_name, response); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#134 + def add_stub(method_name, opts = T.unsafe(nil), &implementation); end + + # Tells the object to ignore any messages that aren't explicitly set as + # stubs or message expectations. + # + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#52 + def as_null_object; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#84 + def build_expectation(method_name); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#117 + def check_for_unexpected_arguments(expectation); end + + # @private + # @raise [ArgumentError] + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#34 + def ensure_can_be_proxied!(object); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#15 + def ensure_implemented(*_args); end + + # @private + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#181 + def has_negative_expectation?(message); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#195 + def message_received(message, *args, **_arg2, &block); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#174 + def messages_arg_list; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#260 + def method_double_if_exists_for_message(message); end + + # @private + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#45 + def null_object?; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#42 + def object; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#58 + def original_method_handle_for(_message); end + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#254 + def prepended_modules_of_singleton_class; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#233 + def raise_missing_default_stub_error(expectation, args_for_multiple_calls); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#228 + def raise_unexpected_message_error(method_name, args); end + + # @private + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#167 + def received_message?(method_name, *args, &block); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#186 + def record_message_received(message, *args, **_arg2, &block); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#145 + def remove_stub(method_name); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#150 + def remove_stub_if_present(method_name); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#94 + def replay_received_message_on(expectation, &block); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#160 + def reset; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#155 + def verify; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#238 + def visibility_for(_method_name); end + + private + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#277 + def find_almost_matching_expectation(method_name, *args, **_arg2); end + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#301 + def find_almost_matching_stub(method_name, *args, **_arg2); end + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#284 + def find_best_matching_expectation_for(method_name); end + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#270 + def find_matching_expectation(method_name, *args, **_arg2); end + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#296 + def find_matching_method_stub(method_name, *args, **_arg2); end + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#266 + def method_double_for(message); end + + class << self + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#244 + def prepended_modules_of(klass); end + end +end + +# source://rspec-mocks//lib/rspec/mocks/proxy.rb#62 +RSpec::Mocks::Proxy::DEFAULT_MESSAGE_EXPECTATION_OPTS = T.let(T.unsafe(nil), Hash) + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/proxy.rb#8 +class RSpec::Mocks::Proxy::SpecificMessage < ::Struct + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#9 + def ==(expectation); end + + # Returns the value of attribute args + # + # @return [Object] the current value of args + def args; end + + # Sets the attribute args + # + # @param value [Object] the value to set the attribute args to. + # @return [Object] the newly set value + def args=(_); end + + # Returns the value of attribute message + # + # @return [Object] the current value of message + def message; end + + # Sets the attribute message + # + # @param value [Object] the value to set the attribute message to. + # @return [Object] the newly set value + def message=(_); end + + # Returns the value of attribute object + # + # @return [Object] the current value of object + def object; end + + # Sets the attribute object + # + # @param value [Object] the value to set the attribute object to. + # @return [Object] the newly set value + def object=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/proxy.rb#461 +class RSpec::Mocks::ProxyForNil < ::RSpec::Mocks::PartialDoubleProxy + # @return [ProxyForNil] a new instance of ProxyForNil + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#462 + def initialize(order_group); end + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#470 + def add_message_expectation(method_name, opts = T.unsafe(nil), &block); end + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#475 + def add_stub(method_name, opts = T.unsafe(nil), &implementation); end + + # Returns the value of attribute disallow_expectations. + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#467 + def disallow_expectations; end + + # Sets the attribute disallow_expectations + # + # @param value the value to set the attribute disallow_expectations to. + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#467 + def disallow_expectations=(_arg0); end + + # Returns the value of attribute warn_about_expectations. + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#468 + def warn_about_expectations; end + + # Sets the attribute warn_about_expectations + # + # @param value the value to set the attribute warn_about_expectations to. + # + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#468 + def warn_about_expectations=(_arg0); end + + private + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#512 + def raise_error(method_name); end + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#482 + def set_expectation_behavior; end + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#507 + def warn(method_name); end + + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#496 + def warn_or_raise!(method_name); end +end + +# Provides a default space implementation for outside +# the scope of an example. Called "root" because it serves +# as the root of the space stack. +# +# @private +# +# source://rspec-mocks//lib/rspec/mocks/space.rb#9 +class RSpec::Mocks::RootSpace + # source://rspec-mocks//lib/rspec/mocks/space.rb#18 + def any_instance_proxy_for(*_args); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#14 + def any_instance_recorder_for(*_args); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#26 + def any_instance_recorders_from_ancestry_of(_object); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#44 + def new_scope; end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#10 + def proxy_for(*_args); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#22 + def register_constant_mutator(_mutator); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/space.rb#36 + def registered?(_object); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#30 + def reset_all; end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#40 + def superclass_proxy_for(*_args); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#33 + def verify_all; end + + private + + # @raise [OutsideOfExampleError] + # + # source://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 +# +# source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#11 +class RSpec::Mocks::SimpleMessageExpectation + # @return [SimpleMessageExpectation] a new instance of SimpleMessageExpectation + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#12 + def initialize(message, response, error_generator, backtrace_line = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#26 + def called_max_times?; end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#17 + def invoke(*_); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#22 + def matches?(message, *_); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#37 + def unadvise(_); end + + # source://rspec-mocks//lib/rspec/mocks/message_expectation.rb#30 + def verify_messages_received; end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/space.rb#57 +class RSpec::Mocks::Space + # @return [Space] a new instance of Space + # + # source://rspec-mocks//lib/rspec/mocks/space.rb#60 + def initialize; end + + # Returns the value of attribute any_instance_mutex. + # + # source://rspec-mocks//lib/rspec/mocks/space.rb#58 + def any_instance_mutex; end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#103 + def any_instance_proxy_for(klass); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#93 + def any_instance_recorder_for(klass, only_return_existing = T.unsafe(nil)); end + + # Returns the value of attribute any_instance_recorders. + # + # source://rspec-mocks//lib/rspec/mocks/space.rb#58 + def any_instance_recorders; end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#131 + def any_instance_recorders_from_ancestry_of(object); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#89 + def constant_mutator_for(name); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#111 + def ensure_registered(object); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#69 + def new_scope; end + + # Returns the value of attribute proxies. + # + # source://rspec-mocks//lib/rspec/mocks/space.rb#58 + def proxies; end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#107 + def proxies_of(klass); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#111 + def proxy_for(object); end + + # Returns the value of attribute proxy_mutex. + # + # source://rspec-mocks//lib/rspec/mocks/space.rb#58 + def proxy_mutex; end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#85 + def register_constant_mutator(mutator); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/space.rb#127 + def registered?(object); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#78 + def reset_all; end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#118 + def superclass_proxy_for(klass); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#73 + def verify_all; end + + private + + # source://rspec-mocks//lib/rspec/mocks/space.rb#184 + def any_instance_recorder_not_found_for(id, klass); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#171 + def class_proxy_with_callback_verification_strategy(object, strategy); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#202 + def id_for(object); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#147 + def new_mutex; end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#151 + def proxy_not_found_for(id, object); end + + # source://rspec-mocks//lib/rspec/mocks/space.rb#166 + def superclass_proxy_not_found_for(id, object); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/message_chain.rb#75 +class RSpec::Mocks::StubChain < ::RSpec::Mocks::MessageChain + private + + # source://rspec-mocks//lib/rspec/mocks/message_chain.rb#82 + def expectation(object, message, &return_block); end + + class << self + # source://rspec-mocks//lib/rspec/mocks/message_chain.rb#76 + def stub_chain_on(object, *chain, &blk); end + end +end + +# Provides methods for enabling and disabling the available syntaxes +# provided by rspec-mocks. +# +# @api private +# +# source://rspec-mocks//lib/rspec/mocks/syntax.rb#6 +module RSpec::Mocks::Syntax + class << self + # Determines where the methods like `should_receive`, and `stub` are added. + # + # @api private + # + # source://rspec-mocks//lib/rspec/mocks/syntax.rb#181 + def default_should_syntax_host; end + + # Disables the expect syntax (`expect(dbl).to receive`, `allow(dbl).to receive`, etc). + # + # @api private + # + # source://rspec-mocks//lib/rspec/mocks/syntax.rb#150 + def disable_expect(syntax_host = T.unsafe(nil)); end + + # Disables the should syntax (`dbl.stub`, `dbl.should_receive`, etc). + # + # @api private + # + # source://rspec-mocks//lib/rspec/mocks/syntax.rb#89 + def disable_should(syntax_host = T.unsafe(nil)); end + + # Enables the expect syntax (`expect(dbl).to receive`, `allow(dbl).to receive`, etc). + # + # @api private + # + # source://rspec-mocks//lib/rspec/mocks/syntax.rb#110 + def enable_expect(syntax_host = T.unsafe(nil)); end + + # Enables the should syntax (`dbl.stub`, `dbl.should_receive`, etc). + # + # @api private + # + # source://rspec-mocks//lib/rspec/mocks/syntax.rb#26 + def enable_should(syntax_host = T.unsafe(nil)); end + + # Indicates whether or not the expect syntax is enabled. + # + # @api private + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/syntax.rb#175 + def expect_enabled?(syntax_host = T.unsafe(nil)); end + + # Indicates whether or not the should syntax is enabled. + # + # @api private + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/syntax.rb#169 + def should_enabled?(syntax_host = T.unsafe(nil)); end + + # @api private + # @private + # + # source://rspec-mocks//lib/rspec/mocks/syntax.rb#8 + def warn_about_should!; end + + # @api private + # @private + # + # source://rspec-mocks//lib/rspec/mocks/syntax.rb#13 + def warn_unless_should_configured(method_name, replacement = T.unsafe(nil)); end + end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/targets.rb#63 +class RSpec::Mocks::TargetBase + include ::RSpec::Mocks::TargetDelegationInstanceMethods + extend ::RSpec::Mocks::TargetDelegationClassMethods + + # @return [TargetBase] a new instance of TargetBase + # + # source://rspec-mocks//lib/rspec/mocks/targets.rb#64 + def initialize(target); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/targets.rb#4 +module RSpec::Mocks::TargetDelegationClassMethods + # source://rspec-mocks//lib/rspec/mocks/targets.rb#14 + def delegate_not_to(matcher_method, options = T.unsafe(nil)); end + + # source://rspec-mocks//lib/rspec/mocks/targets.rb#5 + def delegate_to(matcher_method); end + + # source://rspec-mocks//lib/rspec/mocks/targets.rb#28 + def disallow_negation(method_name); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/targets.rb#36 +module RSpec::Mocks::TargetDelegationInstanceMethods + # Returns the value of attribute target. + # + # source://rspec-mocks//lib/rspec/mocks/targets.rb#37 + def target; end + + private + + # source://rspec-mocks//lib/rspec/mocks/targets.rb#45 + def define_matcher(matcher, name, &block); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/targets.rb#41 + def matcher_allowed?(matcher); end + + # @raise [NegationUnsupportedError] + # + # source://rspec-mocks//lib/rspec/mocks/targets.rb#55 + def raise_negation_unsupported(method_name, matcher); end + + # @raise [UnsupportedMatcherError] + # + # source://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. +# +# source://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) + # + # source://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. + # + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#36 + def ==(other); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#56 + def __build_mock_proxy_unless_expired(order_group); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#61 + 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. + # + # source://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. + # + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#67 + def freeze; end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#41 + def inspect; end + + # Returns true if this object has received `as_null_object` + # + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#28 + def null_object?; end + + # @private + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#51 + def respond_to?(message, incl_private = T.unsafe(nil)); end + + # @private + # + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#46 + def to_s; end + + private + + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#115 + def __build_mock_proxy(order_group); end + + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#111 + def __mock_proxy; end + + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#119 + def __raise_expired_error; end + + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#105 + def assign_stubs(stubs); end + + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#124 + def initialize_copy(other); end + + # @raise [NoMethodError] + # + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#74 + def method_missing(message, *args, &block); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/test_double.rb#137 +module RSpec::Mocks::TestDoubleFormatter + class << self + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#138 + def format(dbl, unwrap = T.unsafe(nil)); end + + private + + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#164 + def name_desc(dbl); end + + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#147 + def type_desc(dbl); end + + # source://rspec-mocks//lib/rspec/mocks/test_double.rb#159 + def verified_module_desc(dbl); end + end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/proxy.rb#308 +class RSpec::Mocks::TestDoubleProxy < ::RSpec::Mocks::Proxy + # source://rspec-mocks//lib/rspec/mocks/proxy.rb#309 + def reset; end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/error_generator.rb#29 +class RSpec::Mocks::UnsupportedMatcherError < ::StandardError; end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/verifying_double.rb#6 +module RSpec::Mocks::VerifyingDouble + # source://rspec-mocks//lib/rspec/mocks/verifying_double.rb#53 + def initialize(doubled_module, *args); end + + # source://rspec-mocks//lib/rspec/mocks/verifying_double.rb#39 + def __send__(name, *args, **_arg2, &block); end + + # source://rspec-mocks//lib/rspec/mocks/verifying_double.rb#20 + def method_missing(message, *args, &block); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/verifying_double.rb#7 + def respond_to?(message, include_private = T.unsafe(nil)); end + + # source://rspec-mocks//lib/rspec/mocks/verifying_double.rb#48 + def send(name, *args, **_arg2, &block); end +end + +# @private +# +# source://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 +# +# source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#215 +class RSpec::Mocks::VerifyingExistingClassNewMethodDouble < ::RSpec::Mocks::VerifyingExistingMethodDouble + # @yield [Support::MethodSignature.new(object.instance_method(:initialize))] + # + # source://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 +# +# source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#180 +class RSpec::Mocks::VerifyingExistingMethodDouble < ::RSpec::Mocks::VerifyingMethodDouble + # @return [VerifyingExistingMethodDouble] a new instance of VerifyingExistingMethodDouble + # + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#181 + def initialize(object, method_name, proxy); end + + # @return [Boolean] + # + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#195 + def unimplemented?; end + + # @yield [Support::MethodSignature.new(original_implementation_callable)] + # + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#191 + def with_signature; end + + class << self + # source://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 +# +# source://rspec-mocks//lib/rspec/mocks/verifying_message_expectation.rb#9 +class RSpec::Mocks::VerifyingMessageExpectation < ::RSpec::Mocks::MessageExpectation + # @api private + # @return [VerifyingMessageExpectation] a new instance of VerifyingMessageExpectation + # + # source://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. + # + # @api private + # + # source://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. + # + # @api private + # + # source://rspec-mocks//lib/rspec/mocks/verifying_message_expectation.rb#18 + def method_reference=(_arg0); end + + # @api private + # @private + # + # source://rspec-mocks//lib/rspec/mocks/verifying_message_expectation.rb#25 + def with(*args, **_arg1, &block); end + + private + + # @api private + # + # source://rspec-mocks//lib/rspec/mocks/verifying_message_expectation.rb#38 + def validate_expected_arguments!; end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#139 +class RSpec::Mocks::VerifyingMethodDouble < ::RSpec::Mocks::MethodDouble + # @return [VerifyingMethodDouble] a new instance of VerifyingMethodDouble + # + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#140 + def initialize(object, method_name, proxy, method_reference); end + + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#149 + def add_expectation(*args, &block); end + + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#154 + def add_stub(*args, &block); end + + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#145 + def message_expectation_class; end + + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#159 + def proxy_method_invoked(obj, *args, **_arg2, &block); end + + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#165 + def validate_arguments!(actual_args); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#134 +class RSpec::Mocks::VerifyingPartialClassDoubleProxy < ::RSpec::Mocks::VerifyingPartialDoubleProxy + include ::RSpec::Mocks::PartialClassDoubleProxyMethods +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#107 +class RSpec::Mocks::VerifyingPartialDoubleProxy < ::RSpec::Mocks::PartialDoubleProxy + include ::RSpec::Mocks::VerifyingProxyMethods + + # @return [VerifyingPartialDoubleProxy] a new instance of VerifyingPartialDoubleProxy + # + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#110 + def initialize(object, expectation_ordering, optional_callback_invocation_strategy = T.unsafe(nil)); end + + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#123 + def ensure_implemented(_method_name); end + + # source://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 +# +# source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#71 +class RSpec::Mocks::VerifyingProxy < ::RSpec::Mocks::TestDoubleProxy + include ::RSpec::Mocks::VerifyingProxyMethods + + # @return [VerifyingProxy] a new instance of VerifyingProxy + # + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#74 + def initialize(object, order_group, doubled_module, method_reference_class); end + + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#88 + def method_reference; end + + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#98 + def validate_arguments!(method_name, args); end + + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#94 + def visibility_for(method_name); end +end + +# @private +# +# source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#22 +module RSpec::Mocks::VerifyingProxyMethods + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#33 + def add_message_expectation(method_name, opts = T.unsafe(nil), &block); end + + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#28 + def add_simple_stub(method_name, *args); end + + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#23 + def add_stub(method_name, opts = T.unsafe(nil), &implementation); end + + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#38 + def ensure_implemented(method_name); end + + # source://rspec-mocks//lib/rspec/mocks/verifying_proxy.rb#48 + def ensure_publicly_implemented(method_name, _object); end +end + +# Version information for RSpec mocks. +# +# source://rspec-mocks//lib/rspec/mocks/version.rb#4 +module RSpec::Mocks::Version; end + +# Version of RSpec mocks currently in use in SemVer format. +# +# source://rspec-mocks//lib/rspec/mocks/version.rb#6 +RSpec::Mocks::Version::STRING = T.let(T.unsafe(nil), String) diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec-support@3.13.1.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec-support@3.13.1.rbi new file mode 100644 index 0000000..7f602ef --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec-support@3.13.1.rbi @@ -0,0 +1,1630 @@ +# 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`. + + +# source://rspec-support//lib/rspec/support.rb#3 +module RSpec + extend ::RSpec::Support::Warnings + + class << self + # source://rspec-core/3.13.1/lib/rspec/core.rb#70 + def clear_examples; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#85 + def configuration; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#49 + def configuration=(_arg0); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#97 + def configure; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#194 + def const_missing(name); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def context(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#122 + def current_example; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#128 + def current_example=(example); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#154 + def current_scope; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#134 + def current_scope=(scope); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def describe(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def example_group(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def fcontext(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def fdescribe(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#58 + def reset; end + + # source://rspec-core/3.13.1/lib/rspec/core/shared_example_group.rb#110 + def shared_context(name, *args, &block); end + + # source://rspec-core/3.13.1/lib/rspec/core/shared_example_group.rb#110 + def shared_examples(name, *args, &block); end + + # source://rspec-core/3.13.1/lib/rspec/core/shared_example_group.rb#110 + def shared_examples_for(name, *args, &block); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#160 + def world; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#49 + def world=(_arg0); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def xcontext(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def xdescribe(*args, &example_group_block); end + end +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. +# +# source://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. + # + # source://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 + +# source://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. +# +# source://rspec-support//lib/rspec/support/caller_filter.rb#30 +RSpec::CallerFilter::IGNORE_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://rspec-support//lib/rspec/support/caller_filter.rb#22 +RSpec::CallerFilter::LIB_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://rspec-support//lib/rspec/support/caller_filter.rb#11 +RSpec::CallerFilter::RSPEC_LIBS = T.let(T.unsafe(nil), Array) + +# source://rspec-support//lib/rspec/support.rb#4 +module RSpec::Support + class << self + # Used internally to get a class of a given object, even if it does not respond to #class. + # + # @api private + # + # source://rspec-support//lib/rspec/support.rb#86 + def class_of(object); end + + # 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. + # + # @api private + # + # source://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 + # + # source://rspec-support//lib/rspec/support/matcher_definition.rb#24 + def deregister_matcher_definition(&block); end + + # @api private + # + # source://rspec-support//lib/rspec/support.rb#113 + def failure_notifier; end + + # @api private + # + # source://rspec-support//lib/rspec/support.rb#105 + def failure_notifier=(callable); end + + # @private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/matcher_definition.rb#29 + def is_a_matcher?(object); end + + # @private + # + # source://rspec-support//lib/rspec/support/matcher_definition.rb#6 + def matcher_definitions; end + + # source://rspec-support//lib/rspec/support.rb#54 + def method_handle_for(object, method_name); end + + # @api private + # + # source://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 + # + # source://rspec-support//lib/rspec/support/matcher_definition.rb#16 + def register_matcher_definition(&block); end + + # source://rspec-support//lib/rspec/support.rb#25 + def require_rspec_core(f); end + + # source://rspec-support//lib/rspec/support.rb#25 + def require_rspec_support(f); end + + # gives a string representation of an object for use in RSpec descriptions + # + # @api private + # + # source://rspec-support//lib/rspec/support/matcher_definition.rb#36 + def rspec_description_for_object(object); end + + # source://rspec-support//lib/rspec/support.rb#95 + def thread_local_data; end + + # @api private + # + # source://rspec-support//lib/rspec/support.rb#140 + def warning_notifier; end + + # @api private + # + # source://rspec-support//lib/rspec/support.rb#133 + def warning_notifier=(_arg0); end + + # @api private + # + # source://rspec-support//lib/rspec/support.rb#123 + def with_failure_notifier(callable); end + end +end + +# @private +# +# source://rspec-support//lib/rspec/support.rb#145 +module RSpec::Support::AllExceptionsExceptOnesWeMustNotRescue + class << self + # source://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. +# +# source://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 +# +# source://rspec-support//lib/rspec/support/method_signature_verifier.rb#268 +class RSpec::Support::BlockSignature < ::RSpec::Support::MethodSignature + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#270 + def classify_parameters; end +end + +# @private +# +# source://rspec-support//lib/rspec/support/comparable_version.rb#6 +class RSpec::Support::ComparableVersion + include ::Comparable + + # @return [ComparableVersion] a new instance of ComparableVersion + # + # source://rspec-support//lib/rspec/support/comparable_version.rb#11 + def initialize(string); end + + # source://rspec-support//lib/rspec/support/comparable_version.rb#15 + def <=>(other); end + + # source://rspec-support//lib/rspec/support/comparable_version.rb#37 + def segments; end + + # Returns the value of attribute string. + # + # source://rspec-support//lib/rspec/support/comparable_version.rb#9 + def string; end +end + +# @private +# +# source://rspec-support//lib/rspec/support.rb#110 +RSpec::Support::DEFAULT_FAILURE_NOTIFIER = T.let(T.unsafe(nil), Proc) + +# @private +# +# source://rspec-support//lib/rspec/support.rb#137 +RSpec::Support::DEFAULT_WARNING_NOTIFIER = T.let(T.unsafe(nil), Proc) + +# source://rspec-support//lib/rspec/support/differ.rb#12 +class RSpec::Support::Differ + # @return [Differ] a new instance of Differ + # + # source://rspec-support//lib/rspec/support/differ.rb#69 + def initialize(opts = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/differ.rb#65 + def color?; end + + # source://rspec-support//lib/rspec/support/differ.rb#13 + def diff(actual, expected); end + + # source://rspec-support//lib/rspec/support/differ.rb#59 + def diff_as_object(actual, expected); end + + # source://rspec-support//lib/rspec/support/differ.rb#30 + def diff_as_string(actual, expected); end + + private + + # source://rspec-support//lib/rspec/support/differ.rb#130 + def add_old_hunk_to_hunk(hunk, oldhunk); end + + # source://rspec-support//lib/rspec/support/differ.rb#126 + def add_to_output(output, string); end + + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/differ.rb#80 + def all_strings?(*args); end + + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/differ.rb#84 + def any_multiline_strings?(*args); end + + # source://rspec-support//lib/rspec/support/differ.rb#155 + def blue(text); end + + # source://rspec-support//lib/rspec/support/differ.rb#117 + def build_hunks(actual, expected); end + + # source://rspec-support//lib/rspec/support/differ.rb#92 + def coerce_to_string(string_or_array); end + + # source://rspec-support//lib/rspec/support/differ.rb#143 + def color(text, color_code); end + + # source://rspec-support//lib/rspec/support/differ.rb#163 + def color_diff(diff); end + + # source://rspec-support//lib/rspec/support/differ.rb#97 + def diffably_stringify(array); end + + # source://rspec-support//lib/rspec/support/differ.rb#121 + def finalize_output(output, final_line); end + + # source://rspec-support//lib/rspec/support/differ.rb#139 + def format_type; end + + # source://rspec-support//lib/rspec/support/differ.rb#151 + def green(text); end + + # source://rspec-support//lib/rspec/support/differ.rb#204 + def handle_encoding_errors(actual, expected); end + + # source://rspec-support//lib/rspec/support/differ.rb#194 + def hash_to_string(hash); end + + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/differ.rb#108 + def multiline?(string); end + + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/differ.rb#88 + def no_numbers?(*args); end + + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/differ.rb#76 + def no_procs?(*args); end + + # source://rspec-support//lib/rspec/support/differ.rb#159 + def normal(text); end + + # source://rspec-support//lib/rspec/support/differ.rb#180 + def object_to_string(object); end + + # source://rspec-support//lib/rspec/support/differ.rb#147 + def red(text); end + + # source://rspec-support//lib/rspec/support/differ.rb#134 + def safely_flatten(array); end +end + +# Replacement for fileutils#mkdir_p because we don't want to require parts +# of stdlib in RSpec. +# +# @api private +# +# source://rspec-support//lib/rspec/support/directory_maker.rb#11 +class RSpec::Support::DirectoryMaker + class << self + # Implements nested directory construction + # + # @api private + # + # source://rspec-support//lib/rspec/support/directory_maker.rb#15 + def mkdir_p(path); end + + private + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/directory_maker.rb#57 + def directory_exists?(dirname); end + + # @api private + # + # source://rspec-support//lib/rspec/support/directory_maker.rb#52 + def generate_path(stack, part); end + + # @api private + # + # source://rspec-support//lib/rspec/support/directory_maker.rb#49 + def generate_stack(path); end + end +end + +# @private +# +# source://rspec-support//lib/rspec/support/encoded_string.rb#6 +class RSpec::Support::EncodedString + # @return [EncodedString] a new instance of EncodedString + # + # source://rspec-support//lib/rspec/support/encoded_string.rb#16 + def initialize(string, encoding = T.unsafe(nil)); end + + # source://rspec-support//lib/rspec/support/encoded_string.rb#28 + def <<(string); end + + # source://rspec-support//lib/rspec/support/encoded_string.rb#25 + def ==(*args, &block); end + + # source://rspec-support//lib/rspec/support/encoded_string.rb#25 + def empty?(*args, &block); end + + # source://rspec-support//lib/rspec/support/encoded_string.rb#25 + def encoding(*args, &block); end + + # source://rspec-support//lib/rspec/support/encoded_string.rb#25 + def eql?(*args, &block); end + + # source://rspec-support//lib/rspec/support/encoded_string.rb#25 + def lines(*args, &block); end + + # Returns the value of attribute source_encoding. + # + # source://rspec-support//lib/rspec/support/encoded_string.rb#21 + def source_encoding; end + + # source://rspec-support//lib/rspec/support/encoded_string.rb#41 + def split(regex_or_string); end + + # source://rspec-support//lib/rspec/support/encoded_string.rb#46 + def to_s; end + + # source://rspec-support//lib/rspec/support/encoded_string.rb#46 + def to_str; end + + private + + # source://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 + # + # source://rspec-support//lib/rspec/support/encoded_string.rb#93 + def matching_encoding(string); end + + # 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 + # + # source://rspec-support//lib/rspec/support/encoded_string.rb#124 + def remove_invalid_bytes(string); end + + class << self + # source://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") +# +# source://rspec-support//lib/rspec/support/encoded_string.rb#14 +RSpec::Support::EncodedString::REPLACE = T.let(T.unsafe(nil), String) + +# source://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. +# +# source://rspec-support//lib/rspec/support/encoded_string.rb#8 +RSpec::Support::EncodedString::UTF_8 = T.let(T.unsafe(nil), String) + +# @private +# +# source://rspec-support//lib/rspec/support/hunk_generator.rb#9 +class RSpec::Support::HunkGenerator + # @return [HunkGenerator] a new instance of HunkGenerator + # + # source://rspec-support//lib/rspec/support/hunk_generator.rb#10 + def initialize(actual, expected); end + + # source://rspec-support//lib/rspec/support/hunk_generator.rb#15 + def hunks; end + + private + + # source://rspec-support//lib/rspec/support/hunk_generator.rb#32 + def actual_lines; end + + # source://rspec-support//lib/rspec/support/hunk_generator.rb#36 + def build_hunk(piece); end + + # source://rspec-support//lib/rspec/support/hunk_generator.rb#44 + def context_lines; end + + # source://rspec-support//lib/rspec/support/hunk_generator.rb#24 + def diffs; end + + # source://rspec-support//lib/rspec/support/hunk_generator.rb#28 + def expected_lines; end +end + +# @api private +# +# source://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 +# +# source://rspec-support//lib/rspec/support/method_signature_verifier.rb#395 +class RSpec::Support::LooseSignatureVerifier < ::RSpec::Support::MethodSignatureVerifier + private + + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#398 + 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 +# +# source://rspec-support//lib/rspec/support/method_signature_verifier.rb#415 +class RSpec::Support::LooseSignatureVerifier::SignatureWithKeywordArgumentsMatcher + # @return [SignatureWithKeywordArgumentsMatcher] a new instance of SignatureWithKeywordArgumentsMatcher + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#416 + def initialize(signature); end + + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#436 + def has_kw_args_in?(args); end + + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#424 + def invalid_kw_args_from(_kw_args); end + + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#420 + def missing_kw_args_from(_kw_args); end + + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#428 + def non_kw_args_arity_description; end + + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#432 + 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 +# +# source://rspec-support//lib/rspec/support/method_signature_verifier.rb#13 +class RSpec::Support::MethodSignature + # @return [MethodSignature] a new instance of MethodSignature + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#16 + def initialize(method); end + + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#98 + def arbitrary_kw_args?; end + + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#38 + def classify_arity(arity = T.unsafe(nil)); end + + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#106 + def classify_parameters; end + + # Without considering what the last arg is, could it + # contain keyword arguments? + # + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#92 + def could_contain_kw_args?(args); end + + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#51 + def description; end + + # If the last argument is Hash, Ruby will treat only symbol keys as keyword arguments + # the rest will be grouped in another Hash and passed as positional argument. + # + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#84 + def has_kw_args_in?(args); end + + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#77 + def invalid_kw_args_from(given_kw_args); end + + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#14 + def max_non_kw_args; end + + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#14 + def min_non_kw_args; end + + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#73 + def missing_kw_args_from(given_kw_args); end + + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#23 + def non_kw_args_arity_description; end + + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#14 + def optional_kw_args; end + + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#14 + def required_kw_args; end + + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#102 + def unlimited_args?; end + + # @return [Boolean] + # + # source://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 + +# source://rspec-support//lib/rspec/support/method_signature_verifier.rb#162 +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 +# +# source://rspec-support//lib/rspec/support/method_signature_verifier.rb#219 +class RSpec::Support::MethodSignatureExpectation + # @api private + # @return [MethodSignatureExpectation] a new instance of MethodSignatureExpectation + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#220 + def initialize; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#247 + def empty?; end + + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#231 + def expect_arbitrary_keywords; end + + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#231 + def expect_arbitrary_keywords=(_arg0); end + + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#231 + def expect_unlimited_arguments; end + + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#231 + def expect_unlimited_arguments=(_arg0); end + + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#229 + def keywords; end + + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#254 + def keywords=(values); end + + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#229 + def max_count; end + + # @api private + # @raise [ArgumentError] + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#233 + def max_count=(number); end + + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#229 + def min_count; end + + # @api private + # @raise [ArgumentError] + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#240 + def min_count=(number); end +end + +# Abstract base class for signature verifiers. +# +# @api private +# +# source://rspec-support//lib/rspec/support/method_signature_verifier.rb#280 +class RSpec::Support::MethodSignatureVerifier + # @api private + # @return [MethodSignatureVerifier] a new instance of MethodSignatureVerifier + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#283 + def initialize(signature, args = T.unsafe(nil)); end + + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#326 + def error_message; end + + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#281 + def kw_args; end + + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#281 + def max_non_kw_args; end + + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#281 + def min_non_kw_args; end + + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#281 + def non_kw_args; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#318 + def valid?; end + + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#290 + def with_expectation(expectation); end + + private + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#357 + def arbitrary_kw_args?; end + + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#353 + def invalid_kw_args; end + + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#349 + def missing_kw_args; end + + # @api private + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#365 + def split_args(*args); end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#361 + def unlimited_args?; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/method_signature_verifier.rb#345 + def valid_non_kw_args?; end +end + +# On 1.9 and up, this is in core, so we just use the real one +# +# source://rspec-support//lib/rspec/support/reentrant_mutex.rb#65 +class RSpec::Support::Mutex < ::Thread::Mutex + class << self + # source://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. +# +# source://rspec-support//lib/rspec/support/reentrant_mutex.rb#68 +RSpec::Support::Mutex::NEW_MUTEX_METHOD = T.let(T.unsafe(nil), Method) + +# Provides query methods for different OS or OS features. +# +# @api private +# +# source://rspec-support//lib/rspec/support/ruby_features.rb#11 +module RSpec::Support::OS + private + + # @api private + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#14 + def windows?; end + + # @api private + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#18 + def windows_file_path?; end + + class << self + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#14 + def windows?; end + + # @api private + # @return [Boolean] + # + # source://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 +# +# source://rspec-support//lib/rspec/support/object_formatter.rb#10 +class RSpec::Support::ObjectFormatter + # @api private + # @return [ObjectFormatter] a new instance of ObjectFormatter + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#29 + def initialize(max_formatted_output_length = T.unsafe(nil)); end + + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#34 + def format(object); end + + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#13 + def max_formatted_output_length; end + + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#13 + def max_formatted_output_length=(_arg0); end + + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#70 + def prepare_array(array); end + + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#94 + 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. + # + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#58 + def prepare_for_inspection(object); end + + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#76 + def prepare_hash(input_hash); end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#113 + def recursive_structure?(object); end + + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#86 + def sort_hash_keys(input_hash); end + + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#106 + 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 + # + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#268 + 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 + # + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#17 + def default_instance; end + + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#21 + def format(object); end + + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#25 + def prepare_for_inspection(object); end + end +end + +# @api private +# +# source://rspec-support//lib/rspec/support/object_formatter.rb#127 +class RSpec::Support::ObjectFormatter::BaseInspector < ::Struct + # Returns the value of attribute formatter + # + # @return [Object] the current value of formatter + def formatter; end + + # Sets the attribute formatter + # + # @param value [Object] the value to set the attribute formatter to. + # @return [Object] the newly set value + def formatter=(_); end + + # @api private + # @raise [NotImplementedError] + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#132 + def inspect; end + + # Returns the value of attribute object + # + # @return [Object] the current value of object + def object; end + + # Sets the attribute object + # + # @param value [Object] the value to set the attribute object to. + # @return [Object] the newly set value + def object=(_); end + + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#136 + def pretty_print(pp); end + + class << self + def [](*_arg0); end + + # @api private + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#128 + def can_inspect?(_object); end + + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# @api private +# +# source://rspec-support//lib/rspec/support/object_formatter.rb#177 +class RSpec::Support::ObjectFormatter::BigDecimalInspector < ::RSpec::Support::ObjectFormatter::BaseInspector + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#182 + def inspect; end + + class << self + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#178 + def can_inspect?(object); end + end +end + +# @api private +# +# source://rspec-support//lib/rspec/support/object_formatter.rb#159 +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. + # + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#168 + def inspect; end + + class << self + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#162 + def can_inspect?(object); end + end +end + +# @api private +# +# source://rspec-support//lib/rspec/support/object_formatter.rb#160 +RSpec::Support::ObjectFormatter::DateTimeInspector::FORMAT = T.let(T.unsafe(nil), String) + +# @api private +# +# source://rspec-support//lib/rspec/support/object_formatter.rb#224 +class RSpec::Support::ObjectFormatter::DelegatorInspector < ::RSpec::Support::ObjectFormatter::BaseInspector + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#229 + def inspect; end + + class << self + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#225 + def can_inspect?(object); end + end +end + +# @api private +# +# source://rspec-support//lib/rspec/support/object_formatter.rb#187 +class RSpec::Support::ObjectFormatter::DescribableMatcherInspector < ::RSpec::Support::ObjectFormatter::BaseInspector + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#192 + def inspect; end + + class << self + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#188 + def can_inspect?(object); end + end +end + +# @api private +# +# source://rspec-support//lib/rspec/support/object_formatter.rb#11 +RSpec::Support::ObjectFormatter::ELLIPSIS = T.let(T.unsafe(nil), String) + +# @api private +# +# source://rspec-support//lib/rspec/support/object_formatter.rb#247 +RSpec::Support::ObjectFormatter::INSPECTOR_CLASSES = T.let(T.unsafe(nil), Array) + +# @api private +# +# source://rspec-support//lib/rspec/support/object_formatter.rb#117 +class RSpec::Support::ObjectFormatter::InspectableItem < ::Struct + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#118 + def inspect; end + + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#122 + def pretty_print(pp); end + + # Returns the value of attribute text + # + # @return [Object] the current value of text + def text; end + + # Sets the attribute text + # + # @param value [Object] the value to set the attribute text to. + # @return [Object] the newly set value + def text=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# @api private +# +# source://rspec-support//lib/rspec/support/object_formatter.rb#234 +class RSpec::Support::ObjectFormatter::InspectableObjectInspector < ::RSpec::Support::ObjectFormatter::BaseInspector + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#242 + def inspect; end + + class << self + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#235 + def can_inspect?(object); end + end +end + +# @api private +# +# source://rspec-support//lib/rspec/support/object_formatter.rb#141 +class RSpec::Support::ObjectFormatter::TimeInspector < ::RSpec::Support::ObjectFormatter::BaseInspector + # for 1.8.7 + # + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#149 + def inspect; end + + class << self + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#144 + def can_inspect?(object); end + end +end + +# @api private +# +# source://rspec-support//lib/rspec/support/object_formatter.rb#142 +RSpec::Support::ObjectFormatter::TimeInspector::FORMAT = T.let(T.unsafe(nil), String) + +# @api private +# +# source://rspec-support//lib/rspec/support/object_formatter.rb#197 +class RSpec::Support::ObjectFormatter::UninspectableObjectInspector < ::RSpec::Support::ObjectFormatter::BaseInspector + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#207 + def inspect; end + + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#211 + def klass; end + + # http://stackoverflow.com/a/2818916 + # + # @api private + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#216 + def native_object_id; end + + class << self + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#200 + def can_inspect?(object); end + end +end + +# @api private +# +# source://rspec-support//lib/rspec/support/object_formatter.rb#198 +RSpec::Support::ObjectFormatter::UninspectableObjectInspector::OBJECT_ID_FORMAT = T.let(T.unsafe(nil), String) + +# Provides recursive constant lookup methods useful for +# constant stubbing. +# +# source://rspec-support//lib/rspec/support/recursive_const_methods.rb#7 +module RSpec::Support::RecursiveConstMethods + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/recursive_const_methods.rb#45 + def const_defined_on?(mod, const_name); end + + # source://rspec-support//lib/rspec/support/recursive_const_methods.rb#53 + def constants_defined_on(mod); end + + # @raise [NameError] + # + # source://rspec-support//lib/rspec/support/recursive_const_methods.rb#49 + def get_const_defined_on(mod, const_name); end + + # source://rspec-support//lib/rspec/support/recursive_const_methods.rb#73 + def normalize_const_name(const_name); end + + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/recursive_const_methods.rb#64 + def recursive_const_defined?(const_name); end + + # source://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 +# +# source://rspec-support//lib/rspec/support/reentrant_mutex.rb#16 +class RSpec::Support::ReentrantMutex + # @return [ReentrantMutex] a new instance of ReentrantMutex + # + # source://rspec-support//lib/rspec/support/reentrant_mutex.rb#17 + def initialize; end + + # source://rspec-support//lib/rspec/support/reentrant_mutex.rb#23 + def synchronize; end + + private + + # source://rspec-support//lib/rspec/support/reentrant_mutex.rb#35 + def enter; end + + # source://rspec-support//lib/rspec/support/reentrant_mutex.rb#40 + def exit; end +end + +# Provides query methods for different rubies +# +# @api private +# +# source://rspec-support//lib/rspec/support/ruby_features.rb#26 +module RSpec::Support::Ruby + private + + # @api private + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#29 + def jruby?; end + + # @api private + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#37 + def jruby_9000?; end + + # @api private + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#33 + def jruby_version; end + + # @api private + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#49 + def mri?; end + + # @api private + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#45 + def non_mri?; end + + # @api private + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#41 + def rbx?; end + + # @api private + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#53 + def truffleruby?; end + + class << self + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#29 + def jruby?; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#37 + def jruby_9000?; end + + # @api private + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#33 + def jruby_version; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#49 + def mri?; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#45 + def non_mri?; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#41 + def rbx?; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#53 + def truffleruby?; end + end +end + +# Provides query methods for ruby features that differ among +# implementations. +# +# @api private +# +# source://rspec-support//lib/rspec/support/ruby_features.rb#62 +module RSpec::Support::RubyFeatures + private + + # @api private + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#85 + def caller_locations_supported?; end + + # @api private + # + # source://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. + # + # @api private + # @return [Boolean] + # + # source://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 + # + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#111 + def kw_arg_separation?; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#160 + def kw_args_supported?; end + + # @api private + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#216 + def module_prepends_supported?; end + + # @api private + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#212 + def module_refinement_supported?; end + + # @api private + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#81 + def optional_and_splat_args_supported?; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#164 + def required_kw_args_supported?; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#146 + def ripper_supported?; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#90 + def supports_exception_cause?; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#168 + def supports_rebinding_module_methods?; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#100 + def supports_syntax_suggest?; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#121 + def supports_taint?; end + + class << self + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#85 + def caller_locations_supported?; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#155 + def distincts_kw_args_from_positional_hash?; end + + # source://rspec-support//lib/rspec/support/ruby_features.rb#76 + def fork_supported?; end + + # source://rspec-support//lib/rspec/support/ruby_features.rb#111 + def kw_arg_separation?; end + + # source://rspec-support//lib/rspec/support/ruby_features.rb#160 + def kw_args_supported?; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#216 + def module_prepends_supported?; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#212 + def module_refinement_supported?; end + + # @api private + # @return [Boolean] + # + # source://rspec-support//lib/rspec/support/ruby_features.rb#81 + def optional_and_splat_args_supported?; end + + # source://rspec-support//lib/rspec/support/ruby_features.rb#164 + def required_kw_args_supported?; end + + # source://rspec-support//lib/rspec/support/ruby_features.rb#146 + def ripper_supported?; end + + # source://rspec-support//lib/rspec/support/ruby_features.rb#90 + def supports_exception_cause?; end + + # source://rspec-support//lib/rspec/support/ruby_features.rb#168 + def supports_rebinding_module_methods?; end + + # source://rspec-support//lib/rspec/support/ruby_features.rb#100 + def supports_syntax_suggest?; end + + # source://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 +# +# source://rspec-support//lib/rspec/support/method_signature_verifier.rb#389 +RSpec::Support::StrictSignatureVerifier = RSpec::Support::MethodSignatureVerifier + +# source://rspec-support//lib/rspec/support/version.rb#5 +module RSpec::Support::Version; end + +# source://rspec-support//lib/rspec/support/version.rb#6 +RSpec::Support::Version::STRING = T.let(T.unsafe(nil), String) + +# source://rspec-support//lib/rspec/support/warnings.rb#8 +module RSpec::Support::Warnings + # source://rspec-support//lib/rspec/support/warnings.rb#9 + def deprecate(deprecated, options = T.unsafe(nil)); end + + # Used internally to print deprecation warnings + # when rspec-core isn't loaded + # + # @private + # + # source://rspec-support//lib/rspec/support/warnings.rb#17 + def warn_deprecation(message, options = T.unsafe(nil)); end + + # Used internally to print longer warnings + # + # @private + # + # source://rspec-support//lib/rspec/support/warnings.rb#31 + def warn_with(message, options = T.unsafe(nil)); end + + # Used internally to print warnings + # + # @private + # + # source://rspec-support//lib/rspec/support/warnings.rb#24 + def warning(text, options = T.unsafe(nil)); end +end + +# source://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 + # + # source://rspec-support//lib/rspec/support/with_keywords_when_needed.rb#17 + def class_exec(klass, *args, **_arg2, &block); end + + class << self + # source://rspec-support//lib/rspec/support/with_keywords_when_needed.rb#17 + def class_exec(klass, *args, **_arg2, &block); end + end +end diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec@3.13.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec@3.13.0.rbi new file mode 100644 index 0000000..7843595 --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/rspec@3.13.0.rbi @@ -0,0 +1,83 @@ +# 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`. + + +# source://rspec//lib/rspec/version.rb#1 +module RSpec + class << self + # source://rspec-core/3.13.1/lib/rspec/core.rb#70 + def clear_examples; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#85 + def configuration; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#49 + def configuration=(_arg0); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#97 + def configure; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#194 + def const_missing(name); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def context(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#122 + def current_example; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#128 + def current_example=(example); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#154 + def current_scope; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#134 + def current_scope=(scope); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def describe(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def example_group(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def fcontext(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def fdescribe(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#58 + def reset; end + + # source://rspec-core/3.13.1/lib/rspec/core/shared_example_group.rb#110 + def shared_context(name, *args, &block); end + + # source://rspec-core/3.13.1/lib/rspec/core/shared_example_group.rb#110 + def shared_examples(name, *args, &block); end + + # source://rspec-core/3.13.1/lib/rspec/core/shared_example_group.rb#110 + def shared_examples_for(name, *args, &block); end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#160 + def world; end + + # source://rspec-core/3.13.1/lib/rspec/core.rb#49 + def world=(_arg0); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def xcontext(*args, &example_group_block); end + + # source://rspec-core/3.13.1/lib/rspec/core/dsl.rb#42 + def xdescribe(*args, &example_group_block); end + end +end + +# source://rspec//lib/rspec/version.rb#2 +module RSpec::Version; end + +# source://rspec//lib/rspec/version.rb#3 +RSpec::Version::STRING = T.let(T.unsafe(nil), String) diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi new file mode 100644 index 0000000..56c13ae --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `ruby2_keywords` gem. +# Please instead update this file by running `bin/tapioca gem ruby2_keywords`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/safe_type@1.1.1.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/safe_type@1.1.1.rbi new file mode 100644 index 0000000..3940652 --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/safe_type@1.1.1.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `safe_type` gem. +# Please instead update this file by running `bin/tapioca gem safe_type`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/sinatra-contrib@3.2.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/sinatra-contrib@3.2.0.rbi new file mode 100644 index 0000000..495c299 --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/sinatra-contrib@3.2.0.rbi @@ -0,0 +1,3411 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `sinatra-contrib` gem. +# Please instead update this file by running `bin/tapioca gem sinatra-contrib`. + + +# source://sinatra-contrib//lib/sinatra/contrib/version.rb#3 +module Sinatra + class << self + # source://sinatra/3.2.0/lib/sinatra/base.rb#2107 + def helpers(*extensions, &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#2095 + def new(base = T.unsafe(nil), &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#2102 + def register(*extensions, &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#2112 + def use(*args, &block); end + end +end + +class Sinatra::Application < ::Sinatra::Base + include ::Sinatra::EngineTracking + include ::Sinatra::Capture + include ::Sinatra::ContentFor + include ::Sinatra::Cookies + include ::Sinatra::LinkHeader + include ::Sinatra::Streaming + include ::Sinatra::RequiredParams + include ::Sinatra::RespondWith::Helpers + include ::Sinatra::HamlHelpers + extend ::Sinatra::Contrib::Common + extend ::Sinatra::ConfigFile + extend ::Sinatra::MultiRoute + extend ::Sinatra::Namespace + extend ::Sinatra::Namespace::SharedMethods + extend ::Sinatra::Namespace::BaseMethods + extend ::Sinatra::RespondWith + extend ::Sinatra::Reloader + extend ::Sinatra::Reloader::BaseMethods + extend ::Sinatra::Reloader::ExtensionMethods + + class << self + # source://sinatra/3.2.0/lib/sinatra/base.rb#1356 + def app_file; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def app_file=(val); end + + def app_file?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1356 + def environments; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def environments=(val); end + + def environments?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1356 + def ext_map; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1364 + def ext_map=(val); end + + def ext_map?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#2030 + def logging; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def logging=(val); end + + def logging?; end + def method_override; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def method_override=(val); end + + def method_override?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#2035 + def register(*extensions, &block); end + + # source://sinatra-contrib//lib/sinatra/reloader.rb#236 + def reload_templates; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def reload_templates=(val); end + + def reload_templates?; end + + # source://sinatra-contrib//lib/sinatra/reloader.rb#235 + def reloader; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def reloader=(val); end + + def reloader?; end + + # source://sinatra/3.2.0/lib/sinatra/main.rb#36 + def run; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def run=(val); end + + def run?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1356 + def template_engines; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1364 + def template_engines=(val); end + + def template_engines?; end + end +end + +class Sinatra::Base + include ::Sinatra::JSON + + # source://sinatra/3.2.0/lib/sinatra/base.rb#974 + def initialize(app = T.unsafe(nil), **_kwargs); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#971 + def app; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#971 + def app=(_arg0); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#983 + def call(env); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#987 + def call!(env); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#971 + def env; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#971 + def env=(_arg0); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1034 + def forward; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1021 + def halt(*response); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#971 + def params; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#971 + def params=(_arg0); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1029 + def pass(&block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#971 + def request; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#971 + def request=(_arg0); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#971 + def response; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#971 + def response=(_arg0); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1015 + def settings; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#972 + def template_cache; end + + private + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1170 + def dispatch!; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1262 + def dump_errors!(boom); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1243 + def error_block!(key, *block_params); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1048 + def filter!(type, base = T.unsafe(nil), &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1893 + def force_encoding(*args); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1197 + def handle_exception!(boom); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1154 + def invoke(&block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1091 + def process_route(pattern, conditions, block = T.unsafe(nil), values = T.unsafe(nil)); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1057 + def route!(base = T.unsafe(nil), pass_block = T.unsafe(nil)); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1082 + def route_eval; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1129 + def route_missing; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1137 + def static!(options = T.unsafe(nil)); end + + class << self + def absolute_redirects; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def absolute_redirects=(val); end + + def absolute_redirects?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1356 + def add_charset; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def add_charset=(val); end + + def add_charset?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1481 + def add_filter(type, path = T.unsafe(nil), **options, &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1476 + def after(path = T.unsafe(nil), **options, &block); end + + def app_file; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def app_file=(val); end + + def app_file?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1469 + def before(path = T.unsafe(nil), **options, &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1936 + def bind; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def bind=(val); end + + def bind?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1636 + def build(app); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1644 + def call(env); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1650 + def caller_files; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1294 + def callers_to_ignore; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1495 + def condition(name = T.unsafe(nil), &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1562 + def configure(*envs); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1356 + def default_content_type; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def default_content_type=(val); end + + def default_content_type?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1356 + def default_encoding; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def default_encoding=(val); end + + def default_encoding?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1526 + def delete(path, opts = T.unsafe(nil), &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1556 + def development?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1382 + def disable(*opts); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1901 + def dump_errors; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def dump_errors=(val); end + + def dump_errors?; end + def empty_path_info; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def empty_path_info=(val); end + + def empty_path_info?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1377 + def enable(*opts); end + + def environment; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def environment=(val); end + + def environment?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1389 + def error(*codes, &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1292 + def errors; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1317 + def extensions; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1292 + def filters; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1880 + def force_encoding(data, encoding = T.unsafe(nil)); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1514 + def get(path, opts = T.unsafe(nil), &block); end + + def handler_name; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def handler_name=(val); end + + def handler_name?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1528 + def head(path, opts = T.unsafe(nil), &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1540 + def helpers(*extensions, &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1415 + def inline_templates=(file = T.unsafe(nil)); end + + def json_content_type; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def json_content_type=(val); end + + def json_content_type?; end + + # source://sinatra-contrib//lib/sinatra/json.rb#122 + def json_encoder; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def json_encoder=(val); end + + def json_encoder?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1409 + def layout(name = T.unsafe(nil), &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1534 + def link(path, opts = T.unsafe(nil), &block); end + + def lock; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def lock=(val); end + + def lock?; end + def logging; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def logging=(val); end + + def logging?; end + def method_override; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def method_override=(val); end + + def method_override?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def methodoverride=(val); end + + def methodoverride?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1326 + def middleware; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1448 + def mime_type(type, value = T.unsafe(nil)); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1461 + def mime_types(type); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1356 + def mustermann_opts; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1364 + def mustermann_opts=(val); end + + def mustermann_opts?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1628 + def new(*args, **_arg1, &block); end + + def new!(*_arg0); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1398 + def not_found(&block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1485 + def on_start(&on_start_callback); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1292 + def on_start_callback; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1489 + def on_stop(&on_stop_callback); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1292 + def on_stop_callback; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1530 + def options(path, opts = T.unsafe(nil), &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1532 + def patch(path, opts = T.unsafe(nil), &block); end + + def port; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def port=(val); end + + def port?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1524 + def post(path, opts = T.unsafe(nil), &block); end + + def prefixed_redirects; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def prefixed_redirects=(val); end + + def prefixed_redirects?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1557 + def production?; end + + def protection; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def protection=(val); end + + def protection?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1618 + def prototype; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1499 + def public=(value); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1508 + def public_dir; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1504 + def public_dir=(value); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1959 + def public_folder; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def public_folder=(val); end + + def public_folder?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1522 + def put(path, opts = T.unsafe(nil), &block); end + + def quiet; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def quiet=(val); end + + def quiet?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1574 + def quit!; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1900 + def raise_errors; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def raise_errors=(val); end + + def raise_errors?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1547 + def register(*extensions, &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1955 + def reload_templates; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def reload_templates=(val); end + + def reload_templates?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1300 + def reset!; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1953 + def root; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def root=(val); end + + def root?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1292 + def routes; end + + def run; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1591 + def run!(options = T.unsafe(nil), &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def run=(val); end + + def run?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1613 + def running?; end + + def running_server; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def running_server=(val); end + + def running_server?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1356 + def server; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def server=(val); end + + def server?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1356 + def session_secret; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def session_secret=(val); end + + def session_secret?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1356 + def session_store; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def session_store=(val); end + + def session_store?; end + def sessions; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def sessions=(val); end + + def sessions?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1336 + def set(option, value = T.unsafe(nil), ignore_setter = T.unsafe(nil), &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1010 + def settings; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1902 + def show_exceptions; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def show_exceptions=(val); end + + def show_exceptions?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1591 + def start!(options = T.unsafe(nil), &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1960 + def static; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def static=(val); end + + def static?; end + def static_cache_control; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def static_cache_control=(val); end + + def static_cache_control?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1574 + def stop!; end + + def strict_paths; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def strict_paths=(val); end + + def strict_paths?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1403 + def template(name, &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1292 + def templates; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1558 + def test?; end + + def threaded; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def threaded=(val); end + + def threaded?; end + def traps; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def traps=(val); end + + def traps?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1536 + def unlink(path, opts = T.unsafe(nil), &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1567 + def use(middleware, *args, **_arg2, &block); end + + def use_code; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def use_code=(val); end + + def use_code?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1954 + def views; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def views=(val); end + + def views?; end + def x_cascade; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1355 + def x_cascade=(val); end + + def x_cascade?; end + + private + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1710 + def agent(pattern); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1871 + def cleaned_caller(keep = T.unsafe(nil)); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1781 + def compile(path, route_mustermann_opts = T.unsafe(nil)); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1761 + def compile!(verb, path, block, **options); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1696 + def define_singleton(name, content = T.unsafe(nil)); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1754 + def generate_method(method_name, &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1704 + def host_name(pattern); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1850 + def inherited(subclass); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1750 + def invoke_hook(name, *args); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1723 + def provides(*types); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1742 + def route(verb, path, options = T.unsafe(nil), &block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1812 + def setup_common_logger(builder); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1816 + def setup_custom_logger(builder); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1785 + def setup_default_middleware(builder); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1799 + def setup_logging(builder); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1795 + def setup_middleware(builder); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1808 + def setup_null_logger(builder); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1824 + def setup_protection(builder); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1841 + def setup_sessions(builder); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1680 + def setup_traps; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1657 + def start_server(handler, server_settings, handler_name); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1676 + def suppress_messages?; end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1857 + def synchronize(&block); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1710 + def user_agent(pattern); end + + # source://sinatra/3.2.0/lib/sinatra/base.rb#1866 + def warn_for_deprecation(message); end + end +end + +# = Sinatra::Capture +# +# Extension that enables blocks inside other extensions. +# It currently works for erb, slim and haml. +# Enables mixing of different template languages. +# +# Example: +# +# # in hello_world.erb +# +# Say +# <% a = capture do %>World<% end %> +# Hello <%= a %>! +# +# # in hello_world.slim +# +# | Say +# - a = capture do +# | World +# | Hello #{a}! +# +# # in hello_world.haml +# +# Say +# - a = capture do +# World +# Hello #{a.strip}! +# +# +# You can also use nested blocks. +# +# Example +# +# # in hello_world.erb +# +# Say +# <% a = capture do %> +# <% b = capture do %>World<% end %> +# <%= b %>! +# <% end %> +# Hello <%= a.strip %> +# +# +# The main advantage of capture is mixing of different template engines. +# +# Example +# +# # in mix_me_up.slim +# +# - two = capture do +# - erb "<%= 1 + 1 %>" +# | 1 + 1 = #{two} +# +# == Usage +# +# === Classic Application +# +# In a classic application simply require the helpers, and start using them: +# +# require "sinatra" +# require "sinatra/capture" +# +# # The rest of your classic application code goes here... +# +# === Modular Application +# +# In a modular application you need to require the helpers, and then tell +# the application you will use them: +# +# require "sinatra/base" +# require "sinatra/capture" +# +# class MyApp < Sinatra::Base +# helpers Sinatra::Capture +# +# # The rest of your modular application code goes here... +# end +# +# source://sinatra-contrib//lib/sinatra/capture.rb#84 +module Sinatra::Capture + include ::Sinatra::EngineTracking + + # source://sinatra-contrib//lib/sinatra/capture.rb#87 + def capture(*args, &block); end + + # source://sinatra-contrib//lib/sinatra/capture.rb#106 + def capture_later(&block); end +end + +# = Sinatra::ConfigFile +# +# Sinatra::ConfigFile is an extension that allows you to load the +# application's configuration from YAML files. It automatically detects if +# the files contain specific environment settings and it will use those +# corresponding to the current one. +# +# You can access those options through +settings+ within the application. If +# you try to get the value for a setting that hasn't been defined in the +# config file for the current environment, you will get whatever it was set +# to in the application. +# +# == Usage +# +# Once you have written your configurations to a YAML file you can tell the +# extension to load them. See below for more information about how these +# files are interpreted. +# +# For the examples, lets assume the following config.yml file: +# +# greeting: Welcome to my file configurable application +# +# === Classic Application +# +# require "sinatra" +# require "sinatra/config_file" +# +# config_file 'path/to/config.yml' +# +# get '/' do +# @greeting = settings.greeting +# haml :index +# end +# +# # The rest of your classic application code goes here... +# +# === Modular Application +# +# require "sinatra/base" +# require "sinatra/config_file" +# +# class MyApp < Sinatra::Base +# register Sinatra::ConfigFile +# +# config_file 'path/to/config.yml' +# +# get '/' do +# @greeting = settings.greeting +# haml :index +# end +# +# # The rest of your modular application code goes here... +# end +# +# === Config File Format +# +# In its most simple form this file is just a key-value list: +# +# foo: bar +# something: 42 +# nested: +# a: 1 +# b: 2 +# +# But it also can provide specific environment configuration. There are two +# ways to do that: at the file level and at the settings level. +# +# At the settings level (e.g. in 'path/to/config.yml'): +# +# development: +# foo: development +# bar: bar +# test: +# foo: test +# bar: bar +# production: +# foo: production +# bar: bar +# +# Or at the file level: +# +# foo: +# development: development +# test: test +# production: production +# bar: bar +# +# In either case, settings.foo will return the environment name, and +# settings.bar will return "bar". +# +# If you wish to provide defaults that may be shared among all the +# environments, this can be done by using a YAML alias, and then overwriting +# values in environments where appropriate: +# +# default: &common_settings +# foo: 'foo' +# bar: 'bar' +# +# production: +# <<: *common_settings +# bar: 'baz' # override the default value +# +# source://sinatra-contrib//lib/sinatra/config_file.rb#108 +module Sinatra::ConfigFile + # Loads the configuration from the YAML files whose +paths+ are passed as + # arguments, filtering the settings for the current environment. Note that + # these +paths+ can actually be globs. + # + # source://sinatra-contrib//lib/sinatra/config_file.rb#118 + def config_file(*paths); end + + private + + # Given a +hash+ containing application configuration it returns + # settings applicable to the current environment. Note: It gives + # precedence to environment settings defined at the root-level. + # + # source://sinatra-contrib//lib/sinatra/config_file.rb#145 + def config_for_env(hash); end + + # Returns true if supplied with a hash that has any recognized + # +environments+ in its root keys. + # + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/config_file.rb#165 + def environment_keys?(hash); end + + # Given a +hash+ returns the settings corresponding to the current + # environment. + # + # source://sinatra-contrib//lib/sinatra/config_file.rb#159 + def from_environment_key(hash); end + + class << self + # When the extension is registered sets the +environments+ setting to the + # traditional environments: development, test and production. + # + # source://sinatra-contrib//lib/sinatra/config_file.rb#111 + def registered(base); end + end +end + +# source://sinatra-contrib//lib/sinatra/config_file.rb#134 +class Sinatra::ConfigFile::UnsupportedConfigType < ::StandardError + # source://sinatra-contrib//lib/sinatra/config_file.rb#135 + def message; end +end + +# = Sinatra::ContentFor +# +# Sinatra::ContentFor is a set of helpers that allows you to capture +# blocks inside views to be rendered later during the request. The most +# common use is to populate different parts of your layout from your view. +# +# The currently supported engines are: Erb, Erubi, Haml and Slim. +# +# == Usage +# +# You call +content_for+, generally from a view, to capture a block of markup +# giving it an identifier: +# +# # index.erb +# <% content_for :some_key do %> +# ... +# <% end %> +# +# Then, you call +yield_content+ with that identifier, generally from a +# layout, to render the captured block: +# +# # layout.erb +# <%= yield_content :some_key %> +# +# If you have provided +yield_content+ with a block and no content for the +# specified key is found, it will render the results of the block provided +# to yield_content. +# +# # layout.erb +# <% yield_content :some_key_with_no_content do %> +# ... +# <% end %> +# +# === Classic Application +# +# To use the helpers in a classic application all you need to do is require +# them: +# +# require "sinatra" +# require "sinatra/content_for" +# +# # Your classic application code goes here... +# +# === Modular Application +# +# To use the helpers in a modular application you need to require them, and +# then, tell the application you will use them: +# +# require "sinatra/base" +# require "sinatra/content_for" +# +# class MyApp < Sinatra::Base +# helpers Sinatra::ContentFor +# +# # The rest of your modular application code goes here... +# end +# +# == And How Is This Useful? +# +# For example, some of your views might need a few javascript tags and +# stylesheets, but you don't want to force this files in all your pages. +# Then you can put <%= yield_content :scripts_and_styles %> on your +# layout, inside the tag, and each view can call content_for +# setting the appropriate set of tags that should be added to the layout. +# +# == Limitations +# +# Due to the rendering process limitation using <%= yield_content %> +# from within nested templates do not work above the <%= yield %> statement. +# For more details https://github.com/sinatra/sinatra-contrib/issues/140#issuecomment-48831668 +# +# # app.rb +# get '/' do +# erb :body, :layout => :layout do +# erb :foobar +# end +# end +# +# # foobar.erb +# <% content_for :one do %> +# +# <% end %> +# <% content_for :two do %> +# +# <% end %> +# +# Using <%= yield_content %> before <%= yield %> will cause only the second +# alert to display: +# +# # body.erb +# # Display only second alert +# <%= yield_content :one %> +# <%= yield %> +# <%= yield_content :two %> +# +# # body.erb +# # Display both alerts +# <%= yield %> +# <%= yield_content :one %> +# <%= yield_content :two %> +# +# source://sinatra-contrib//lib/sinatra/content_for.rb#112 +module Sinatra::ContentFor + include ::Sinatra::EngineTracking + include ::Sinatra::Capture + + # Unset a named block of content. For example: + # + # <% clear_content_for :head %> + # + # source://sinatra-contrib//lib/sinatra/content_for.rb#155 + def clear_content_for(key); end + + # Capture a block of content to be rendered later. For example: + # + # <% content_for :head do %> + # + # <% end %> + # + # You can also pass an immediate value instead of a block: + # + # <% content_for :title, "foo" %> + # + # You can call +content_for+ multiple times with the same key + # (in the example +:head+), and when you render the blocks for + # that key all of them will be rendered, in the same order you + # captured them. + # + # Your blocks can also receive values, which are passed to them + # by yield_content + # + # source://sinatra-contrib//lib/sinatra/content_for.rb#132 + def content_for(key, value = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Check if a block of content with the given key was defined. For + # example: + # + # <% content_for :head do %> + # + # <% end %> + # + # <% if content_for? :head %> + # content "head" was defined. + # <% end %> + # + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/content_for.rb#148 + def content_for?(key); end + + # Render the captured blocks for a given key. For example: + # + # + # Example + # <%= yield_content :head %> + # + # + # Would render everything you declared with content_for + # :head before closing the tag. + # + # You can also pass values to the content blocks by passing them + # as arguments after the key: + # + # <%= yield_content :head, 1, 2 %> + # + # Would pass 1 and 2 to all the blocks registered + # for :head. + # + # source://sinatra-contrib//lib/sinatra/content_for.rb#176 + def yield_content(key, *args, &block); end + + private + + # source://sinatra-contrib//lib/sinatra/content_for.rb#191 + def content_blocks; end +end + +# source://sinatra-contrib//lib/sinatra/contrib/version.rb#4 +module Sinatra::Contrib + extend ::Sinatra::Contrib::Loader + + class << self + # source://sinatra-contrib//lib/sinatra/contrib/setup.rb#49 + def registered(base); end + end +end + +# source://sinatra-contrib//lib/sinatra/contrib/setup.rb#42 +module Sinatra::Contrib::All + class << self + # source://sinatra-contrib//lib/sinatra/contrib/setup.rb#43 + def registered(base); end + end +end + +# Common middleware that doesn't bring run time overhead if not used +# or breaks if external dependencies are missing. Will extend +# Sinatra::Application by default. +# +# source://sinatra-contrib//lib/sinatra/contrib/setup.rb#34 +module Sinatra::Contrib::Common + extend ::Sinatra::Contrib::Loader +end + +# Other extensions you don't want to be loaded unless needed. +# +# source://sinatra-contrib//lib/sinatra/contrib/setup.rb#38 +module Sinatra::Contrib::Custom + extend ::Sinatra::Contrib::Loader +end + +# source://sinatra-contrib//lib/sinatra/contrib/setup.rb#8 +module Sinatra::Contrib::Loader + # source://sinatra-contrib//lib/sinatra/contrib/setup.rb#21 + def autoload(name, path, method = T.unsafe(nil)); end + + # source://sinatra-contrib//lib/sinatra/contrib/setup.rb#9 + def extensions; end + + # source://sinatra-contrib//lib/sinatra/contrib/setup.rb#17 + def helpers(name, path); end + + # source://sinatra-contrib//lib/sinatra/contrib/setup.rb#13 + def register(name, path); end + + # source://sinatra-contrib//lib/sinatra/contrib/setup.rb#26 + def registered(base); end +end + +# source://sinatra-contrib//lib/sinatra/contrib/version.rb#5 +Sinatra::Contrib::VERSION = T.let(T.unsafe(nil), String) + +# = Sinatra::Cookies +# +# Easy way to deal with cookies +# +# == Usage +# +# Allows you to read cookies: +# +# get '/' do +# "value: #{cookies[:something]}" +# end +# +# And of course to write cookies: +# +# get '/set' do +# cookies[:something] = 'foobar' +# redirect to('/') +# end +# +# And generally behaves like a hash: +# +# get '/demo' do +# cookies.merge! 'foo' => 'bar', 'bar' => 'baz' +# cookies.keep_if { |key, value| key.start_with? 'b' } +# foo, bar = cookies.values_at 'foo', 'bar' +# "size: #{cookies.length}" +# end +# +# === Classic Application +# +# In a classic application simply require the helpers, and start using them: +# +# require "sinatra" +# require "sinatra/cookies" +# +# # The rest of your classic application code goes here... +# +# === Modular Application +# +# In a modular application you need to require the helpers, and then tell +# the application to use them: +# +# require "sinatra/base" +# require "sinatra/cookies" +# +# class MyApp < Sinatra::Base +# helpers Sinatra::Cookies +# +# # The rest of your modular application code goes here... +# end +# +# source://sinatra-contrib//lib/sinatra/cookies.rb#57 +module Sinatra::Cookies + # source://sinatra-contrib//lib/sinatra/cookies.rb#339 + def cookies; end +end + +# source://sinatra-contrib//lib/sinatra/cookies.rb#58 +class Sinatra::Cookies::Jar + include ::Enumerable + + # @return [Jar] a new instance of Jar + # + # source://sinatra-contrib//lib/sinatra/cookies.rb#62 + def initialize(app); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#81 + def ==(other); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#85 + def [](key); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#89 + def []=(key, value); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#94 + def assoc(key); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#99 + def clear; end + + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/cookies.rb#103 + def compare_by_identity?; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#107 + def default; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#107 + def default_proc; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#113 + def delete(key); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#119 + def delete_if; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#126 + def each(&block); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#132 + def each_key(&block); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#126 + def each_pair(&block); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#140 + def each_value(&block); end + + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/cookies.rb#146 + def empty?; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#150 + def fetch(key, &block); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#157 + def flatten; end + + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/cookies.rb#162 + def has_key?(key); end + + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/cookies.rb#166 + def has_value?(value); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#170 + def hash; end + + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/cookies.rb#162 + def include?(key); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#177 + def inspect; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#182 + def invert; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#187 + def keep_if; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#193 + def key(value); end + + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/cookies.rb#162 + def key?(key); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#199 + def keys; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#203 + def length; end + + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/cookies.rb#162 + def member?(key); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#207 + def merge(other, &block); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#211 + def merge!(other); end + + # Returns the value of attribute options. + # + # source://sinatra-contrib//lib/sinatra/cookies.rb#60 + def options; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#221 + def rassoc(value); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#225 + def rehash; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#231 + def reject(&block); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#119 + def reject!; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#239 + def replace(other); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#244 + def select(&block); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#187 + def select!; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#252 + def set(key, options = T.unsafe(nil)); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#256 + def shift; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#203 + def size; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#265 + def sort(&block); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#89 + def store(key, value); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#276 + def to_a; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#272 + def to_hash; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#280 + def to_s; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#211 + def update(other); end + + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/cookies.rb#166 + def value?(value); end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#287 + def values; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#291 + def values_at(*list); end + + private + + # source://sinatra-contrib//lib/sinatra/cookies.rb#301 + def deleted; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#311 + def parse_response; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#334 + def request_cookies; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#306 + def response_cookies; end + + # source://sinatra-contrib//lib/sinatra/cookies.rb#297 + def warn(message); end +end + +# Adds methods like `haml?` that allow helper methods to check whether they +# are called from within a template. +# +# source://sinatra-contrib//lib/sinatra/engine_tracking.rb#8 +module Sinatra::EngineTracking + # source://sinatra-contrib//lib/sinatra/engine_tracking.rb#80 + def initialize(*_arg0); end + + # @return [Boolean] Returns true if current engine is `:builder`. + # + # source://sinatra-contrib//lib/sinatra/engine_tracking.rb#41 + def builder?; end + + # Returns the value of attribute current_engine. + # + # source://sinatra-contrib//lib/sinatra/engine_tracking.rb#9 + def current_engine; end + + # @return [Boolean] Returns true if current engine is `:erb`. + # + # source://sinatra-contrib//lib/sinatra/engine_tracking.rb#12 + def erb?; end + + # Returns true if the current engine is `:erubi`, or `Tilt[:erb]` is set + # to Tilt::ErubiTemplate. + # + # @return [Boolean] Returns true if current engine is `:erubi`. + # + # source://sinatra-contrib//lib/sinatra/engine_tracking.rb#20 + def erubi?; end + + # @return [Boolean] Returns true if current engine is `:haml`. + # + # source://sinatra-contrib//lib/sinatra/engine_tracking.rb#26 + def haml?; end + + # @return [Boolean] Returns true if current engine is `:liquid`. + # + # source://sinatra-contrib//lib/sinatra/engine_tracking.rb#46 + def liquid?; end + + # @return [Boolean] Returns true if current engine is `:markaby`. + # + # source://sinatra-contrib//lib/sinatra/engine_tracking.rb#61 + def markaby?; end + + # @return [Boolean] Returns true if current engine is `:markdown`. + # + # source://sinatra-contrib//lib/sinatra/engine_tracking.rb#51 + def markdown?; end + + # @return [Boolean] Returns true if current engine is `:nokogiri`. + # + # source://sinatra-contrib//lib/sinatra/engine_tracking.rb#66 + def nokogiri?; end + + # @return [Boolean] Returns true if current engine is `:rdoc`. + # + # source://sinatra-contrib//lib/sinatra/engine_tracking.rb#56 + def rdoc?; end + + # @return [Boolean] Returns true if current engine is `:ruby`. + # + # source://sinatra-contrib//lib/sinatra/engine_tracking.rb#76 + def ruby?; end + + # @return [Boolean] Returns true if current engine is `:sass`. + # + # source://sinatra-contrib//lib/sinatra/engine_tracking.rb#31 + def sass?; end + + # @return [Boolean] Returns true if current engine is `:scss`. + # + # source://sinatra-contrib//lib/sinatra/engine_tracking.rb#36 + def scss?; end + + # @return [Boolean] Returns true if current engine is `:slim`. + # + # source://sinatra-contrib//lib/sinatra/engine_tracking.rb#71 + def slim?; end + + # @param engine [Symbol, String] Name of Engine to shift to. + # + # source://sinatra-contrib//lib/sinatra/engine_tracking.rb#86 + def with_engine(engine); end + + private + + # source://sinatra-contrib//lib/sinatra/engine_tracking.rb#96 + def render(engine, *_arg1); end +end + +# = Sinatra::Extension +# +# Sinatra::Extension is a mixin that provides some syntactic sugar +# for your extensions. It allows you to call almost any +# Sinatra::Base method directly inside your extension +# module. This means you can use +get+ to define a route, +before+ +# to define a before filter, +set+ to define a setting and so on. +# +# Is important to be aware that this mixin remembers the method calls you +# make, and then, when your extension is registered, replays them on the +# Sinatra application that has been extended. In order to do that, it +# defines a registered method, so, if your extension defines one +# too, remember to call +super+. +# +# == Usage +# +# Just require the mixin and extend your extension with it: +# +# require 'sinatra/extension' +# +# module MyExtension +# extend Sinatra::Extension +# +# # set some settings for development +# configure :development do +# set :reload_stuff, true +# end +# +# # define a route +# get '/' do +# 'Hello World' +# end +# +# # The rest of your extension code goes here... +# end +# +# You can also create an extension with the +new+ method: +# +# MyExtension = Sinatra::Extension.new do +# # Your extension code goes here... +# end +# +# This is useful when you just want to pass a block to +# Sinatra::Base.register. +# +# source://sinatra-contrib//lib/sinatra/extension.rb#50 +module Sinatra::Extension + # source://sinatra-contrib//lib/sinatra/extension.rb#61 + def configure(*args, &block); end + + # source://sinatra-contrib//lib/sinatra/extension.rb#65 + def registered(base = T.unsafe(nil), &block); end + + # source://sinatra-contrib//lib/sinatra/extension.rb#57 + def settings; end + + private + + # source://sinatra-contrib//lib/sinatra/extension.rb#83 + def method_missing(method, *args, &block); end + + # source://sinatra-contrib//lib/sinatra/extension.rb#71 + def record(method, *args, &block); end + + # source://sinatra-contrib//lib/sinatra/extension.rb#79 + def recorded_methods; end + + # source://sinatra-contrib//lib/sinatra/extension.rb#75 + def replay(object); end + + class << self + # source://sinatra-contrib//lib/sinatra/extension.rb#51 + def new(&block); end + end +end + +# source://sinatra-contrib//lib/sinatra/extension.rb#90 +class Sinatra::Extension::DontCall < ::BasicObject + # @return [DontCall] a new instance of DontCall + # + # source://sinatra-contrib//lib/sinatra/extension.rb#91 + def initialize(method); end + + # source://sinatra-contrib//lib/sinatra/extension.rb#93 + def inspect; end + + # source://sinatra-contrib//lib/sinatra/extension.rb#92 + def method_missing(*_arg0); end +end + +# = Sinatra::HamlHelpers +# +# This extension provides some of the helper methods that existed in Haml 5 +# but were removed in Haml 6. To use this in your app, just +register+ it: +# +# require 'sinatra/base' +# require 'sinatra/haml_helpers' +# +# class Application < Sinatra::Base +# register Sinatra::HamlHelpers +# +# # now you can use the helpers in your views +# get '/' do +# haml_code = <<~HAML +# %p +# != surround "(", ")" do +# %a{ href: "https://example.org/" } example.org +# HAML +# haml haml_code +# end +# end +# +# source://sinatra-contrib//lib/sinatra/haml_helpers.rb#29 +module Sinatra::HamlHelpers + include ::Sinatra::EngineTracking + include ::Sinatra::Capture + + # source://sinatra-contrib//lib/sinatra/haml_helpers.rb#44 + def _capture_haml(*args, &block); end + + # source://sinatra-contrib//lib/sinatra/haml_helpers.rb#36 + def precede(str, &block); end + + # source://sinatra-contrib//lib/sinatra/haml_helpers.rb#40 + def succeed(str, &block); end + + # source://sinatra-contrib//lib/sinatra/haml_helpers.rb#32 + def surround(front, back = T.unsafe(nil), &block); end +end + +# = Sinatra::JSON +# +# Sinatra::JSON adds a helper method, called +json+, for (obviously) +# json generation. +# +# == Usage +# +# === Classic Application +# +# In a classic application simply require the helper, and start using it: +# +# require "sinatra" +# require "sinatra/json" +# +# # define a route that uses the helper +# get '/' do +# json :foo => 'bar' +# end +# +# # The rest of your classic application code goes here... +# +# === Modular Application +# +# In a modular application you need to require the helper, and then tell the +# application you will use it: +# +# require "sinatra/base" +# require "sinatra/json" +# +# class MyApp < Sinatra::Base +# +# # define a route that uses the helper +# get '/' do +# json :foo => 'bar' +# end +# +# # The rest of your modular application code goes here... +# end +# +# === Encoders +# +# By default it will try to call +to_json+ on the object, but if it doesn't +# respond to that message, it will use its own rather simple encoder. You can +# easily change that anyways. To use +JSON+, simply require it: +# +# require 'json' +# +# The same goes for Yajl::Encoder: +# +# require 'yajl' +# +# For other encoders, besides requiring them, you need to define the +# :json_encoder setting. For instance, for the +Whatever+ encoder: +# +# require 'whatever' +# set :json_encoder, Whatever +# +# To force +json+ to simply call +to_json+ on the object: +# +# set :json_encoder, :to_json +# +# Actually, it can call any method: +# +# set :json_encoder, :my_fancy_json_method +# +# === Content-Type +# +# It will automatically set the content type to "application/json". As +# usual, you can easily change that, with the :json_content_type +# setting: +# +# set :json_content_type, :js +# +# === Overriding the Encoder and the Content-Type +# +# The +json+ helper will also take two options :encoder and +# :content_type. The values of this options are the same as the +# :json_encoder and :json_content_type settings, +# respectively. You can also pass those to the json method: +# +# get '/' do +# json({:foo => 'bar'}, :encoder => :to_json, :content_type => :js) +# end +# +# source://sinatra-contrib//lib/sinatra/json.rb#90 +module Sinatra::JSON + # source://sinatra-contrib//lib/sinatra/json.rb#97 + def json(object, options = T.unsafe(nil)); end + + private + + # source://sinatra-contrib//lib/sinatra/json.rb#104 + def resolve_content_type(options = T.unsafe(nil)); end + + # source://sinatra-contrib//lib/sinatra/json.rb#108 + def resolve_encoder(options = T.unsafe(nil)); end + + # source://sinatra-contrib//lib/sinatra/json.rb#112 + def resolve_encoder_action(object, encoder); end + + class << self + # source://sinatra-contrib//lib/sinatra/json.rb#92 + def encode(object); end + end +end + +# = Sinatra::LinkHeader +# +# Sinatra::LinkHeader adds a set of helper methods to generate link +# HTML tags and their corresponding Link HTTP headers. +# +# == Usage +# +# Once you had set up the helpers in your application (see below), you will +# be able to call the following methods from inside your route handlers, +# filters and templates: +# +# +prefetch+:: +# Sets the Link HTTP headers and returns HTML tags to prefetch the given +# resources. +# +# +stylesheet+:: +# Sets the Link HTTP headers and returns HTML tags to use the given +# stylesheets. +# +# +link+:: +# Sets the Link HTTP headers and returns the corresponding HTML tags +# for the given resources. +# +# +link_headers+:: +# Returns the corresponding HTML tags for the current Link HTTP headers. +# +# === Classic Application +# +# In a classic application simply require the helpers, and start using them: +# +# require "sinatra" +# require "sinatra/link_header" +# +# # The rest of your classic application code goes here... +# +# === Modular Application +# +# In a modular application you need to require the helpers, and then tell +# the application you will use them: +# +# require "sinatra/base" +# require "sinatra/link_header" +# +# class MyApp < Sinatra::Base +# helpers Sinatra::LinkHeader +# +# # The rest of your modular application code goes here... +# end +# +# source://sinatra-contrib//lib/sinatra/link_header.rb#53 +module Sinatra::LinkHeader + # Sets Link HTTP header and returns corresponding HTML tags. + # + # Example: + # + # # Sets header: + # # Link: ; rel="next" + # # Returns String: + # # '' + # link '/foo', :rel => :next + # + # # Multiple URLs + # link :stylesheet, '/a.css', '/b.css' + # + # source://sinatra-contrib//lib/sinatra/link_header.rb#83 + def link(*urls); end + + # Takes the current value of th Link header(s) and generates HTML tags + # from it. + # + # Example: + # + # get '/' do + # # You can of course use fancy helpers like #link, #stylesheet + # # or #prefetch + # response["Link"] = '; rel="next"' + # haml :some_page + # end + # + # __END__ + # + # @@ layout + # %head= link_headers + # %body= yield + # + # source://sinatra-contrib//lib/sinatra/link_header.rb#116 + def link_headers; end + + # Sets Link HTTP header and returns HTML tags for telling the browser to + # prefetch given resources (only supported by Opera and Firefox at the + # moment). + # + # source://sinatra-contrib//lib/sinatra/link_header.rb#58 + def prefetch(*urls); end + + # Sets Link HTTP header and returns HTML tags for using stylesheets. + # + # source://sinatra-contrib//lib/sinatra/link_header.rb#64 + def stylesheet(*urls); end + + class << self + # source://sinatra-contrib//lib/sinatra/link_header.rb#126 + def registered(_base); end + end +end + +# = Sinatra::MultiRoute +# +# Create multiple routes with one statement. +# +# == Usage +# +# Use this extension to create a handler for multiple routes: +# +# get '/foo', '/bar' do +# # ... +# end +# +# Or for multiple verbs: +# +# route :get, :post, '/' do +# # ... +# end +# +# Or for multiple verbs and multiple routes: +# +# route :get, :post, ['/foo', '/bar'] do +# # ... +# end +# +# Or even for custom verbs: +# +# route 'LIST', '/' do +# # ... +# end +# +# === Classic Application +# +# To use the extension in a classic application all you need to do is require +# it: +# +# require "sinatra" +# require "sinatra/multi_route" +# +# # Your classic application code goes here... +# +# === Modular Application +# +# To use the extension in a modular application you need to require it, and +# then, tell the application you will use it: +# +# require "sinatra/base" +# require "sinatra/multi_route" +# +# class MyApp < Sinatra::Base +# register Sinatra::MultiRoute +# +# # The rest of your modular application code goes here... +# end +# +# source://sinatra-contrib//lib/sinatra/multi_route.rb#60 +module Sinatra::MultiRoute + # source://sinatra-contrib//lib/sinatra/multi_route.rb#62 + def delete(*args, &block); end + + # source://sinatra-contrib//lib/sinatra/multi_route.rb#63 + def get(*args, &block); end + + # source://sinatra-contrib//lib/sinatra/multi_route.rb#61 + def head(*args, &block); end + + # source://sinatra-contrib//lib/sinatra/multi_route.rb#64 + def options(*args, &block); end + + # source://sinatra-contrib//lib/sinatra/multi_route.rb#65 + def patch(*args, &block); end + + # source://sinatra-contrib//lib/sinatra/multi_route.rb#66 + def post(*args, &block); end + + # source://sinatra-contrib//lib/sinatra/multi_route.rb#67 + def put(*args, &block); end + + # source://sinatra-contrib//lib/sinatra/multi_route.rb#69 + def route(*args, &block); end + + private + + # source://sinatra-contrib//lib/sinatra/multi_route.rb#82 + def route_args(args); end +end + +# = Sinatra::Namespace +# +# Sinatra::Namespace is an extension that adds namespaces to an +# application. This namespaces will allow you to share a path prefix for the +# routes within the namespace, and define filters, conditions and error +# handlers exclusively for them. Besides that, you can also register helpers +# and extensions that will be used only within the namespace. +# +# == Usage +# +# Once you have loaded the extension (see below), you can use the +namespace+ +# method to define namespaces in your application. +# +# You can define a namespace by a path prefix: +# +# namespace '/blog' do +# get { haml :blog } +# get '/:entry_permalink' do +# @entry = Entry.find_by_permalink!(params[:entry_permalink]) +# haml :entry +# end +# +# # More blog routes... +# end +# +# by a condition: +# +# namespace :host_name => 'localhost' do +# get('/admin/dashboard') { haml :dashboard } +# get('/admin/login') { haml :login } +# +# # More admin routes... +# end +# +# or both: +# +# namespace '/admin', :host_name => 'localhost' do +# get('/dashboard') { haml :dashboard } +# get('/login') { haml :login } +# post('/login') { login_user } +# +# # More admin routes... +# end +# +# Regex is also accepted: +# +# namespace /\/posts\/([^\/&?]+)\// do +# get { haml :blog } +# +# # More blog routes... +# end +# +# When you define a filter or an error handler, or register an extension or a +# set of helpers within a namespace, they only affect the routes defined in +# it. For instance, lets define a before filter to prevent the access of +# unauthorized users to the admin section of the application: +# +# namespace '/admin' do +# helpers AdminHelpers +# before { authenticate unless request.path_info == '/admin/login' } +# +# get '/dashboard' do +# # Only authenticated users can access here... +# haml :dashboard +# end +# +# # More admin routes... +# end +# +# get '/' do +# # Any user can access here... +# haml :index +# end +# +# Well, they actually also affect the nested namespaces: +# +# namespace '/admin' do +# helpers AdminHelpers +# before { authenticate unless request.path_info == '/admin/login' } +# +# namespace '/users' do +# get do +# # Only authenticated users can access here... +# @users = User.all +# haml :users +# end +# +# # More user admin routes... +# end +# +# # More admin routes... +# end +# +# Redirecting within the namespace can be done using redirect_to: +# +# namespace '/admin' do +# get '/foo' do +# redirect_to '/bar' # Redirects to /admin/bar +# end +# +# get '/foo' do +# redirect '/bar' # Redirects to /bar +# end +# end +# +# === Classic Application Setup +# +# To be able to use namespaces in a classic application all you need to do is +# require the extension: +# +# require "sinatra" +# require "sinatra/namespace" +# +# namespace '/users' do +# end +# +# === Modular Application Setup +# +# To be able to use namespaces in a modular application all you need to do is +# require the extension, and then, register it: +# +# require "sinatra/base" +# require "sinatra/namespace" +# +# class MyApp < Sinatra::Base +# register Sinatra::Namespace +# +# namespace '/users' do +# end +# end +# +# === Within an extension +# +# To be able to use namespaces within an extension, you need to first create +# an extension. This includes defining the `registered(app)` method in the +# module. +# +# require 'sinatra/base' # For creating Sinatra extensions +# require 'sinatra/namespace' # To create namespaces +# +# module Zomg # Keep everything under "Zomg" namespace for sanity +# module Routes # Define a new "Routes" module +# +# def self.registered(app) +# # First, register the Namespace extension +# app.register Sinatra::Namespace +# +# # This defines an `/api` namespace on the application +# app.namespace '/api' do +# get '/users' do +# # do something with `GET "/api/users"` +# end +# end +# +# end +# end +# +# # Lastly, register the extension to use in our app +# Sinatra.register Routes +# end +# +# In order to use this extension, is the same as any other Sinatra extension: +# +# module Zomg +# # Define our app class, we use modular app for this example +# class App < Sinatra::Base +# # this gives us all the namespaces we defined earlier +# register Routes +# +# get '/' do +# "Welcome to my application!" +# end +# end +# end +# +# Zomg::App.run! # Don't forget to start your app ;) +# +# Phew! That was a mouthful. +# +# I hope that helps you use `Sinatra::Namespace` in every way imaginable! +# +# source://sinatra-contrib//lib/sinatra/namespace.rb#188 +module Sinatra::Namespace + class << self + # @private + # + # source://sinatra-contrib//lib/sinatra/namespace.rb#368 + def extended(base); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#189 + def new(base, pattern, conditions = T.unsafe(nil), &block); end + end +end + +# source://sinatra-contrib//lib/sinatra/namespace.rb#364 +module Sinatra::Namespace::BaseMethods + include ::Sinatra::Namespace::SharedMethods +end + +# source://sinatra-contrib//lib/sinatra/namespace.rb#207 +module Sinatra::Namespace::InstanceMethods + # source://sinatra-contrib//lib/sinatra/namespace.rb#216 + def redirect_to(uri, *args); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#208 + def settings; end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#212 + def template_cache; end +end + +# source://sinatra-contrib//lib/sinatra/namespace.rb#227 +module Sinatra::Namespace::NamespacedMethods + include ::Sinatra::Namespace::SharedMethods + + # source://sinatra-contrib//lib/sinatra/namespace.rb#238 + def after(*a, &b); end + + # Returns the value of attribute base. + # + # source://sinatra-contrib//lib/sinatra/namespace.rb#229 + def base; end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#238 + def before(*a, &b); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#238 + def delete(*a, &b); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#303 + def disable(*opts); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#299 + def enable(*opts); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#273 + def error(*codes, &block); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#265 + def errors; end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#238 + def get(*a, &b); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#238 + def head(*a, &b); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#243 + def helpers(*extensions, &block); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#257 + def invoke_hook(name, *args); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#314 + def layout(name = T.unsafe(nil), &block); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#269 + def namespace_errors; end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#261 + def not_found(&block); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#238 + def options(*a, &b); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#238 + def patch(*a, &b); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#318 + def pattern; end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#238 + def post(*a, &b); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#238 + def put(*a, &b); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#248 + def register(*extensions, &block); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#285 + def respond_to(*args); end + + # @raise [ArgumentError] + # + # source://sinatra-contrib//lib/sinatra/namespace.rb#291 + def set(key, value = T.unsafe(nil), &block); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#307 + def template(name, &block); end + + # Returns the value of attribute templates. + # + # source://sinatra-contrib//lib/sinatra/namespace.rb#229 + def templates; end + + private + + # source://sinatra-contrib//lib/sinatra/namespace.rb#324 + def app; end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#328 + def compile(pattern, conditions, default_pattern = T.unsafe(nil)); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#355 + def method_missing(method, *args, &block); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#347 + def prefixed(method, pattern = T.unsafe(nil), conditions = T.unsafe(nil), &block); end + + # source://sinatra-contrib//lib/sinatra/namespace.rb#340 + def prefixed_path(a, b); end + + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/namespace.rb#359 + def respond_to?(method, include_private = T.unsafe(nil)); end + + class << self + # source://sinatra-contrib//lib/sinatra/namespace.rb#237 + def prefixed(*names); end + end +end + +# source://sinatra-contrib//lib/sinatra/namespace.rb#231 +Sinatra::Namespace::NamespacedMethods::ALLOWED_ENGINES = T.let(T.unsafe(nil), Array) + +# source://sinatra-contrib//lib/sinatra/namespace.rb#221 +module Sinatra::Namespace::SharedMethods + # source://sinatra-contrib//lib/sinatra/namespace.rb#222 + def namespace(pattern, conditions = T.unsafe(nil), &block); end +end + +# = Sinatra::Reloader +# +# DEPRECATED: Please consider using an alternative like +# rerun or rack-unreloader instead. +# +# Extension to reload modified files. Useful during development, +# since it will automatically require files defining routes, filters, +# error handlers and inline templates, with every incoming request, +# but only if they have been updated. +# +# == Usage +# +# === Classic Application +# +# To enable the reloader in a classic application all you need to do is +# require it: +# +# require "sinatra" +# require "sinatra/reloader" if development? +# +# # Your classic application code goes here... +# +# === Modular Application +# +# To enable the reloader in a modular application all you need to do is +# require it, and then, register it: +# +# require "sinatra/base" +# require "sinatra/reloader" +# +# class MyApp < Sinatra::Base +# configure :development do +# register Sinatra::Reloader +# end +# +# # Your modular application code goes here... +# end +# +# == Using the Reloader in Other Environments +# +# By default, the reloader is only enabled for the development +# environment. Similar to registering the reloader in a modular +# application, a classic application requires manually enabling the +# extension for it to be available in a non-development environment. +# +# require "sinatra" +# require "sinatra/reloader" +# +# configure :production do +# enable :reloader +# end +# +# == Changing the Reloading Policy +# +# You can refine the reloading policy with +also_reload+ and +# +dont_reload+, to customize which files should, and should not, be +# reloaded, respectively. You can also use +after_reload+ to execute a +# block after any file being reloaded. +# +# === Classic Application +# +# Simply call the methods: +# +# require "sinatra" +# require "sinatra/reloader" if development? +# +# also_reload '/path/to/some/file' +# dont_reload '/path/to/other/file' +# after_reload do +# puts 'reloaded' +# end +# +# # Your classic application code goes here... +# +# === Modular Application +# +# Call the methods inside the +configure+ block: +# +# require "sinatra/base" +# require "sinatra/reloader" +# +# class MyApp < Sinatra::Base +# configure :development do +# register Sinatra::Reloader +# also_reload '/path/to/some/file' +# dont_reload '/path/to/other/file' +# after_reload do +# puts 'reloaded' +# end +# end +# +# # Your modular application code goes here... +# end +# +# source://sinatra-contrib//lib/sinatra/reloader.rb#100 +module Sinatra::Reloader + # source://sinatra-contrib//lib/sinatra/reloader.rb#220 + def after_reload(&block); end + + class << self + # Reloads the modified files, adding, updating and removing the + # needed elements. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#247 + def perform(klass); end + + # When the extension is registered it extends the Sinatra application + # +klass+ with the modules +BaseMethods+ and +ExtensionMethods+ and + # defines a before filter to +perform+ the reload of the modified files. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#227 + def registered(klass); end + end +end + +# Contains the methods defined in Sinatra::Base that are overridden. +# +# source://sinatra-contrib//lib/sinatra/reloader.rb#272 +module Sinatra::Reloader::BaseMethods + # Does everything Sinatra::Base#add_filter does, but it also tells + # the +Watcher::List+ for the Sinatra application to watch the defined + # filter. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#320 + def add_filter(type, path = T.unsafe(nil), **options, &block); end + + # Does everything Sinatra::Base#route does, but it also tells the + # +Watcher::List+ for the Sinatra application to watch the defined + # route. + # + # Note: We are using #compile! so we don't interfere with extensions + # changing #route. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#288 + def compile!(verb, path, block, **options); end + + # Does everything Sinatra::Base#error does, but it also tells the + # +Watcher::List+ for the Sinatra application to watch the defined + # error handler. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#331 + def error(*codes, &block); end + + # Does everything Sinatra::Base#register does and then registers the + # reloader in the +subclass+. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#352 + def inherited(subclass); end + + # Does everything Sinatra::Base#inline_templates= does, but it also + # tells the +Watcher::List+ for the Sinatra application to watch the + # inline templates in +file+ or the file who made the call to this + # method. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#302 + def inline_templates=(file = T.unsafe(nil)); end + + # Does everything Sinatra::Base#register does, but it also lets the + # reloader know that an extension is being registered, because the + # elements defined in its +registered+ method need a special treatment. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#343 + def register(*extensions, &block); end + + # Protects Sinatra::Base.run! from being called more than once. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#274 + def run!(*args); end + + # Does everything Sinatra::Base#use does, but it also tells the + # +Watcher::List+ for the Sinatra application to watch the middleware + # being used. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#311 + def use(middleware, *args, &block); end +end + +# Contains the methods that the extension adds to the Sinatra application. +# +# source://sinatra-contrib//lib/sinatra/reloader.rb#360 +module Sinatra::Reloader::ExtensionMethods + # Indicates with a +glob+ which files should be reloaded if they + # have been modified. It can be called several times. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#383 + def also_reload(*glob); end + + # Removes the +element+ from the Sinatra application. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#362 + def deactivate(element); end + + # Indicates with a +glob+ which files should not be reloaded even if + # they have been modified. It can be called several times. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#389 + def dont_reload(*glob); end + + private + + # attr_reader :register_path warn on -w (private attribute) + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#396 + def register_path; end + + # Indicates whether or not an extension is being registered. + # + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#409 + def registering_extension?; end + + # Indicates an extesion is being registered. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#399 + def start_registering_extension; end + + # Indicates the extesion has already been registered. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#404 + def stop_registering_extension; end + + # Builds a Watcher::Element from +type+ and +representation+ and + # tells the Watcher::List for the current application to watch it + # in the file located at +path+. + # + # If an extension is being registered, it also tells the list to + # watch it in the file where the extension has been registered. + # This prevents the duplication of the elements added by the + # extension in its +registered+ method with every reload. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#421 + def watch_element(path, type, representation = T.unsafe(nil)); end +end + +# source://sinatra-contrib//lib/sinatra/reloader.rb#216 +Sinatra::Reloader::MUTEX_FOR_PERFORM = T.let(T.unsafe(nil), Thread::Mutex) + +# Watches a file so it can tell when it has been updated, and what +# elements does it contain. +# +# source://sinatra-contrib//lib/sinatra/reloader.rb#103 +class Sinatra::Reloader::Watcher + # Creates a new +Watcher+ instance for the file located at +path+. + # + # @return [Watcher] a new instance of Watcher + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#175 + def initialize(path); end + + # Returns the value of attribute elements. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#172 + def elements; end + + # Informs that the modifications to the file being watched + # should be ignored. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#200 + def ignore; end + + # Indicates whether or not the modifications to the file being + # watched should be ignored. + # + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#206 + def ignore?; end + + # Indicates whether or not the file being watched has inline + # templates. + # + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#194 + def inline_templates?; end + + # Returns the value of attribute mtime. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#172 + def mtime; end + + # Returns the value of attribute path. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#172 + def path; end + + # Indicates whether or not the file being watched has been removed. + # + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#211 + def removed?; end + + # Updates the mtime of the file being watched. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#188 + def update; end + + # Indicates whether or not the file being watched has been modified. + # + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#183 + def updated?; end +end + +# Represents an element of a Sinatra application that may need to +# be reloaded. An element could be: +# * a route +# * a filter +# * an error handler +# * a middleware +# * inline templates +# +# Its +representation+ attribute is there to allow to identify the +# element within an application, that is, to match it with its +# Sinatra's internal representation. +# +# source://sinatra-contrib//lib/sinatra/reloader.rb#115 +class Sinatra::Reloader::Watcher::Element < ::Struct; end + +# Collection of file +Watcher+ that can be associated with a +# Sinatra application. That way, we can know which files belong +# to a given application and which files have been modified. It +# also provides a mechanism to inform a Watcher of the elements +# defined in the file being watched and if its changes should be +# ignored. +# +# source://sinatra-contrib//lib/sinatra/reloader.rb#124 +class Sinatra::Reloader::Watcher::List + # Creates a new +List+ instance. + # + # @return [List] a new instance of List + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#133 + def initialize; end + + # Tells the +Watcher+ for the file located at +path+ to ignore + # the file changes, and adds the +Watcher+ to the +List+, if + # it isn't already there. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#149 + def ignore(path); end + + # Returns an array with all the watchers in the +List+ that + # have been updated. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#167 + def updated; end + + # Lets the +Watcher+ for the file located at +path+ know that the + # +element+ is defined there, and adds the +Watcher+ to the +List+, + # if it isn't already there. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#142 + def watch(path, element); end + + # Adds a +Watcher+ for the file located at +path+ to the + # +List+, if it isn't already there. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#155 + def watch_file(path); end + + # Adds a +Watcher+ for the file located at +path+ to the + # +List+, if it isn't already there. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#155 + def watcher_for(path); end + + # Returns an array with all the watchers in the +List+. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#161 + def watchers; end + + class << self + # Returns the +List+ for the application +app+. + # + # source://sinatra-contrib//lib/sinatra/reloader.rb#128 + def for(app); end + end +end + +# = Sinatra::RequiredParams +# +# Ensure required query parameters +# +# == Usage +# +# Set required query parameter keys in the argument. +# It'll halt with 400 if required keys don't exist. +# +# get '/simple_keys' do +# required_params :p1, :p2 +# end +# +# Complicated pattern is also fine. +# +# get '/complicated_keys' do +# required_params :p1, :p2 => [:p3, :p4] +# end +# +# === Classic Application +# +# In a classic application simply require the helpers, and start using them: +# +# require "sinatra" +# require "sinatra/required_params" +# +# # The rest of your classic application code goes here... +# +# === Modular Application +# +# In a modular application you need to require the helpers, and then tell +# the application to use them: +# +# require "sinatra/base" +# require "sinatra/required_params" +# +# class MyApp < Sinatra::Base +# helpers Sinatra::RequiredParams +# +# # The rest of your modular application code goes here... +# end +# +# source://sinatra-contrib//lib/sinatra/required_params.rb#48 +module Sinatra::RequiredParams + # source://sinatra-contrib//lib/sinatra/required_params.rb#49 + def required_params(*keys); end + + private + + # source://sinatra-contrib//lib/sinatra/required_params.rb#55 + def _required_params(p, *keys); end +end + +# = Sinatra::RespondWith +# +# These extensions let Sinatra automatically choose what template to render or +# action to perform depending on the request's Accept header. +# +# Example: +# +# # Without Sinatra::RespondWith +# get '/' do +# data = { :name => 'example' } +# request.accept.each do |type| +# case type.to_s +# when 'text/html' +# halt haml(:index, :locals => data) +# when 'text/json' +# halt data.to_json +# when 'application/atom+xml' +# halt nokogiri(:'index.atom', :locals => data) +# when 'application/xml', 'text/xml' +# halt nokogiri(:'index.xml', :locals => data) +# when 'text/plain' +# halt 'just an example' +# end +# end +# error 406 +# end +# +# # With Sinatra::RespondWith +# get '/' do +# respond_with :index, :name => 'example' do |f| +# f.txt { 'just an example' } +# end +# end +# +# Both helper methods +respond_to+ and +respond_with+ let you define custom +# handlers like the one above for +text/plain+. +respond_with+ additionally +# takes a template name and/or an object to offer the following default +# behavior: +# +# * If a template name is given, search for a template called +# +name.format.engine+ (+index.xml.nokogiri+ in the above example). +# * If a template name is given, search for a templated called +name.engine+ +# for engines known to result in the requested format (+index.haml+). +# * If a file extension associated with the mime type is known to Sinatra, and +# the object responds to +to_extension+, call that method and use the result +# (+data.to_json+). +# +# == Security +# +# Since methods are triggered based on client input, this can lead to security +# issues (but not as severe as those might appear in the first place: keep in +# mind that only known file extensions are used). You should limit +# the possible formats you serve. +# +# This is possible with the +provides+ condition: +# +# get '/', :provides => [:html, :json, :xml, :atom] do +# respond_with :index, :name => 'example' +# end +# +# However, since you have to set +provides+ for every route, this extension +# adds an app global (class method) `respond_to`, that lets you define content +# types for all routes: +# +# respond_to :html, :json, :xml, :atom +# get('/a') { respond_with :index, :name => 'a' } +# get('/b') { respond_with :index, :name => 'b' } +# +# == Custom Types +# +# Use the +on+ method for defining actions for custom types: +# +# get '/' do +# respond_to do |f| +# f.xml { nokogiri :index } +# f.on('application/custom') { custom_action } +# f.on('text/*') { data.to_s } +# f.on('*/*') { "matches everything" } +# end +# end +# +# Definition order does not matter. +# +# source://sinatra-contrib//lib/sinatra/respond_with.rb#90 +module Sinatra::RespondWith + # source://sinatra-contrib//lib/sinatra/respond_with.rb#208 + def mime_type(*_arg0); end + + # source://sinatra-contrib//lib/sinatra/respond_with.rb#201 + def remap_extensions; end + + # source://sinatra-contrib//lib/sinatra/respond_with.rb#227 + def rendering_method(engine); end + + # source://sinatra-contrib//lib/sinatra/respond_with.rb#214 + def respond_to(*formats); end + + private + + # source://sinatra-contrib//lib/sinatra/respond_with.rb#236 + def compile!(verb, path, block, **options); end + + class << self + # source://sinatra-contrib//lib/sinatra/respond_with.rb#250 + def engines; end + + # source://sinatra-contrib//lib/sinatra/respond_with.rb#241 + def jrubyify(engs); end + + # source://sinatra-contrib//lib/sinatra/respond_with.rb#264 + def registered(base); end + end +end + +# source://sinatra-contrib//lib/sinatra/respond_with.rb#91 +class Sinatra::RespondWith::Format + # @return [Format] a new instance of Format + # + # source://sinatra-contrib//lib/sinatra/respond_with.rb#92 + def initialize(app); end + + # @yield [_self] + # @yieldparam _self [Sinatra::RespondWith::Format] the object that the method was called on + # + # source://sinatra-contrib//lib/sinatra/respond_with.rb#109 + def finish; end + + # source://sinatra-contrib//lib/sinatra/respond_with.rb#126 + def method_missing(method, *args, &block); end + + # source://sinatra-contrib//lib/sinatra/respond_with.rb#99 + def on(type, &block); end +end + +# source://sinatra-contrib//lib/sinatra/respond_with.rb#133 +module Sinatra::RespondWith::Helpers + include ::Sinatra::JSON + + # source://sinatra-contrib//lib/sinatra/respond_with.rb#170 + def respond_to(&block); end + + # source://sinatra-contrib//lib/sinatra/respond_with.rb#136 + def respond_with(template, object = T.unsafe(nil), &block); end + + private + + # source://sinatra-contrib//lib/sinatra/respond_with.rb#176 + def template_for(name, exts); end +end + +# = Sinatra::Streaming +# +# Sinatra 1.3 introduced the +stream+ helper. This addon improves the +# streaming API by making the stream object imitate an IO object, turning +# it into a real Deferrable and making the body play nicer with middleware +# unaware of streaming. +# +# == IO-like behavior +# +# This is useful when passing the stream object to a library expecting an +# IO or StringIO object. +# +# get '/' do +# stream do |out| +# out.puts "Hello World!", "How are you?" +# out.write "Written #{out.pos} bytes so far!\n" +# out.putc(65) unless out.closed? +# out.flush +# end +# end +# +# == Better Middleware Handling +# +# Blocks passed to #map! or #map will actually be applied when streaming +# takes place (as you might have suspected, #map! applies modifications +# to the current body, while #map creates a new one): +# +# class StupidMiddleware +# def initialize(app) @app = app end +# +# def call(env) +# status, headers, body = @app.call(env) +# body.map! { |e| e.upcase } +# [status, headers, body] +# end +# end +# +# use StupidMiddleware +# +# get '/' do +# stream do |out| +# out.puts "still" +# sleep 1 +# out.puts "streaming" +# end +# end +# +# Even works if #each is used to generate an Enumerator: +# +# def call(env) +# status, headers, body = @app.call(env) +# body = body.each.map { |s| s.upcase } +# [status, headers, body] +# end +# +# Note that both examples violate the Rack specification. +# +# == Setup +# +# In a classic application: +# +# require "sinatra" +# require "sinatra/streaming" +# +# In a modular application: +# +# require "sinatra/base" +# require "sinatra/streaming" +# +# class MyApp < Sinatra::Base +# helpers Sinatra::Streaming +# end +# +# source://sinatra-contrib//lib/sinatra/streaming.rb#78 +module Sinatra::Streaming + # source://sinatra-contrib//lib/sinatra/streaming.rb#79 + def stream(*_arg0); end +end + +# source://sinatra-contrib//lib/sinatra/streaming.rb#87 +module Sinatra::Streaming::Stream + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#100 + def <<(data); end + + # Returns the value of attribute app. + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#88 + def app; end + + # Sets the attribute app + # + # @param value the value to set the attribute app to. + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#88 + def app=(_arg0); end + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#186 + def bytes(*_arg0); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#208 + def chars(*_arg0); end + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#160 + def close_read; end + + # Returns the value of attribute closed. + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#88 + def closed; end + + # Sets the attribute closed + # + # @param value the value to set the attribute closed to. + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#88 + def closed=(_arg0); end + + # Returns the value of attribute closed. + def closed?; end + + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#164 + def closed_read?; end + + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#168 + def closed_write?; end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#110 + def each; end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#208 + def each_byte(*_arg0); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#208 + def each_char(*_arg0); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#208 + def each_line(*_arg0); end + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#186 + def eof(*_arg0); end + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#186 + def eof?(*_arg0); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#172 + def external_encoding; end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#220 + def flush(*_arg0); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#220 + def fsync(*_arg0); end + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#186 + def getbyte(*_arg0); end + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#186 + def getc(*_arg0); end + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#186 + def gets(*_arg0); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#220 + def internal_encoding(*_arg0); end + + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#237 + def isatty; end + + # Returns the value of attribute lineno. + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#88 + def lineno; end + + # Sets the attribute lineno + # + # @param value the value to set the attribute lineno to. + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#88 + def lineno=(_arg0); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#208 + def lines(*_arg0); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#117 + def map(&block); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#122 + def map!(&block); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#220 + def pid(*_arg0); end + + # Returns the value of attribute pos. + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#88 + def pos; end + + # Sets the attribute pos + # + # @param value the value to set the attribute pos to. + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#88 + def pos=(_arg0); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#142 + def print(*args); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#147 + def printf(format, *args); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#151 + def putc(c); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#155 + def puts(*args); end + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#186 + def read(*_arg0); end + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#186 + def read_nonblock(*_arg0); end + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#186 + def readbyte(*_arg0); end + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#186 + def readchar(*_arg0); end + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#186 + def readline(*_arg0); end + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#186 + def readlines(*_arg0); end + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#186 + def readpartial(*_arg0); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#182 + def rewind; end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#227 + def seek(*_arg0); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#178 + def settings; end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#233 + def sync; end + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#186 + def sysread(*_arg0); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#227 + def sysseek(*_arg0); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#134 + def syswrite(data); end + + # Returns the value of attribute pos. + def tell; end + + # Returns the value of attribute transformer. + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#88 + def transformer; end + + # Sets the attribute transformer + # + # @param value the value to set the attribute transformer to. + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#88 + def transformer=(_arg0); end + + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#237 + def tty?; end + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#186 + def ungetbyte(*_arg0); end + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#186 + def ungetc(*_arg0); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#134 + def write(data); end + + # source://sinatra-contrib//lib/sinatra/streaming.rb#134 + def write_nonblock(data); end + + private + + # @raise [IOError] + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#186 + def not_open_for_reading(*_arg0); end + + class << self + # @private + # + # source://sinatra-contrib//lib/sinatra/streaming.rb#92 + def extended(obj); end + end +end + +# Helper methods to ease testing your Sinatra application. Partly extracted +# from Sinatra. Testing framework agnostic. +# +# source://sinatra-contrib//lib/sinatra/test_helpers.rb#17 +module Sinatra::TestHelpers + include ::Rack::Test::Methods + extend ::Forwardable + + # Returns a Rack::Lint-wrapped Sinatra app. + # + # If no app has been configured, a new subclass of Sinatra::Base will be + # used and stored. + # + # (Rack::Lint validates your application and the requests and + # responses according to the Rack spec.) + # + # @return [Sinatra::Base] + # + # source://sinatra-contrib//lib/sinatra/test_helpers.rb#151 + def app; end + + # Replaces the configured app. + # + # @param base [Sinatra::Base] a configured app + # + # source://sinatra-contrib//lib/sinatra/test_helpers.rb#136 + def app=(base); end + + # Body of last_response + # + # @return [String] body of the last response + # @see https://www.rubydoc.info/github/rack/rack/main/Rack/Response#body-instance_method + # + # source://forwardable/1.3.3/forwardable.rb#231 + def body(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def configure(*args, **_arg1, &block); end + + # Returns a {https://www.rubydoc.info/github/rack/rack-test/Rack/Test/CookieJar Rack::Test::CookieJar}. + # + # @return [Rack::Test::CookieJar] + # + # source://forwardable/1.3.3/forwardable.rb#231 + def cookie_jar(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def disable(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def enable(*args, **_arg1, &block); end + + # Return the Rack environment used for a request to `uri`. + # + # @return [Hash] + # + # source://forwardable/1.3.3/forwardable.rb#231 + def env_for(*args, **_arg1, &block); end + + # Errors of last_response + # + # @return [Array] errors of the last response + # + # source://forwardable/1.3.3/forwardable.rb#231 + def errors(*args, **_arg1, &block); end + + # Headers of last_response + # + # @return [Hash] hash of the last response + # + # source://forwardable/1.3.3/forwardable.rb#231 + def headers(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def helpers(*args, **_arg1, &block); end + + # @return The env of the last request + # + # source://sinatra-contrib//lib/sinatra/test_helpers.rb#198 + def last_env; end + + # @return [Boolean] + # + # source://sinatra-contrib//lib/sinatra/test_helpers.rb#181 + def last_request?; end + + # Instantiate and configure a mock Sinatra app. + # + # Takes a `base` app class, or defaults to Sinatra::Base, and instantiates + # an app instance. Any given code in `block` is `class_eval`'d on this new + # instance before the instance is returned. + # + # @param base [Sinatra::Base] App base class + # @return [Sinatra] Configured mocked app + # + # source://sinatra-contrib//lib/sinatra/test_helpers.rb#123 + def mock_app(base = T.unsafe(nil), &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def register(*args, **_arg1, &block); end + + # @raise [Rack::Test:Error] If sessions are not enabled for app + # @return [Hash] Session of last request, or the empty Hash + # + # source://sinatra-contrib//lib/sinatra/test_helpers.rb#190 + def session; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def set(*args, **_arg1, &block); end + + # Replaces the configured app. + # + # @param base [Sinatra::Base] a configured app + # + # source://sinatra-contrib//lib/sinatra/test_helpers.rb#136 + def set_app(base); end + + # Returns the value of attribute settings. + # + # source://sinatra-contrib//lib/sinatra/test_helpers.rb#20 + def settings; end + + # Sets the attribute settings + # + # @param value the value to set the attribute settings to. + # + # source://sinatra-contrib//lib/sinatra/test_helpers.rb#20 + def settings=(_arg0); end + + # HTTP status of last_response + # + # @return [Integer] HTTP status of the last response + # + # source://forwardable/1.3.3/forwardable.rb#231 + def status(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def use(*args, **_arg1, &block); end +end diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/sinatra@3.2.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/sinatra@3.2.0.rbi new file mode 100644 index 0000000..ad55b34 --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/sinatra@3.2.0.rbi @@ -0,0 +1,2041 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `sinatra` gem. +# Please instead update this file by running `bin/tapioca gem sinatra`. + + +# source://sinatra//lib/sinatra/main.rb#54 +class Rack::Builder + include ::Sinatra::Delegator + + # source://rack/2.2.9/lib/rack/builder.rb#123 + def initialize(default_app = T.unsafe(nil), &block); end + + # source://rack/2.2.9/lib/rack/builder.rb#243 + def call(env); end + + # source://rack/2.2.9/lib/rack/builder.rb#226 + def freeze_app; end + + # source://rack/2.2.9/lib/rack/builder.rb#219 + def map(path, &block); end + + # source://rack/2.2.9/lib/rack/builder.rb#176 + def run(app); end + + # source://rack/2.2.9/lib/rack/builder.rb#231 + def to_app; end + + # source://rack/2.2.9/lib/rack/builder.rb#153 + def use(middleware, *args, **_arg2, &block); end + + # source://rack/2.2.9/lib/rack/builder.rb#190 + def warmup(prc = T.unsafe(nil), &block); end + + private + + # source://rack/2.2.9/lib/rack/builder.rb#251 + def generate_map(default_app, mapping); end + + class << self + # source://rack/2.2.9/lib/rack/builder.rb#130 + def app(default_app = T.unsafe(nil), &block); end + + # source://rack/2.2.9/lib/rack/builder.rb#93 + def load_file(path, opts = T.unsafe(nil)); end + + # source://rack/2.2.9/lib/rack/builder.rb#112 + def new_from_string(builder_script, file = T.unsafe(nil)); end + + # source://rack/2.2.9/lib/rack/builder.rb#64 + def parse_file(config, opts = T.unsafe(nil)); end + end +end + +class Rack::CommonLogger + # source://rack/2.2.9/lib/rack/common_logger.rb#24 + def initialize(app, logger = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#259 + def call(env); end + + # source://rack/2.2.9/lib/rack/common_logger.rb#36 + def call_without_check(env); end + + private + + # source://rack/2.2.9/lib/rack/common_logger.rb#78 + def extract_content_length(headers); end + + # source://rack/2.2.9/lib/rack/common_logger.rb#47 + def log(env, status, header, began_at); end +end + +# source://sinatra//lib/sinatra/main.rb#3 +module Sinatra + class << self + # Include the helper modules provided in Sinatra's request context. + # + # source://sinatra//lib/sinatra/base.rb#2107 + def helpers(*extensions, &block); end + + # Create a new Sinatra application; the block is evaluated in the class scope. + # + # source://sinatra//lib/sinatra/base.rb#2095 + def new(base = T.unsafe(nil), &block); end + + # Extend the top-level DSL with the modules provided. + # + # source://sinatra//lib/sinatra/base.rb#2102 + def register(*extensions, &block); end + + # Use the middleware for classic applications. + # + # source://sinatra//lib/sinatra/base.rb#2112 + def use(*args, &block); end + end +end + +# Execution context for classic style (top-level) applications. All +# DSL methods executed on main are delegated to this class. +# +# The Application class should not be subclassed, unless you want to +# inherit all settings, routes, handlers, and error pages from the +# top-level. Subclassing Sinatra::Base is highly recommended for +# modular applications. +# +# source://sinatra//lib/sinatra/base.rb#2029 +class Sinatra::Application < ::Sinatra::Base + extend ::Sinatra::Namespace::SharedMethods + + class << self + # source://sinatra//lib/sinatra/base.rb#1356 + def app_file; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def app_file=(val); end + + def app_file?; end + + # source://sinatra//lib/sinatra/base.rb#1356 + def environments; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def environments=(val); end + + def environments?; end + + # source://sinatra//lib/sinatra/base.rb#1356 + def ext_map; end + + # source://sinatra//lib/sinatra/base.rb#1364 + def ext_map=(val); end + + def ext_map?; end + + # source://sinatra//lib/sinatra/base.rb#2030 + def logging; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def logging=(val); end + + def logging?; end + def method_override; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def method_override=(val); end + + def method_override?; end + + # source://sinatra//lib/sinatra/base.rb#2035 + def register(*extensions, &block); end + + # source://sinatra-contrib/3.2.0/lib/sinatra/reloader.rb#236 + def reload_templates; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def reload_templates=(val); end + + def reload_templates?; end + + # source://sinatra-contrib/3.2.0/lib/sinatra/reloader.rb#235 + def reloader; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def reloader=(val); end + + def reloader?; end + + # source://sinatra//lib/sinatra/main.rb#36 + def run; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def run=(val); end + + def run?; end + + # source://sinatra//lib/sinatra/base.rb#1356 + def template_engines; end + + # source://sinatra//lib/sinatra/base.rb#1364 + def template_engines=(val); end + + def template_engines?; end + end +end + +# source://sinatra//lib/sinatra/base.rb#269 +class Sinatra::BadRequest < ::Sinatra::Error + # source://sinatra//lib/sinatra/base.rb#270 + def http_status; end +end + +# Base class for all Sinatra applications and middleware. +# +# source://sinatra//lib/sinatra/base.rb#964 +class Sinatra::Base + include ::Rack::Utils + include ::Sinatra::Helpers + include ::Sinatra::Templates + + # @return [Base] a new instance of Base + # @yield [_self] + # @yieldparam _self [Sinatra::Base] the object that the method was called on + # + # source://sinatra//lib/sinatra/base.rb#974 + def initialize(app = T.unsafe(nil), **_kwargs); end + + # Returns the value of attribute app. + # + # source://sinatra//lib/sinatra/base.rb#971 + def app; end + + # Sets the attribute app + # + # @param value the value to set the attribute app to. + # + # source://sinatra//lib/sinatra/base.rb#971 + def app=(_arg0); end + + # Rack call interface. + # + # source://sinatra//lib/sinatra/base.rb#983 + def call(env); end + + # source://sinatra//lib/sinatra/base.rb#987 + def call!(env); end + + # Returns the value of attribute env. + # + # source://sinatra//lib/sinatra/base.rb#971 + def env; end + + # Sets the attribute env + # + # @param value the value to set the attribute env to. + # + # source://sinatra//lib/sinatra/base.rb#971 + def env=(_arg0); end + + # Forward the request to the downstream app -- middleware only. + # + # source://sinatra//lib/sinatra/base.rb#1034 + def forward; end + + # Exit the current block, halts any further processing + # of the request, and returns the specified response. + # + # source://sinatra//lib/sinatra/base.rb#1021 + def halt(*response); end + + # Returns the value of attribute params. + # + # source://sinatra//lib/sinatra/base.rb#971 + def params; end + + # Sets the attribute params + # + # @param value the value to set the attribute params to. + # + # source://sinatra//lib/sinatra/base.rb#971 + def params=(_arg0); end + + # Pass control to the next matching route. + # If there are no more matching routes, Sinatra will + # return a 404 response. + # + # source://sinatra//lib/sinatra/base.rb#1029 + def pass(&block); end + + # Returns the value of attribute request. + # + # source://sinatra//lib/sinatra/base.rb#971 + def request; end + + # Sets the attribute request + # + # @param value the value to set the attribute request to. + # + # source://sinatra//lib/sinatra/base.rb#971 + def request=(_arg0); end + + # Returns the value of attribute response. + # + # source://sinatra//lib/sinatra/base.rb#971 + def response; end + + # Sets the attribute response + # + # @param value the value to set the attribute response to. + # + # source://sinatra//lib/sinatra/base.rb#971 + def response=(_arg0); end + + # Access settings defined with Base.set. + # + # source://sinatra//lib/sinatra/base.rb#1015 + def settings; end + + # Returns the value of attribute template_cache. + # + # source://sinatra//lib/sinatra/base.rb#972 + def template_cache; end + + private + + # Dispatch a request with error handling. + # + # source://sinatra//lib/sinatra/base.rb#1170 + def dispatch!; end + + # source://sinatra//lib/sinatra/base.rb#1262 + def dump_errors!(boom); end + + # Find an custom error block for the key(s) specified. + # + # source://sinatra//lib/sinatra/base.rb#1243 + def error_block!(key, *block_params); end + + # Run filters defined on the class and all superclasses. + # Accepts an optional block to call after each filter is applied. + # + # source://sinatra//lib/sinatra/base.rb#1048 + def filter!(type, base = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#1893 + def force_encoding(*args); end + + # Error handling during requests. + # + # source://sinatra//lib/sinatra/base.rb#1197 + def handle_exception!(boom); end + + # Run the block with 'throw :halt' support and apply result to the response. + # + # source://sinatra//lib/sinatra/base.rb#1154 + def invoke(&block); end + + # If the current request matches pattern and conditions, fill params + # with keys and call the given block. + # Revert params afterwards. + # + # Returns pass block. + # + # source://sinatra//lib/sinatra/base.rb#1091 + def process_route(pattern, conditions, block = T.unsafe(nil), values = T.unsafe(nil)); end + + # Run routes defined on the class and all superclasses. + # + # source://sinatra//lib/sinatra/base.rb#1057 + def route!(base = T.unsafe(nil), pass_block = T.unsafe(nil)); end + + # Run a route block and throw :halt with the result. + # + # source://sinatra//lib/sinatra/base.rb#1082 + def route_eval; end + + # No matching route was found or all routes passed. The default + # implementation is to forward the request downstream when running + # as middleware (@app is non-nil); when no downstream app is set, raise + # a NotFound exception. Subclasses can override this method to perform + # custom route miss logic. + # + # @raise [NotFound] + # + # source://sinatra//lib/sinatra/base.rb#1129 + def route_missing; end + + # Attempt to serve static files from public directory. Throws :halt when + # a matching file is found, returns nil otherwise. + # + # source://sinatra//lib/sinatra/base.rb#1137 + def static!(options = T.unsafe(nil)); end + + class << self + def absolute_redirects; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def absolute_redirects=(val); end + + def absolute_redirects?; end + + # source://sinatra//lib/sinatra/base.rb#1356 + def add_charset; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def add_charset=(val); end + + def add_charset?; end + + # add a filter + # + # source://sinatra//lib/sinatra/base.rb#1481 + def add_filter(type, path = T.unsafe(nil), **options, &block); end + + # Define an after filter; runs after all requests within the same + # context as route handlers and may access/modify the request and + # response. + # + # source://sinatra//lib/sinatra/base.rb#1476 + def after(path = T.unsafe(nil), **options, &block); end + + def app_file; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def app_file=(val); end + + def app_file?; end + + # Define a before filter; runs before all requests within the same + # context as route handlers and may access/modify the request and + # response. + # + # source://sinatra//lib/sinatra/base.rb#1469 + def before(path = T.unsafe(nil), **options, &block); end + + # source://sinatra//lib/sinatra/base.rb#1936 + def bind; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def bind=(val); end + + def bind?; end + + # Creates a Rack::Builder instance with all the middleware set up and + # the given +app+ as end point. + # + # source://sinatra//lib/sinatra/base.rb#1636 + def build(app); end + + # source://sinatra//lib/sinatra/base.rb#1644 + def call(env); end + + # Like Kernel#caller but excluding certain magic entries and without + # line / method information; the resulting array contains filenames only. + # + # source://sinatra//lib/sinatra/base.rb#1650 + def caller_files; end + + # source://sinatra//lib/sinatra/base.rb#1294 + def callers_to_ignore; end + + # Add a route condition. The route is considered non-matching when the + # block returns false. + # + # source://sinatra//lib/sinatra/base.rb#1495 + def condition(name = T.unsafe(nil), &block); end + + # Set configuration options for Sinatra and/or the app. + # Allows scoping of settings for certain environments. + # + # @yield [_self] + # @yieldparam _self [Sinatra::Base] the object that the method was called on + # + # source://sinatra//lib/sinatra/base.rb#1562 + def configure(*envs); end + + # source://sinatra//lib/sinatra/base.rb#1356 + def default_content_type; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def default_content_type=(val); end + + def default_content_type?; end + + # source://sinatra//lib/sinatra/base.rb#1356 + def default_encoding; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def default_encoding=(val); end + + def default_encoding?; end + + # source://sinatra//lib/sinatra/base.rb#1526 + def delete(path, opts = T.unsafe(nil), &block); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#1556 + def development?; end + + # Same as calling `set :option, false` for each of the given options. + # + # source://sinatra//lib/sinatra/base.rb#1382 + def disable(*opts); end + + # source://sinatra//lib/sinatra/base.rb#1901 + def dump_errors; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def dump_errors=(val); end + + def dump_errors?; end + def empty_path_info; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def empty_path_info=(val); end + + def empty_path_info?; end + + # Same as calling `set :option, true` for each of the given options. + # + # source://sinatra//lib/sinatra/base.rb#1377 + def enable(*opts); end + + def environment; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def environment=(val); end + + def environment?; end + + # Define a custom error handler. Optionally takes either an Exception + # class, or an HTTP status code to specify which errors should be + # handled. + # + # source://sinatra//lib/sinatra/base.rb#1389 + def error(*codes, &block); end + + # Returns the value of attribute errors. + # + # source://sinatra//lib/sinatra/base.rb#1292 + def errors; end + + # Extension modules registered on this class and all superclasses. + # + # source://sinatra//lib/sinatra/base.rb#1317 + def extensions; end + + # Returns the value of attribute filters. + # + # source://sinatra//lib/sinatra/base.rb#1292 + def filters; end + + # Force data to specified encoding. It defaults to settings.default_encoding + # which is UTF-8 by default + # + # source://sinatra//lib/sinatra/base.rb#1880 + def force_encoding(data, encoding = T.unsafe(nil)); end + + # Defining a `GET` handler also automatically defines + # a `HEAD` handler. + # + # source://sinatra//lib/sinatra/base.rb#1514 + def get(path, opts = T.unsafe(nil), &block); end + + def handler_name; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def handler_name=(val); end + + def handler_name?; end + + # source://sinatra//lib/sinatra/base.rb#1528 + def head(path, opts = T.unsafe(nil), &block); end + + # Makes the methods defined in the block and in the Modules given + # in `extensions` available to the handlers and templates + # + # source://sinatra//lib/sinatra/base.rb#1540 + def helpers(*extensions, &block); end + + # Load embedded templates from the file; uses the caller's __FILE__ + # when no file is specified. + # + # source://sinatra//lib/sinatra/base.rb#1415 + def inline_templates=(file = T.unsafe(nil)); end + + def json_content_type; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def json_content_type=(val); end + + def json_content_type?; end + + # source://sinatra-contrib/3.2.0/lib/sinatra/json.rb#122 + def json_encoder; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def json_encoder=(val); end + + def json_encoder?; end + + # Define the layout template. The block must return the template source. + # + # source://sinatra//lib/sinatra/base.rb#1409 + def layout(name = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#1534 + def link(path, opts = T.unsafe(nil), &block); end + + def lock; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def lock=(val); end + + def lock?; end + def logging; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def logging=(val); end + + def logging?; end + def method_override; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def method_override=(val); end + + def method_override?; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def methodoverride=(val); end + + def methodoverride?; end + + # Middleware used in this class and all superclasses. + # + # source://sinatra//lib/sinatra/base.rb#1326 + def middleware; end + + # Lookup or register a mime type in Rack's mime registry. + # + # source://sinatra//lib/sinatra/base.rb#1448 + def mime_type(type, value = T.unsafe(nil)); end + + # provides all mime types matching type, including deprecated types: + # mime_types :html # => ['text/html'] + # mime_types :js # => ['application/javascript', 'text/javascript'] + # + # source://sinatra//lib/sinatra/base.rb#1461 + def mime_types(type); end + + # source://sinatra//lib/sinatra/base.rb#1356 + def mustermann_opts; end + + # source://sinatra//lib/sinatra/base.rb#1364 + def mustermann_opts=(val); end + + def mustermann_opts?; end + + # Create a new instance of the class fronted by its middleware + # pipeline. The object is guaranteed to respond to #call but may not be + # an instance of the class new was called on. + # + # source://sinatra//lib/sinatra/base.rb#1628 + def new(*args, **_arg1, &block); end + + def new!(*_arg0); end + + # Sugar for `error(404) { ... }` + # + # source://sinatra//lib/sinatra/base.rb#1398 + def not_found(&block); end + + # source://sinatra//lib/sinatra/base.rb#1485 + def on_start(&on_start_callback); end + + # Returns the value of attribute on_start_callback. + # + # source://sinatra//lib/sinatra/base.rb#1292 + def on_start_callback; end + + # source://sinatra//lib/sinatra/base.rb#1489 + def on_stop(&on_stop_callback); end + + # Returns the value of attribute on_stop_callback. + # + # source://sinatra//lib/sinatra/base.rb#1292 + def on_stop_callback; end + + # source://sinatra//lib/sinatra/base.rb#1530 + def options(path, opts = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#1532 + def patch(path, opts = T.unsafe(nil), &block); end + + def port; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def port=(val); end + + def port?; end + + # source://sinatra//lib/sinatra/base.rb#1524 + def post(path, opts = T.unsafe(nil), &block); end + + def prefixed_redirects; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def prefixed_redirects=(val); end + + def prefixed_redirects?; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#1557 + def production?; end + + def protection; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def protection=(val); end + + def protection?; end + + # The prototype instance used to process requests. + # + # source://sinatra//lib/sinatra/base.rb#1618 + def prototype; end + + # source://sinatra//lib/sinatra/base.rb#1499 + def public=(value); end + + # source://sinatra//lib/sinatra/base.rb#1508 + def public_dir; end + + # source://sinatra//lib/sinatra/base.rb#1504 + def public_dir=(value); end + + # source://sinatra//lib/sinatra/base.rb#1959 + def public_folder; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def public_folder=(val); end + + def public_folder?; end + + # source://sinatra//lib/sinatra/base.rb#1522 + def put(path, opts = T.unsafe(nil), &block); end + + def quiet; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def quiet=(val); end + + def quiet?; end + + # Stop the self-hosted server if running. + # + # source://sinatra//lib/sinatra/base.rb#1574 + def quit!; end + + # source://sinatra//lib/sinatra/base.rb#1900 + def raise_errors; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def raise_errors=(val); end + + def raise_errors?; end + + # Register an extension. Alternatively take a block from which an + # extension will be created and registered on the fly. + # + # source://sinatra//lib/sinatra/base.rb#1547 + def register(*extensions, &block); end + + # source://sinatra//lib/sinatra/base.rb#1955 + def reload_templates; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def reload_templates=(val); end + + def reload_templates?; end + + # Removes all routes, filters, middleware and extension hooks from the + # current class (not routes/filters/... defined by its superclass). + # + # source://sinatra//lib/sinatra/base.rb#1300 + def reset!; end + + # source://sinatra//lib/sinatra/base.rb#1953 + def root; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def root=(val); end + + def root?; end + + # Returns the value of attribute routes. + # + # source://sinatra//lib/sinatra/base.rb#1292 + def routes; end + + def run; end + + # Run the Sinatra app as a self-hosted server using + # Puma, Falcon, or WEBrick (in that order). If given a block, will call + # with the constructed handler once we have taken the stage. + # + # source://sinatra//lib/sinatra/base.rb#1591 + def run!(options = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#1355 + def run=(val); end + + def run?; end + + # Check whether the self-hosted server is running or not. + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#1613 + def running?; end + + def running_server; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def running_server=(val); end + + def running_server?; end + + # source://sinatra//lib/sinatra/base.rb#1356 + def server; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def server=(val); end + + def server?; end + + # source://sinatra//lib/sinatra/base.rb#1356 + def session_secret; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def session_secret=(val); end + + def session_secret?; end + + # source://sinatra//lib/sinatra/base.rb#1356 + def session_store; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def session_store=(val); end + + def session_store?; end + def sessions; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def sessions=(val); end + + def sessions?; end + + # Sets an option to the given value. If the value is a proc, + # the proc will be called every time the option is accessed. + # + # @raise [ArgumentError] + # + # source://sinatra//lib/sinatra/base.rb#1336 + def set(option, value = T.unsafe(nil), ignore_setter = T.unsafe(nil), &block); end + + # Access settings defined with Base.set. + # + # source://sinatra//lib/sinatra/base.rb#1010 + def settings; end + + # source://sinatra//lib/sinatra/base.rb#1902 + def show_exceptions; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def show_exceptions=(val); end + + def show_exceptions?; end + + # Run the Sinatra app as a self-hosted server using + # Puma, Falcon, or WEBrick (in that order). If given a block, will call + # with the constructed handler once we have taken the stage. + # + # source://sinatra//lib/sinatra/base.rb#1591 + def start!(options = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#1960 + def static; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def static=(val); end + + def static?; end + def static_cache_control; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def static_cache_control=(val); end + + def static_cache_control?; end + + # Stop the self-hosted server if running. + # + # source://sinatra//lib/sinatra/base.rb#1574 + def stop!; end + + def strict_paths; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def strict_paths=(val); end + + def strict_paths?; end + + # Define a named template. The block must return the template source. + # + # source://sinatra//lib/sinatra/base.rb#1403 + def template(name, &block); end + + # Returns the value of attribute templates. + # + # source://sinatra//lib/sinatra/base.rb#1292 + def templates; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#1558 + def test?; end + + def threaded; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def threaded=(val); end + + def threaded?; end + def traps; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def traps=(val); end + + def traps?; end + + # source://sinatra//lib/sinatra/base.rb#1536 + def unlink(path, opts = T.unsafe(nil), &block); end + + # Use the specified Rack middleware + # + # source://sinatra//lib/sinatra/base.rb#1567 + def use(middleware, *args, **_arg2, &block); end + + def use_code; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def use_code=(val); end + + def use_code?; end + + # source://sinatra//lib/sinatra/base.rb#1954 + def views; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def views=(val); end + + def views?; end + def x_cascade; end + + # source://sinatra//lib/sinatra/base.rb#1355 + def x_cascade=(val); end + + def x_cascade?; end + + private + + # Condition for matching user agent. Parameter should be Regexp. + # Will set params[:agent]. + # + # source://sinatra//lib/sinatra/base.rb#1710 + def agent(pattern); end + + # Like Kernel#caller but excluding certain magic entries + # + # source://sinatra//lib/sinatra/base.rb#1871 + def cleaned_caller(keep = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#1781 + def compile(path, route_mustermann_opts = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#1761 + def compile!(verb, path, block, **options); end + + # Dynamically defines a method on settings. + # + # source://sinatra//lib/sinatra/base.rb#1696 + def define_singleton(name, content = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#1754 + def generate_method(method_name, &block); end + + # Condition for matching host name. Parameter might be String or Regexp. + # + # source://sinatra//lib/sinatra/base.rb#1704 + def host_name(pattern); end + + # @private + # + # source://sinatra//lib/sinatra/base.rb#1850 + def inherited(subclass); end + + # source://sinatra//lib/sinatra/base.rb#1750 + def invoke_hook(name, *args); end + + # Condition for matching mimetypes. Accepts file extensions. + # + # source://sinatra//lib/sinatra/base.rb#1723 + def provides(*types); end + + # source://sinatra//lib/sinatra/base.rb#1742 + def route(verb, path, options = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#1812 + def setup_common_logger(builder); end + + # source://sinatra//lib/sinatra/base.rb#1816 + def setup_custom_logger(builder); end + + # source://sinatra//lib/sinatra/base.rb#1785 + def setup_default_middleware(builder); end + + # source://sinatra//lib/sinatra/base.rb#1799 + def setup_logging(builder); end + + # source://sinatra//lib/sinatra/base.rb#1795 + def setup_middleware(builder); end + + # source://sinatra//lib/sinatra/base.rb#1808 + def setup_null_logger(builder); end + + # source://sinatra//lib/sinatra/base.rb#1824 + def setup_protection(builder); end + + # source://sinatra//lib/sinatra/base.rb#1841 + def setup_sessions(builder); end + + # source://sinatra//lib/sinatra/base.rb#1680 + def setup_traps; end + + # Starts the server by running the Rack Handler. + # + # source://sinatra//lib/sinatra/base.rb#1657 + def start_server(handler, server_settings, handler_name); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#1676 + def suppress_messages?; end + + # source://sinatra//lib/sinatra/base.rb#1857 + def synchronize(&block); end + + # Condition for matching user agent. Parameter should be Regexp. + # Will set params[:agent]. + # + # source://sinatra//lib/sinatra/base.rb#1710 + def user_agent(pattern); end + + # used for deprecation warnings + # + # source://sinatra//lib/sinatra/base.rb#1866 + def warn_for_deprecation(message); end + end +end + +# source://sinatra//lib/sinatra/base.rb#969 +Sinatra::Base::URI_INSTANCE = T.let(T.unsafe(nil), URI::RFC2396_Parser) + +# Behaves exactly like Rack::CommonLogger with the notable exception that it does nothing, +# if another CommonLogger is already in the middleware chain. +# +# source://sinatra//lib/sinatra/base.rb#252 +class Sinatra::CommonLogger < ::Rack::CommonLogger + # source://sinatra//lib/sinatra/base.rb#253 + def call(env); end +end + +# Sinatra delegation mixin. Mixing this module into an object causes all +# methods to be delegated to the Sinatra::Application class. Used primarily +# at the top-level. +# +# source://sinatra//lib/sinatra/base.rb#2045 +module Sinatra::Delegator + private + + # source://sinatra//lib/sinatra/base.rb#2048 + def after(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def after_reload(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def also_reload(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def before(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def config_file(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def configure(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def delete(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def development?(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def disable(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def dont_reload(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def enable(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def error(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def get(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def head(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def helpers(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def layout(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def link(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def mime_type(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def namespace(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def not_found(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def on_start(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def on_stop(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def options(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def patch(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def post(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def production?(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def put(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def register(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def remap_extensions(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def rendering_method(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def respond_to(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def route(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def set(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def settings(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def template(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def test?(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def unlink(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2048 + def use(*args, **_arg1, &block); end + + class << self + # source://sinatra//lib/sinatra/base.rb#2046 + def delegate(*methods); end + + # Returns the value of attribute target. + # + # source://sinatra//lib/sinatra/base.rb#2065 + def target; end + + # Sets the attribute target + # + # @param value the value to set the attribute target to. + # + # source://sinatra//lib/sinatra/base.rb#2065 + def target=(_arg0); end + end +end + +# source://sinatra//lib/sinatra/base.rb#266 +class Sinatra::Error < ::StandardError; end + +# Some Rack handlers implement an extended body object protocol, however, +# some middleware (namely Rack::Lint) will break it by not mirroring the methods in question. +# This middleware will detect an extended body object and will make sure it reaches the +# handler directly. We do this here, so our middleware and middleware set up by the app will +# still be able to run. +# +# source://sinatra//lib/sinatra/base.rb#217 +class Sinatra::ExtendedRack < ::Struct + # source://sinatra//lib/sinatra/base.rb#218 + def call(env); end + + private + + # @raise [NotImplementedError] + # + # source://sinatra//lib/sinatra/base.rb#237 + def after_response(&block); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#243 + def async?(status, _headers, body); end + + # source://sinatra//lib/sinatra/base.rb#230 + def setup_close(env, _status, _headers, body); end +end + +# Methods available to routes, before/after filters, and views. +# +# source://sinatra//lib/sinatra/base.rb#278 +module Sinatra::Helpers + # Set the Content-Disposition to "attachment" with the specified filename, + # instructing the user agents to prompt to save. + # + # source://sinatra//lib/sinatra/base.rb#408 + def attachment(filename = T.unsafe(nil), disposition = T.unsafe(nil)); end + + # Sugar for redirect (example: redirect back) + # + # source://sinatra//lib/sinatra/base.rb#644 + def back; end + + # whether or not the status is set to 400 + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#679 + def bad_request?; end + + # Set or retrieve the response body. When a block is given, + # evaluation is deferred until the body is read with #each. + # + # source://sinatra//lib/sinatra/base.rb#287 + def body(value = T.unsafe(nil), &block); end + + # Specify response freshness policy for HTTP caches (Cache-Control header). + # Any number of non-value directives (:public, :private, :no_cache, + # :no_store, :must_revalidate, :proxy_revalidate) may be passed along with + # a Hash of value directives (:max_age, :s_maxage). + # + # cache_control :public, :must_revalidate, :max_age => 60 + # => Cache-Control: public, must-revalidate, max-age=60 + # + # See RFC 2616 / 14.9 for more on standard cache control directives: + # http://tools.ietf.org/html/rfc2616#section-14.9.1 + # + # source://sinatra//lib/sinatra/base.rb#531 + def cache_control(*values); end + + # whether or not the status is set to 4xx + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#664 + def client_error?; end + + # Set the Content-Type of the response body given a media type or file + # extension. + # + # source://sinatra//lib/sinatra/base.rb#377 + def content_type(type = T.unsafe(nil), params = T.unsafe(nil)); end + + # Halt processing and return the error status provided. + # + # source://sinatra//lib/sinatra/base.rb#340 + def error(code, body = T.unsafe(nil)); end + + # Set the response entity tag (HTTP 'ETag' header) and halt if conditional + # GET matches. The +value+ argument is an identifier that uniquely + # identifies the current version of the resource. The +kind+ argument + # indicates whether the etag should be used as a :strong (default) or :weak + # cache validator. + # + # When the current request includes an 'If-None-Match' header with a + # matching etag, execution is immediately halted. If the request method is + # GET or HEAD, a '304 Not Modified' response is sent. + # + # source://sinatra//lib/sinatra/base.rb#614 + def etag(value, options = T.unsafe(nil)); end + + # Set the Expires header and Cache-Control/max-age directive. Amount + # can be an integer number of seconds in the future or a Time object + # indicating when the response should be considered "stale". The remaining + # "values" arguments are passed to the #cache_control helper: + # + # expires 500, :public, :must_revalidate + # => Cache-Control: public, must-revalidate, max-age=500 + # => Expires: Mon, 08 Jun 2009 08:50:17 GMT + # + # source://sinatra//lib/sinatra/base.rb#559 + def expires(amount, *values); end + + # Set multiple response headers with Hash. + # + # source://sinatra//lib/sinatra/base.rb#355 + def headers(hash = T.unsafe(nil)); end + + # whether or not the status is set to 1xx + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#649 + def informational?; end + + # Set the last modified time of the resource (HTTP 'Last-Modified' header) + # and halt if conditional GET matches. The +time+ argument is a Time, + # DateTime, or other object that responds to +to_time+. + # + # When the current request includes an 'If-Modified-Since' header that is + # equal or later than the time specified, execution is immediately halted + # with a '304 Not Modified' response. + # + # source://sinatra//lib/sinatra/base.rb#583 + def last_modified(time); end + + # Access shared logger object. + # + # source://sinatra//lib/sinatra/base.rb#366 + def logger; end + + # Look up a media type by file extension in Rack's mime registry. + # + # source://sinatra//lib/sinatra/base.rb#371 + def mime_type(type); end + + # Halt processing and return a 404 Not Found. + # + # source://sinatra//lib/sinatra/base.rb#350 + def not_found(body = T.unsafe(nil)); end + + # whether or not the status is set to 404 + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#674 + def not_found?; end + + # Halt processing and redirect to the URI provided. + # + # source://sinatra//lib/sinatra/base.rb#304 + def redirect(uri, *args); end + + # whether or not the status is set to 3xx + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#659 + def redirect?; end + + # Use the contents of the file at +path+ as the response body. + # + # source://sinatra//lib/sinatra/base.rb#419 + def send_file(path, opts = T.unsafe(nil)); end + + # whether or not the status is set to 5xx + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#669 + def server_error?; end + + # Access the underlying Rack session. + # + # source://sinatra//lib/sinatra/base.rb#361 + def session; end + + # Set or retrieve the response status code. + # + # source://sinatra//lib/sinatra/base.rb#280 + def status(value = T.unsafe(nil)); end + + # Allows to start sending data to the client even though later parts of + # the response body have not yet been generated. + # + # The close parameter specifies whether Stream#close should be called + # after the block has been executed. + # + # source://sinatra//lib/sinatra/base.rb#506 + def stream(keep_open = T.unsafe(nil)); end + + # whether or not the status is set to 2xx + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#654 + def success?; end + + # Generates a Time object from the given value. + # Used by #expires and #last_modified. + # + # source://sinatra//lib/sinatra/base.rb#685 + def time_for(value); end + + # Generates the absolute URI for a given path in the app. + # Takes Rack routers and reverse proxies into account. + # + # source://sinatra//lib/sinatra/base.rb#319 + def to(addr = T.unsafe(nil), absolute = T.unsafe(nil), add_script_name = T.unsafe(nil)); end + + # Generates the absolute URI for a given path in the app. + # Takes Rack routers and reverse proxies into account. + # + # source://sinatra//lib/sinatra/base.rb#319 + def uri(addr = T.unsafe(nil), absolute = T.unsafe(nil), add_script_name = T.unsafe(nil)); end + + # Generates the absolute URI for a given path in the app. + # Takes Rack routers and reverse proxies into account. + # + # source://sinatra//lib/sinatra/base.rb#319 + def url(addr = T.unsafe(nil), absolute = T.unsafe(nil), add_script_name = T.unsafe(nil)); end + + private + + # Helper method checking if a ETag value list includes the current ETag. + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#702 + def etag_matches?(list, new_resource = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#708 + def with_params(temp_params); end +end + +# source://sinatra//lib/sinatra/base.rb#604 +Sinatra::Helpers::ETAG_KINDS = T.let(T.unsafe(nil), Array) + +# https://html.spec.whatwg.org/#multipart-form-data +# +# source://sinatra//lib/sinatra/base.rb#400 +Sinatra::Helpers::MULTIPART_FORM_DATA_REPLACEMENT_TABLE = T.let(T.unsafe(nil), Hash) + +# Class of the response body in case you use #stream. +# +# Three things really matter: The front and back block (back being the +# block generating content, front the one sending it to the client) and +# the scheduler, integrating with whatever concurrency feature the Rack +# handler is using. +# +# Scheduler has to respond to defer and schedule. +# +# source://sinatra//lib/sinatra/base.rb#451 +class Sinatra::Helpers::Stream + # @return [Stream] a new instance of Stream + # + # source://sinatra//lib/sinatra/base.rb#455 + def initialize(scheduler = T.unsafe(nil), keep_open = T.unsafe(nil), &back); end + + # source://sinatra//lib/sinatra/base.rb#483 + def <<(data); end + + # source://sinatra//lib/sinatra/base.rb#488 + def callback(&block); end + + # source://sinatra//lib/sinatra/base.rb#463 + def close; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#496 + def closed?; end + + # source://sinatra//lib/sinatra/base.rb#470 + def each(&front); end + + # source://sinatra//lib/sinatra/base.rb#488 + def errback(&block); end + + class << self + # source://sinatra//lib/sinatra/base.rb#453 + def defer(*_arg0); end + + # source://sinatra//lib/sinatra/base.rb#452 + def schedule(*_arg0); end + end +end + +# A poor man's ActiveSupport::HashWithIndifferentAccess, with all the Rails-y +# stuff removed. +# +# Implements a hash where keys :foo and "foo" are +# considered to be the same. +# +# rgb = Sinatra::IndifferentHash.new +# +# rgb[:black] = '#000000' # symbol assignment +# rgb[:black] # => '#000000' # symbol retrieval +# rgb['black'] # => '#000000' # string retrieval +# +# rgb['white'] = '#FFFFFF' # string assignment +# rgb[:white] # => '#FFFFFF' # symbol retrieval +# rgb['white'] # => '#FFFFFF' # string retrieval +# +# Internally, symbols are mapped to strings when used as keys in the entire +# writing interface (calling e.g. []=, merge). This mapping +# belongs to the public interface. For example, given: +# +# hash = Sinatra::IndifferentHash.new +# hash[:a] = 1 +# +# You are guaranteed that the key is returned as a string: +# +# hash.keys # => ["a"] +# +# Technically other types of keys are accepted: +# +# hash = Sinatra::IndifferentHash +# hash[:a] = 1 +# hash[0] = 0 +# hash # => { "a"=>1, 0=>0 } +# +# But this class is intended for use cases where strings or symbols are the +# expected keys and it is convenient to understand both as the same. For +# example the +params+ hash in Sinatra. +# +# source://sinatra//lib/sinatra/indifferent_hash.rb#41 +class Sinatra::IndifferentHash < ::Hash + # @return [IndifferentHash] a new instance of IndifferentHash + # + # source://sinatra//lib/sinatra/indifferent_hash.rb#46 + def initialize(*args); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#76 + def [](key); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#80 + def []=(key, value); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#62 + def assoc(key); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#187 + def compact; end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#52 + def default(*args); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#58 + def default=(value); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#104 + def delete(key); end + + # Added in Ruby 2.3 + # + # source://sinatra//lib/sinatra/indifferent_hash.rb#109 + def dig(key, *other_keys); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#191 + def except(*keys); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#70 + def fetch(key, *args); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#113 + def fetch_values(*keys); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/indifferent_hash.rb#90 + def has_key?(key); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/indifferent_hash.rb#98 + def has_value?(value); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/indifferent_hash.rb#90 + def include?(key); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#86 + def key(value); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/indifferent_hash.rb#90 + def key?(key); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/indifferent_hash.rb#90 + def member?(key); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#149 + def merge(*other_hashes, &block); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#131 + def merge!(*other_hashes); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#66 + def rassoc(value); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#181 + def reject(*args, &block); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#153 + def replace(other_hash); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#175 + def select(*args, &block); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#119 + def slice(*keys); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#80 + def store(key, value); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#166 + def transform_keys(&block); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#170 + def transform_keys!; end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#157 + def transform_values(&block); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#161 + def transform_values!; end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#131 + def update(*other_hashes); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/indifferent_hash.rb#98 + def value?(value); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#125 + def values_at(*keys); end + + private + + # source://sinatra//lib/sinatra/indifferent_hash.rb#199 + def convert_key(key); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#203 + def convert_value(value); end + + class << self + # source://sinatra//lib/sinatra/indifferent_hash.rb#42 + def [](*args); end + end +end + +# source://sinatra//lib/sinatra/base.rb#273 +class Sinatra::NotFound < ::Sinatra::Error + # source://sinatra//lib/sinatra/base.rb#274 + def http_status; end +end + +# The request object. See Rack::Request for more info: +# https://rubydoc.info/github/rack/rack/main/Rack/Request +# +# source://sinatra//lib/sinatra/base.rb#23 +class Sinatra::Request < ::Rack::Request + # Returns an array of acceptable media types for the response + # + # source://sinatra//lib/sinatra/base.rb#28 + def accept; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#40 + def accept?(type); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#58 + def forwarded?; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#66 + def idempotent?; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#70 + def link?; end + + # source://sinatra//lib/sinatra/base.rb#78 + def params; end + + # source://sinatra//lib/sinatra/base.rb#44 + def preferred_type(*types); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#62 + def safe?; end + + # source://rack/2.2.9/lib/rack/request.rb#350 + def secure?; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#74 + def unlink?; end +end + +# source://sinatra//lib/sinatra/base.rb#86 +class Sinatra::Request::AcceptEntry + # @return [AcceptEntry] a new instance of AcceptEntry + # + # source://sinatra//lib/sinatra/base.rb#90 + def initialize(entry); end + + # source://sinatra//lib/sinatra/base.rb#103 + def <=>(other); end + + # Returns the value of attribute entry. + # + # source://sinatra//lib/sinatra/base.rb#88 + def entry; end + + # source://sinatra//lib/sinatra/base.rb#124 + def method_missing(*args, &block); end + + # Returns the value of attribute params. + # + # source://sinatra//lib/sinatra/base.rb#87 + def params; end + + # Sets the attribute params + # + # @param value the value to set the attribute params to. + # + # source://sinatra//lib/sinatra/base.rb#87 + def params=(_arg0); end + + # source://sinatra//lib/sinatra/base.rb#107 + def priority; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#120 + def respond_to?(*args); end + + # source://sinatra//lib/sinatra/base.rb#116 + def to_s(full = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#112 + def to_str; end +end + +# source://sinatra//lib/sinatra/base.rb#24 +Sinatra::Request::HEADER_PARAM = T.let(T.unsafe(nil), Regexp) + +# source://sinatra//lib/sinatra/base.rb#25 +Sinatra::Request::HEADER_VALUE_WITH_PARAMS = T.let(T.unsafe(nil), Regexp) + +# source://sinatra//lib/sinatra/base.rb#129 +class Sinatra::Request::MimeTypeEntry + # @return [MimeTypeEntry] a new instance of MimeTypeEntry + # + # source://sinatra//lib/sinatra/base.rb#132 + def initialize(entry); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#143 + def accepts?(entry); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#151 + def matches_params?(params); end + + # Returns the value of attribute params. + # + # source://sinatra//lib/sinatra/base.rb#130 + def params; end + + # source://sinatra//lib/sinatra/base.rb#147 + def to_str; end +end + +# The response object. See Rack::Response and Rack::Response::Helpers for +# more info: +# https://rubydoc.info/github/rack/rack/main/Rack/Response +# https://rubydoc.info/github/rack/rack/main/Rack/Response/Helpers +# +# source://sinatra//lib/sinatra/base.rb#163 +class Sinatra::Response < ::Rack::Response + # source://sinatra//lib/sinatra/base.rb#166 + def body=(value); end + + # source://sinatra//lib/sinatra/base.rb#171 + def each; end + + # source://sinatra//lib/sinatra/base.rb#175 + def finish; end + + private + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#199 + def calculate_content_length?; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#207 + def drop_body?; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#203 + def drop_content_info?; end +end + +# source://sinatra//lib/sinatra/base.rb#164 +Sinatra::Response::DROP_BODY_RESPONSES = T.let(T.unsafe(nil), Array) + +# Sinatra::ShowExceptions catches all exceptions raised from the app it +# wraps. It shows a useful backtrace with the sourcefile and clickable +# context, the whole Rack environment and the request data. +# +# Be careful when you use this on public-facing sites as it could reveal +# information helpful to attackers. +# +# source://sinatra//lib/sinatra/show_exceptions.rb#12 +class Sinatra::ShowExceptions < ::Rack::ShowExceptions + # @return [ShowExceptions] a new instance of ShowExceptions + # + # source://sinatra//lib/sinatra/show_exceptions.rb#18 + def initialize(app); end + + # source://sinatra//lib/sinatra/show_exceptions.rb#22 + def call(env); end + + # source://sinatra//lib/sinatra/show_exceptions.rb#48 + def template; end + + private + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/show_exceptions.rb#54 + def bad_request?(exception); end + + # source://sinatra//lib/sinatra/show_exceptions.rb#63 + def frame_class(frame); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/show_exceptions.rb#58 + def prefers_plain_text?(env); end +end + +# source://sinatra//lib/sinatra/show_exceptions.rb#74 +Sinatra::ShowExceptions::TEMPLATE = T.let(T.unsafe(nil), ERB) + +# Extremely simple template cache implementation. +# * Not thread-safe. +# * Size is unbounded. +# * Keys are not copied defensively, and should not be modified after +# being passed to #fetch. More specifically, the values returned by +# key#hash and key#eql? should not change. +# +# Implementation copied from Tilt::Cache. +# +# source://sinatra//lib/sinatra/base.rb#942 +class Sinatra::TemplateCache + # @return [TemplateCache] a new instance of TemplateCache + # + # source://sinatra//lib/sinatra/base.rb#943 + def initialize; end + + # Clears the cache. + # + # source://sinatra//lib/sinatra/base.rb#958 + def clear; end + + # Caches a value for key, or returns the previously cached value. + # If a value has been previously cached for key then it is + # returned. Otherwise, block is yielded to and its return value + # which may be nil, is cached under key and returned. + # + # source://sinatra//lib/sinatra/base.rb#951 + def fetch(*key); end +end + +# Template rendering methods. Each method takes the name of a template +# to render as a Symbol and returns a String with the rendered output, +# as well as an optional hash with additional options. +# +# `template` is either the name or path of the template as symbol +# (Use `:'subdir/myview'` for views in subdirectories), or a string +# that will be rendered. +# +# Possible options are: +# :content_type The content type to use, same arguments as content_type. +# :layout If set to something falsy, no layout is rendered, otherwise +# the specified layout is used (Ignored for `sass`) +# :layout_engine Engine to use for rendering the layout. +# :locals A hash with local variables that should be available +# in the template +# :scope If set, template is evaluate with the binding of the given +# object rather than the application instance. +# :views Views directory to use. +# +# source://sinatra//lib/sinatra/base.rb#735 +module Sinatra::Templates + # source://sinatra//lib/sinatra/base.rb#740 + def initialize; end + + # source://sinatra//lib/sinatra/base.rb#786 + def asciidoc(template, options = T.unsafe(nil), locals = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#768 + def builder(template = T.unsafe(nil), options = T.unsafe(nil), locals = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#746 + def erb(template, options = T.unsafe(nil), locals = T.unsafe(nil), &block); end + + # Calls the given block for every possible template file in views, + # named name.ext, where ext is registered on engine. + # + # @yield [::File.join(views, "#{name}.#{@preferred_extension}")] + # + # source://sinatra//lib/sinatra/base.rb#815 + def find_template(views, name, engine); end + + # source://sinatra//lib/sinatra/base.rb#750 + def haml(template, options = T.unsafe(nil), locals = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#773 + def liquid(template, options = T.unsafe(nil), locals = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#790 + def markaby(template = T.unsafe(nil), options = T.unsafe(nil), locals = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#777 + def markdown(template, options = T.unsafe(nil), locals = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#794 + def nokogiri(template = T.unsafe(nil), options = T.unsafe(nil), locals = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#808 + def rabl(template, options = T.unsafe(nil), locals = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#782 + def rdoc(template, options = T.unsafe(nil), locals = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#754 + def sass(template, options = T.unsafe(nil), locals = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#761 + def scss(template, options = T.unsafe(nil), locals = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#799 + def slim(template, options = T.unsafe(nil), locals = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#803 + def yajl(template, options = T.unsafe(nil), locals = T.unsafe(nil)); end + + private + + # source://sinatra//lib/sinatra/base.rb#924 + def compile_block_template(template, options, &body); end + + # source://sinatra//lib/sinatra/base.rb#886 + def compile_template(engine, data, options, views); end + + # source://sinatra//lib/sinatra/base.rb#835 + def render(engine, data, options = T.unsafe(nil), locals = T.unsafe(nil), &block); end + + # logic shared between builder and nokogiri + # + # source://sinatra//lib/sinatra/base.rb#826 + def render_ruby(engine, template, options = T.unsafe(nil), locals = T.unsafe(nil), &block); end +end + +# source://sinatra//lib/sinatra/base.rb#736 +module Sinatra::Templates::ContentTyped + # Returns the value of attribute content_type. + # + # source://sinatra//lib/sinatra/base.rb#737 + def content_type; end + + # Sets the attribute content_type + # + # @param value the value to set the attribute content_type to. + # + # source://sinatra//lib/sinatra/base.rb#737 + def content_type=(_arg0); end +end + +# source://sinatra//lib/sinatra/version.rb#4 +Sinatra::VERSION = T.let(T.unsafe(nil), String) + +# source://sinatra//lib/sinatra/base.rb#2071 +class Sinatra::Wrapper + # @return [Wrapper] a new instance of Wrapper + # + # source://sinatra//lib/sinatra/base.rb#2072 + def initialize(stack, instance); end + + # source://sinatra//lib/sinatra/base.rb#2085 + def call(env); end + + # source://sinatra//lib/sinatra/base.rb#2081 + def helpers; end + + # source://sinatra//lib/sinatra/base.rb#2089 + def inspect; end + + # source://sinatra//lib/sinatra/base.rb#2077 + def settings; end +end diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/sorbet-coerce@0.7.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/sorbet-coerce@0.7.0.rbi new file mode 100644 index 0000000..6f9e696 --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/sorbet-coerce@0.7.0.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `sorbet-coerce` gem. +# Please instead update this file by running `bin/tapioca gem sorbet-coerce`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/spoom@1.5.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/spoom@1.5.0.rbi new file mode 100644 index 0000000..b0b590b --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/spoom@1.5.0.rbi @@ -0,0 +1,4932 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `spoom` gem. +# Please instead update this file by running `bin/tapioca gem spoom`. + + +# source://spoom//lib/spoom.rb#7 +module Spoom + class << self + # source://spoom//lib/spoom/parse.rb#13 + sig { params(ruby: ::String, file: ::String).returns(::Prism::Node) } + def parse_ruby(ruby, file:); end + end +end + +# source://spoom//lib/spoom/cli/helper.rb#9 +module Spoom::Cli; end + +# source://spoom//lib/spoom/cli/deadcode.rb#8 +class Spoom::Cli::Deadcode < ::Thor + include ::Spoom::Colorize + include ::Spoom::Cli::Helper + + # source://spoom//lib/spoom/cli/deadcode.rb#52 + sig { params(paths: ::String).void } + def deadcode(*paths); end + + def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # source://spoom//lib/spoom/cli/deadcode.rb#154 + def remove(location_string); end +end + +# source://spoom//lib/spoom/cli/helper.rb#10 +module Spoom::Cli::Helper + include ::Spoom::Colorize + + requires_ancestor { Thor } + + # source://spoom//lib/spoom/cli/helper.rb#139 + sig { params(string: ::String).returns(::String) } + def blue(string); end + + # Is the `--color` option true? + # + # source://spoom//lib/spoom/cli/helper.rb#103 + sig { returns(T::Boolean) } + def color?; end + + # Colorize a string if `color?` + # + # source://spoom//lib/spoom/cli/helper.rb#132 + sig { params(string: ::String, color: ::Spoom::Color).returns(::String) } + def colorize(string, *color); end + + # Returns the context at `--path` (by default the current working directory) + # + # source://spoom//lib/spoom/cli/helper.rb#71 + sig { returns(::Spoom::Context) } + def context; end + + # Raise if `spoom` is not ran inside a context with a `sorbet/config` file + # + # source://spoom//lib/spoom/cli/helper.rb#77 + sig { returns(::Spoom::Context) } + def context_requiring_sorbet!; end + + # source://spoom//lib/spoom/cli/helper.rb#144 + sig { params(string: ::String).returns(::String) } + def cyan(string); end + + # Return the path specified through `--path` + # + # source://spoom//lib/spoom/cli/helper.rb#92 + sig { returns(::String) } + def exec_path; end + + # source://spoom//lib/spoom/cli/helper.rb#149 + sig { params(string: ::String).returns(::String) } + def gray(string); end + + # source://spoom//lib/spoom/cli/helper.rb#154 + sig { params(string: ::String).returns(::String) } + def green(string); end + + # source://spoom//lib/spoom/cli/helper.rb#108 + sig { params(string: ::String).returns(::String) } + def highlight(string); end + + # source://spoom//lib/spoom/cli/helper.rb#159 + sig { params(string: ::String).returns(::String) } + def red(string); end + + # Print `message` on `$stdout` + # + # source://spoom//lib/spoom/cli/helper.rb#20 + sig { params(message: ::String).void } + def say(message); end + + # Print `message` on `$stderr` + # + # The message is prefixed by a status (default: `Error`). + # + # source://spoom//lib/spoom/cli/helper.rb#39 + sig { params(message: ::String, status: T.nilable(::String), nl: T::Boolean).void } + def say_error(message, status: T.unsafe(nil), nl: T.unsafe(nil)); end + + # Print `message` on `$stderr` + # + # The message is prefixed by a status (default: `Warning`). + # + # source://spoom//lib/spoom/cli/helper.rb#59 + sig { params(message: ::String, status: T.nilable(::String), nl: T::Boolean).void } + def say_warning(message, status: T.unsafe(nil), nl: T.unsafe(nil)); end + + # source://spoom//lib/spoom/cli/helper.rb#164 + sig { params(string: ::String).returns(::String) } + def yellow(string); end +end + +# source://spoom//lib/spoom/cli.rb#12 +class Spoom::Cli::Main < ::Thor + include ::Spoom::Colorize + include ::Spoom::Cli::Helper + + # source://spoom//lib/spoom/cli.rb#101 + def __print_version; end + + # source://spoom//lib/spoom/cli.rb#58 + sig { params(directory: ::String).void } + def bump(directory = T.unsafe(nil)); end + + # source://spoom//lib/spoom/cli.rb#65 + def coverage(*args); end + + # source://thor/1.3.2/lib/thor.rb#334 + def deadcode(*args); end + + # source://spoom//lib/spoom/cli.rb#75 + def lsp(*args); end + + # source://thor/1.3.2/lib/thor.rb#334 + def srb(*args); end + + # source://spoom//lib/spoom/cli.rb#94 + def tc(*paths_to_select); end + + class << self + # @return [Boolean] + # + # source://spoom//lib/spoom/cli.rb#108 + def exit_on_failure?; end + end +end + +# source://spoom//lib/spoom/cli.rb#81 +Spoom::Cli::Main::SORT_CODE = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/cli.rb#83 +Spoom::Cli::Main::SORT_ENUM = T.let(T.unsafe(nil), Array) + +# source://spoom//lib/spoom/cli.rb#82 +Spoom::Cli::Main::SORT_LOC = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/cli/srb/bump.rb#9 +module Spoom::Cli::Srb; end + +# source://spoom//lib/spoom/cli/srb/bump.rb#10 +class Spoom::Cli::Srb::Bump < ::Thor + include ::Spoom::Colorize + include ::Spoom::Cli::Helper + + # source://spoom//lib/spoom/cli/srb/bump.rb#50 + sig { params(directory: ::String).void } + def bump(directory = T.unsafe(nil)); end + + def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # source://spoom//lib/spoom/cli/srb/bump.rb#171 + def print_changes(files, command:, from: T.unsafe(nil), to: T.unsafe(nil), dry: T.unsafe(nil), path: T.unsafe(nil)); end + + # source://spoom//lib/spoom/cli/srb/bump.rb#193 + def undo_changes(files, from_strictness); end +end + +# source://spoom//lib/spoom/cli/srb/coverage.rb#10 +class Spoom::Cli::Srb::Coverage < ::Thor + include ::Spoom::Colorize + include ::Spoom::Cli::Helper + + # source://spoom//lib/spoom/cli/srb/coverage.rb#199 + def bundle_install(path, sha); end + + def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # source://spoom//lib/spoom/cli/srb/coverage.rb#211 + def message_no_data(file); end + + # source://spoom//lib/spoom/cli/srb/coverage.rb#174 + def open(file = T.unsafe(nil)); end + + # source://spoom//lib/spoom/cli/srb/coverage.rb#190 + def parse_time(string, option); end + + # source://spoom//lib/spoom/cli/srb/coverage.rb#143 + def report; end + + # source://spoom//lib/spoom/cli/srb/coverage.rb#21 + def snapshot; end + + # source://spoom//lib/spoom/cli/srb/coverage.rb#43 + def timeline; end +end + +# source://spoom//lib/spoom/cli/srb/coverage.rb#13 +Spoom::Cli::Srb::Coverage::DATA_DIR = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/cli/srb/lsp.rb#11 +class Spoom::Cli::Srb::LSP < ::Thor + include ::Spoom::Colorize + include ::Spoom::Cli::Helper + + # TODO: options, filter, limit, kind etc.. filter rbi + # + # source://spoom//lib/spoom/cli/srb/lsp.rb#45 + def defs(file, line, col); end + + # TODO: options, filter, limit, kind etc.. filter rbi + # + # source://spoom//lib/spoom/cli/srb/lsp.rb#55 + def find(query); end + + def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # TODO: options, filter, limit, kind etc.. filter rbi + # + # source://spoom//lib/spoom/cli/srb/lsp.rb#31 + def hover(file, line, col); end + + # TODO: options, filter, limit, kind etc.. filter rbi + # + # source://spoom//lib/spoom/cli/srb/lsp.rb#16 + def list; end + + # source://spoom//lib/spoom/cli/srb/lsp.rb#104 + def lsp_client; end + + # TODO: options, filter, limit, kind etc.. filter rbi + # + # source://spoom//lib/spoom/cli/srb/lsp.rb#75 + def refs(file, line, col); end + + # source://spoom//lib/spoom/cli/srb/lsp.rb#127 + def run(&block); end + + # TODO: options, filter, limit, kind etc.. filter rbi + # + # source://spoom//lib/spoom/cli/srb/lsp.rb#85 + def sigs(file, line, col); end + + # source://spoom//lib/spoom/cli/srb/lsp.rb#119 + def symbol_printer; end + + # TODO: options, filter, limit, kind etc.. filter rbi + # + # source://spoom//lib/spoom/cli/srb/lsp.rb#65 + def symbols(file); end + + # source://spoom//lib/spoom/cli/srb/lsp.rb#152 + def to_uri(path); end + + # TODO: options, filter, limit, kind etc.. filter rbi + # + # source://spoom//lib/spoom/cli/srb/lsp.rb#95 + def types(file, line, col); end +end + +# source://spoom//lib/spoom/cli/srb.rb#12 +class Spoom::Cli::Srb::Main < ::Thor + # source://thor/1.3.2/lib/thor.rb#334 + def bump(*args); end + + # source://thor/1.3.2/lib/thor.rb#334 + def coverage(*args); end + + def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # source://thor/1.3.2/lib/thor.rb#334 + def lsp(*args); end + + # source://thor/1.3.2/lib/thor.rb#334 + def tc(*args); end +end + +# source://spoom//lib/spoom/cli/srb/tc.rb#7 +class Spoom::Cli::Srb::Tc < ::Thor + include ::Spoom::Colorize + include ::Spoom::Cli::Helper + + # source://spoom//lib/spoom/cli/srb/tc.rb#132 + def colorize_message(message); end + + # source://spoom//lib/spoom/cli/srb/tc.rb#123 + def format_error(error, format); end + + def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # source://spoom//lib/spoom/cli/srb/tc.rb#27 + def tc(*paths_to_select); end +end + +# source://spoom//lib/spoom/cli/srb/tc.rb#16 +Spoom::Cli::Srb::Tc::DEFAULT_FORMAT = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/cli/srb/tc.rb#12 +Spoom::Cli::Srb::Tc::SORT_CODE = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/cli/srb/tc.rb#14 +Spoom::Cli::Srb::Tc::SORT_ENUM = T.let(T.unsafe(nil), Array) + +# source://spoom//lib/spoom/cli/srb/tc.rb#13 +Spoom::Cli::Srb::Tc::SORT_LOC = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/colors.rb#5 +class Spoom::Color < ::T::Enum + enums do + CLEAR = new + BOLD = new + BLACK = new + RED = new + GREEN = new + YELLOW = new + BLUE = new + MAGENTA = new + CYAN = new + WHITE = new + LIGHT_BLACK = new + LIGHT_RED = new + LIGHT_GREEN = new + LIGHT_YELLOW = new + LIGHT_BLUE = new + LIGHT_MAGENTA = new + LIGHT_CYAN = new + LIGHT_WHITE = new + end + + # source://spoom//lib/spoom/colors.rb#32 + sig { returns(::String) } + def ansi_code; end +end + +# source://spoom//lib/spoom/colors.rb#37 +module Spoom::Colorize + # source://spoom//lib/spoom/colors.rb#41 + sig { params(string: ::String, color: ::Spoom::Color).returns(::String) } + def set_color(string, *color); end +end + +# An abstraction to a Ruby project context +# +# A context maps to a directory in the file system. +# It is used to manipulate files and run commands in the context of this directory. +# +# source://spoom//lib/spoom/context/bundle.rb#5 +class Spoom::Context + include ::Spoom::Context::Bundle + include ::Spoom::Context::Exec + include ::Spoom::Context::FileSystem + include ::Spoom::Context::Git + include ::Spoom::Context::Sorbet + + # Create a new context about `absolute_path` + # + # The directory will not be created if it doesn't exist. + # Call `#make!` to create it. + # + # source://spoom//lib/spoom/context.rb#51 + sig { params(absolute_path: ::String).void } + def initialize(absolute_path); end + + # The absolute path to the directory this context is about + # + # source://spoom//lib/spoom/context.rb#44 + sig { returns(::String) } + def absolute_path; end + + class << self + # Create a new context in the system's temporary directory + # + # `name` is used as prefix to the temporary directory name. + # The directory will be created if it doesn't exist. + # + # source://spoom//lib/spoom/context.rb#37 + sig { params(name: T.nilable(::String)).returns(T.attached_class) } + def mktmp!(name = T.unsafe(nil)); end + end +end + +# Bundle features for a context +# +# source://spoom//lib/spoom/context/bundle.rb#7 +module Spoom::Context::Bundle + requires_ancestor { Spoom::Context } + + # Run a command with `bundle` in this context directory + # + # source://spoom//lib/spoom/context/bundle.rb#33 + sig { params(command: ::String, version: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } + def bundle(command, version: T.unsafe(nil), capture_err: T.unsafe(nil)); end + + # Run a command `bundle exec` in this context directory + # + # source://spoom//lib/spoom/context/bundle.rb#46 + sig { params(command: ::String, version: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } + def bundle_exec(command, version: T.unsafe(nil), capture_err: T.unsafe(nil)); end + + # Run `bundle install` in this context directory + # + # source://spoom//lib/spoom/context/bundle.rb#40 + sig { params(version: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } + def bundle_install!(version: T.unsafe(nil), capture_err: T.unsafe(nil)); end + + # Get `gem` version from the `Gemfile.lock` content + # + # Returns `nil` if `gem` cannot be found in the Gemfile. + # + # source://spoom//lib/spoom/context/bundle.rb#62 + sig { params(gem: ::String).returns(T.nilable(::Gem::Version)) } + def gem_version_from_gemfile_lock(gem); end + + # source://spoom//lib/spoom/context/bundle.rb#51 + sig { returns(T::Hash[::String, ::Bundler::LazySpecification]) } + def gemfile_lock_specs; end + + # Read the contents of the Gemfile in this context directory + # + # source://spoom//lib/spoom/context/bundle.rb#15 + sig { returns(T.nilable(::String)) } + def read_gemfile; end + + # Read the contents of the Gemfile.lock in this context directory + # + # source://spoom//lib/spoom/context/bundle.rb#21 + sig { returns(T.nilable(::String)) } + def read_gemfile_lock; end + + # Set the `contents` of the Gemfile in this context directory + # + # source://spoom//lib/spoom/context/bundle.rb#27 + sig { params(contents: ::String, append: T::Boolean).void } + def write_gemfile!(contents, append: T.unsafe(nil)); end +end + +# Execution features for a context +# +# source://spoom//lib/spoom/context/exec.rb#27 +module Spoom::Context::Exec + requires_ancestor { Spoom::Context } + + # Run a command in this context directory + # + # source://spoom//lib/spoom/context/exec.rb#35 + sig { params(command: ::String, capture_err: T::Boolean).returns(::Spoom::ExecResult) } + def exec(command, capture_err: T.unsafe(nil)); end +end + +# File System features for a context +# +# source://spoom//lib/spoom/context/file_system.rb#7 +module Spoom::Context::FileSystem + requires_ancestor { Spoom::Context } + + # Returns the absolute path to `relative_path` in the context's directory + # + # source://spoom//lib/spoom/context/file_system.rb#15 + sig { params(relative_path: ::String).returns(::String) } + def absolute_path_to(relative_path); end + + # source://spoom//lib/spoom/context/file_system.rb#53 + sig do + params( + allow_extensions: T::Array[::String], + allow_mime_types: T::Array[::String], + exclude_patterns: T::Array[::String] + ).returns(T::Array[::String]) + end + def collect_files(allow_extensions: T.unsafe(nil), allow_mime_types: T.unsafe(nil), exclude_patterns: T.unsafe(nil)); end + + # Delete this context and its content + # + # Warning: it will `rm -rf` the context directory on the file system. + # + # source://spoom//lib/spoom/context/file_system.rb#105 + sig { void } + def destroy!; end + + # Does the context directory at `absolute_path` exist and is a directory? + # + # source://spoom//lib/spoom/context/file_system.rb#21 + sig { returns(T::Boolean) } + def exist?; end + + # Does `relative_path` point to an existing file in this context directory? + # + # source://spoom//lib/spoom/context/file_system.rb#65 + sig { params(relative_path: ::String).returns(T::Boolean) } + def file?(relative_path); end + + # List all files in this context matching `pattern` + # + # source://spoom//lib/spoom/context/file_system.rb#34 + sig { params(pattern: ::String).returns(T::Array[::String]) } + def glob(pattern = T.unsafe(nil)); end + + # List all files at the top level of this context directory + # + # source://spoom//lib/spoom/context/file_system.rb#42 + sig { returns(T::Array[::String]) } + def list; end + + # Create the context directory at `absolute_path` + # + # source://spoom//lib/spoom/context/file_system.rb#27 + sig { void } + def mkdir!; end + + # Move the file or directory from `from_relative_path` to `to_relative_path` + # + # source://spoom//lib/spoom/context/file_system.rb#95 + sig { params(from_relative_path: ::String, to_relative_path: ::String).void } + def move!(from_relative_path, to_relative_path); end + + # Return the contents of the file at `relative_path` in this context directory + # + # Will raise if the file doesn't exist. + # + # source://spoom//lib/spoom/context/file_system.rb#73 + sig { params(relative_path: ::String).returns(::String) } + def read(relative_path); end + + # Remove the path at `relative_path` (recursive + force) in this context directory + # + # source://spoom//lib/spoom/context/file_system.rb#89 + sig { params(relative_path: ::String).void } + def remove!(relative_path); end + + # Write `contents` in the file at `relative_path` in this context directory + # + # Append to the file if `append` is true. + # + # source://spoom//lib/spoom/context/file_system.rb#81 + sig { params(relative_path: ::String, contents: ::String, append: T::Boolean).void } + def write!(relative_path, contents = T.unsafe(nil), append: T.unsafe(nil)); end +end + +# Git features for a context +# +# source://spoom//lib/spoom/context/git.rb#35 +module Spoom::Context::Git + requires_ancestor { Spoom::Context } + + # Run a command prefixed by `git` in this context directory + # + # source://spoom//lib/spoom/context/git.rb#43 + sig { params(command: ::String).returns(::Spoom::ExecResult) } + def git(command); end + + # Run `git checkout` in this context directory + # + # source://spoom//lib/spoom/context/git.rb#62 + sig { params(ref: ::String).returns(::Spoom::ExecResult) } + def git_checkout!(ref: T.unsafe(nil)); end + + # Run `git checkout -b ` in this context directory + # + # source://spoom//lib/spoom/context/git.rb#68 + sig { params(branch_name: ::String, ref: T.nilable(::String)).returns(::Spoom::ExecResult) } + def git_checkout_new_branch!(branch_name, ref: T.unsafe(nil)); end + + # Run `git add . && git commit` in this context directory + # + # source://spoom//lib/spoom/context/git.rb#78 + sig { params(message: ::String, time: ::Time, allow_empty: T::Boolean).returns(::Spoom::ExecResult) } + def git_commit!(message: T.unsafe(nil), time: T.unsafe(nil), allow_empty: T.unsafe(nil)); end + + # Get the current git branch in this context directory + # + # source://spoom//lib/spoom/context/git.rb#89 + sig { returns(T.nilable(::String)) } + def git_current_branch; end + + # Run `git diff` in this context directory + # + # source://spoom//lib/spoom/context/git.rb#98 + sig { params(arg: ::String).returns(::Spoom::ExecResult) } + def git_diff(*arg); end + + # Run `git init` in this context directory + # + # Warning: passing a branch will run `git init -b ` which is only available in git 2.28+. + # In older versions, use `git_init!` followed by `git("checkout -b ")`. + # + # source://spoom//lib/spoom/context/git.rb#52 + sig { params(branch: T.nilable(::String)).returns(::Spoom::ExecResult) } + def git_init!(branch: T.unsafe(nil)); end + + # Get the last commit in the currently checked out branch + # + # source://spoom//lib/spoom/context/git.rb#104 + sig { params(short_sha: T::Boolean).returns(T.nilable(::Spoom::Git::Commit)) } + def git_last_commit(short_sha: T.unsafe(nil)); end + + # source://spoom//lib/spoom/context/git.rb#115 + sig { params(arg: ::String).returns(::Spoom::ExecResult) } + def git_log(*arg); end + + # Run `git push ` in this context directory + # + # source://spoom//lib/spoom/context/git.rb#121 + sig { params(remote: ::String, ref: ::String, force: T::Boolean).returns(::Spoom::ExecResult) } + def git_push!(remote, ref, force: T.unsafe(nil)); end + + # source://spoom//lib/spoom/context/git.rb#126 + sig { params(arg: ::String).returns(::Spoom::ExecResult) } + def git_show(*arg); end + + # Is there uncommitted changes in this context directory? + # + # source://spoom//lib/spoom/context/git.rb#132 + sig { params(path: ::String).returns(T::Boolean) } + def git_workdir_clean?(path: T.unsafe(nil)); end +end + +# Sorbet features for a context +# +# source://spoom//lib/spoom/context/sorbet.rb#7 +module Spoom::Context::Sorbet + requires_ancestor { Spoom::Context } + + # Does this context has a `sorbet/config` file? + # + # source://spoom//lib/spoom/context/sorbet.rb#119 + sig { returns(T::Boolean) } + def has_sorbet_config?; end + + # Read the strictness sigil from the file at `relative_path` (returns `nil` if no sigil) + # + # source://spoom//lib/spoom/context/sorbet.rb#142 + sig { params(relative_path: ::String).returns(T.nilable(::String)) } + def read_file_strictness(relative_path); end + + # Read the contents of `sorbet/config` in this context directory + # + # source://spoom//lib/spoom/context/sorbet.rb#130 + sig { returns(::String) } + def read_sorbet_config; end + + # source://spoom//lib/spoom/context/sorbet.rb#124 + sig { returns(::Spoom::Sorbet::Config) } + def sorbet_config; end + + # Get the commit introducing the `sorbet/config` file + # + # source://spoom//lib/spoom/context/sorbet.rb#148 + sig { returns(T.nilable(::Spoom::Git::Commit)) } + def sorbet_intro_commit; end + + # Get the commit removing the `sorbet/config` file + # + # source://spoom//lib/spoom/context/sorbet.rb#160 + sig { returns(T.nilable(::Spoom::Git::Commit)) } + def sorbet_removal_commit; end + + # Run `bundle exec srb` in this context directory + # + # source://spoom//lib/spoom/context/sorbet.rb#15 + sig { params(arg: ::String, sorbet_bin: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } + def srb(*arg, sorbet_bin: T.unsafe(nil), capture_err: T.unsafe(nil)); end + + # List all files typechecked by Sorbet from its `config` + # + # source://spoom//lib/spoom/context/sorbet.rb#65 + sig { params(with_config: T.nilable(::Spoom::Sorbet::Config), include_rbis: T::Boolean).returns(T::Array[::String]) } + def srb_files(with_config: T.unsafe(nil), include_rbis: T.unsafe(nil)); end + + # List all files typechecked by Sorbet from its `config` that matches `strictness` + # + # source://spoom//lib/spoom/context/sorbet.rb#104 + sig do + params( + strictness: ::String, + with_config: T.nilable(::Spoom::Sorbet::Config), + include_rbis: T::Boolean + ).returns(T::Array[::String]) + end + def srb_files_with_strictness(strictness, with_config: T.unsafe(nil), include_rbis: T.unsafe(nil)); end + + # source://spoom//lib/spoom/context/sorbet.rb#45 + sig do + params( + arg: ::String, + sorbet_bin: T.nilable(::String), + capture_err: T::Boolean + ).returns(T.nilable(T::Hash[::String, ::Integer])) + end + def srb_metrics(*arg, sorbet_bin: T.unsafe(nil), capture_err: T.unsafe(nil)); end + + # source://spoom//lib/spoom/context/sorbet.rb#33 + sig { params(arg: ::String, sorbet_bin: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } + def srb_tc(*arg, sorbet_bin: T.unsafe(nil), capture_err: T.unsafe(nil)); end + + # source://spoom//lib/spoom/context/sorbet.rb#110 + sig { params(arg: ::String, sorbet_bin: T.nilable(::String), capture_err: T::Boolean).returns(T.nilable(::String)) } + def srb_version(*arg, sorbet_bin: T.unsafe(nil), capture_err: T.unsafe(nil)); end + + # Set the `contents` of `sorbet/config` in this context directory + # + # source://spoom//lib/spoom/context/sorbet.rb#136 + sig { params(contents: ::String, append: T::Boolean).void } + def write_sorbet_config!(contents, append: T.unsafe(nil)); end +end + +# source://spoom//lib/spoom/coverage/snapshot.rb#5 +module Spoom::Coverage + class << self + # source://spoom//lib/spoom/coverage.rb#103 + sig { params(context: ::Spoom::Context).returns(::Spoom::FileTree) } + def file_tree(context); end + + # source://spoom//lib/spoom/coverage.rb#83 + sig do + params( + context: ::Spoom::Context, + snapshots: T::Array[::Spoom::Coverage::Snapshot], + palette: ::Spoom::Coverage::D3::ColorPalette + ).returns(::Spoom::Coverage::Report) + end + def report(context, snapshots, palette:); end + + # source://spoom//lib/spoom/coverage.rb#16 + sig do + params( + context: ::Spoom::Context, + rbi: T::Boolean, + sorbet_bin: T.nilable(::String) + ).returns(::Spoom::Coverage::Snapshot) + end + def snapshot(context, rbi: T.unsafe(nil), sorbet_bin: T.unsafe(nil)); end + end +end + +# source://spoom//lib/spoom/coverage/report.rb#88 +module Spoom::Coverage::Cards; end + +# source://spoom//lib/spoom/coverage/report.rb#89 +class Spoom::Coverage::Cards::Card < ::Spoom::Coverage::Template + # source://spoom//lib/spoom/coverage/report.rb#98 + sig { params(template: ::String, title: T.nilable(::String), body: T.nilable(::String)).void } + def initialize(template: T.unsafe(nil), title: T.unsafe(nil), body: T.unsafe(nil)); end + + # @return [String, nil] + # + # source://spoom//lib/spoom/coverage/report.rb#95 + def body; end + + # source://spoom//lib/spoom/coverage/report.rb#95 + sig { returns(T.nilable(::String)) } + def title; end +end + +# source://spoom//lib/spoom/coverage/report.rb#92 +Spoom::Coverage::Cards::Card::TEMPLATE = T.let(T.unsafe(nil), String) + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom//lib/spoom/coverage/report.rb#105 +class Spoom::Coverage::Cards::Erb < ::Spoom::Coverage::Cards::Card + abstract! + + # source://spoom//lib/spoom/coverage/report.rb#112 + sig { void } + def initialize; end + + # @abstract + # + # source://spoom//lib/spoom/coverage/report.rb#120 + sig { abstract.returns(::String) } + def erb; end + + # source://spoom//lib/spoom/coverage/report.rb#115 + sig { override.returns(::String) } + def html; end +end + +# source://spoom//lib/spoom/coverage/report.rb#153 +class Spoom::Coverage::Cards::Map < ::Spoom::Coverage::Cards::Card + # source://spoom//lib/spoom/coverage/report.rb#164 + sig do + params( + file_tree: ::Spoom::FileTree, + nodes_strictnesses: T::Hash[::Spoom::FileTree::Node, T.nilable(::String)], + nodes_strictness_scores: T::Hash[::Spoom::FileTree::Node, ::Float], + title: ::String + ).void + end + def initialize(file_tree:, nodes_strictnesses:, nodes_strictness_scores:, title: T.unsafe(nil)); end +end + +# source://spoom//lib/spoom/coverage/report.rb#123 +class Spoom::Coverage::Cards::Snapshot < ::Spoom::Coverage::Cards::Card + # source://spoom//lib/spoom/coverage/report.rb#132 + sig { params(snapshot: ::Spoom::Coverage::Snapshot, title: ::String).void } + def initialize(snapshot:, title: T.unsafe(nil)); end + + # source://spoom//lib/spoom/coverage/report.rb#143 + sig { returns(::Spoom::Coverage::D3::Pie::Calls) } + def pie_calls; end + + # source://spoom//lib/spoom/coverage/report.rb#138 + sig { returns(::Spoom::Coverage::D3::Pie::Sigils) } + def pie_sigils; end + + # source://spoom//lib/spoom/coverage/report.rb#148 + sig { returns(::Spoom::Coverage::D3::Pie::Sigs) } + def pie_sigs; end + + # source://spoom//lib/spoom/coverage/report.rb#129 + sig { returns(::Spoom::Coverage::Snapshot) } + def snapshot; end +end + +# source://spoom//lib/spoom/coverage/report.rb#126 +Spoom::Coverage::Cards::Snapshot::TEMPLATE = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/coverage/report.rb#240 +class Spoom::Coverage::Cards::SorbetIntro < ::Spoom::Coverage::Cards::Erb + # source://spoom//lib/spoom/coverage/report.rb#244 + sig { params(sorbet_intro_commit: T.nilable(::String), sorbet_intro_date: T.nilable(::Time)).void } + def initialize(sorbet_intro_commit: T.unsafe(nil), sorbet_intro_date: T.unsafe(nil)); end + + # source://spoom//lib/spoom/coverage/report.rb#250 + sig { override.returns(::String) } + def erb; end +end + +# source://spoom//lib/spoom/coverage/report.rb#177 +class Spoom::Coverage::Cards::Timeline < ::Spoom::Coverage::Cards::Card + # source://spoom//lib/spoom/coverage/report.rb#181 + sig { params(title: ::String, timeline: ::Spoom::Coverage::D3::Timeline).void } + def initialize(title:, timeline:); end +end + +# source://spoom//lib/spoom/coverage/report.rb#194 +class Spoom::Coverage::Cards::Timeline::Calls < ::Spoom::Coverage::Cards::Timeline + # source://spoom//lib/spoom/coverage/report.rb#198 + sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } + def initialize(snapshots:, title: T.unsafe(nil)); end +end + +# source://spoom//lib/spoom/coverage/report.rb#212 +class Spoom::Coverage::Cards::Timeline::RBIs < ::Spoom::Coverage::Cards::Timeline + # source://spoom//lib/spoom/coverage/report.rb#216 + sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } + def initialize(snapshots:, title: T.unsafe(nil)); end +end + +# source://spoom//lib/spoom/coverage/report.rb#230 +class Spoom::Coverage::Cards::Timeline::Runtimes < ::Spoom::Coverage::Cards::Timeline + # source://spoom//lib/spoom/coverage/report.rb#234 + sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } + def initialize(snapshots:, title: T.unsafe(nil)); end +end + +# source://spoom//lib/spoom/coverage/report.rb#185 +class Spoom::Coverage::Cards::Timeline::Sigils < ::Spoom::Coverage::Cards::Timeline + # source://spoom//lib/spoom/coverage/report.rb#189 + sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } + def initialize(snapshots:, title: T.unsafe(nil)); end +end + +# source://spoom//lib/spoom/coverage/report.rb#203 +class Spoom::Coverage::Cards::Timeline::Sigs < ::Spoom::Coverage::Cards::Timeline + # source://spoom//lib/spoom/coverage/report.rb#207 + sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } + def initialize(snapshots:, title: T.unsafe(nil)); end +end + +# source://spoom//lib/spoom/coverage/report.rb#221 +class Spoom::Coverage::Cards::Timeline::Versions < ::Spoom::Coverage::Cards::Timeline + # source://spoom//lib/spoom/coverage/report.rb#225 + sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } + def initialize(snapshots:, title: T.unsafe(nil)); end +end + +# source://spoom//lib/spoom/coverage/d3/base.rb#6 +module Spoom::Coverage::D3 + class << self + # source://spoom//lib/spoom/coverage/d3.rb#61 + sig { params(palette: ::Spoom::Coverage::D3::ColorPalette).returns(::String) } + def header_script(palette); end + + # source://spoom//lib/spoom/coverage/d3.rb#21 + sig { returns(::String) } + def header_style; end + end +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom//lib/spoom/coverage/d3/base.rb#7 +class Spoom::Coverage::D3::Base + abstract! + + # source://spoom//lib/spoom/coverage/d3/base.rb#17 + sig { params(id: ::String, data: T.untyped).void } + def initialize(id, data); end + + # source://spoom//lib/spoom/coverage/d3/base.rb#37 + sig { returns(::String) } + def html; end + + # source://spoom//lib/spoom/coverage/d3/base.rb#14 + sig { returns(::String) } + def id; end + + # @abstract + # + # source://spoom//lib/spoom/coverage/d3/base.rb#50 + sig { abstract.returns(::String) } + def script; end + + # source://spoom//lib/spoom/coverage/d3/base.rb#45 + sig { returns(::String) } + def tooltip; end + + class << self + # source://spoom//lib/spoom/coverage/d3/base.rb#31 + sig { returns(::String) } + def header_script; end + + # source://spoom//lib/spoom/coverage/d3/base.rb#26 + sig { returns(::String) } + def header_style; end + end +end + +# source://spoom//lib/spoom/coverage/d3.rb#12 +Spoom::Coverage::D3::COLOR_FALSE = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/coverage/d3.rb#11 +Spoom::Coverage::D3::COLOR_IGNORE = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/coverage/d3.rb#14 +Spoom::Coverage::D3::COLOR_STRICT = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/coverage/d3.rb#15 +Spoom::Coverage::D3::COLOR_STRONG = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/coverage/d3.rb#13 +Spoom::Coverage::D3::COLOR_TRUE = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/coverage/d3/circle_map.rb#9 +class Spoom::Coverage::D3::CircleMap < ::Spoom::Coverage::D3::Base + # source://spoom//lib/spoom/coverage/d3/circle_map.rb#59 + sig { override.returns(::String) } + def script; end + + class << self + # source://spoom//lib/spoom/coverage/d3/circle_map.rb#40 + sig { returns(::String) } + def header_script; end + + # source://spoom//lib/spoom/coverage/d3/circle_map.rb#14 + sig { returns(::String) } + def header_style; end + end +end + +# source://spoom//lib/spoom/coverage/d3/circle_map.rb#148 +class Spoom::Coverage::D3::CircleMap::Sigils < ::Spoom::Coverage::D3::CircleMap + # source://spoom//lib/spoom/coverage/d3/circle_map.rb#159 + sig do + params( + id: ::String, + file_tree: ::Spoom::FileTree, + nodes_strictnesses: T::Hash[::Spoom::FileTree::Node, T.nilable(::String)], + nodes_scores: T::Hash[::Spoom::FileTree::Node, ::Float] + ).void + end + def initialize(id, file_tree, nodes_strictnesses, nodes_scores); end + + # source://spoom//lib/spoom/coverage/d3/circle_map.rb#166 + sig { params(node: ::Spoom::FileTree::Node).returns(T::Hash[::Symbol, T.untyped]) } + def tree_node_to_json(node); end +end + +# source://spoom//lib/spoom/coverage/d3.rb#103 +class Spoom::Coverage::D3::ColorPalette < ::T::Struct + prop :ignore, ::String + prop :false, ::String + prop :true, ::String + prop :strict, ::String + prop :strong, ::String + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom//lib/spoom/coverage/d3/pie.rb#9 +class Spoom::Coverage::D3::Pie < ::Spoom::Coverage::D3::Base + abstract! + + # source://spoom//lib/spoom/coverage/d3/pie.rb#16 + sig { params(id: ::String, title: ::String, data: T.untyped).void } + def initialize(id, title, data); end + + # source://spoom//lib/spoom/coverage/d3/pie.rb#56 + sig { override.returns(::String) } + def script; end + + class << self + # source://spoom//lib/spoom/coverage/d3/pie.rb#43 + sig { returns(::String) } + def header_script; end + + # source://spoom//lib/spoom/coverage/d3/pie.rb#25 + sig { returns(::String) } + def header_style; end + end +end + +# source://spoom//lib/spoom/coverage/d3/pie.rb#141 +class Spoom::Coverage::D3::Pie::Calls < ::Spoom::Coverage::D3::Pie + # source://spoom//lib/spoom/coverage/d3/pie.rb#145 + sig { params(id: ::String, title: ::String, snapshot: ::Spoom::Coverage::Snapshot).void } + def initialize(id, title, snapshot); end + + # source://spoom//lib/spoom/coverage/d3/pie.rb#150 + sig { override.returns(::String) } + def tooltip; end +end + +# source://spoom//lib/spoom/coverage/d3/pie.rb#123 +class Spoom::Coverage::D3::Pie::Sigils < ::Spoom::Coverage::D3::Pie + # source://spoom//lib/spoom/coverage/d3/pie.rb#127 + sig { params(id: ::String, title: ::String, snapshot: ::Spoom::Coverage::Snapshot).void } + def initialize(id, title, snapshot); end + + # source://spoom//lib/spoom/coverage/d3/pie.rb#132 + sig { override.returns(::String) } + def tooltip; end +end + +# source://spoom//lib/spoom/coverage/d3/pie.rb#159 +class Spoom::Coverage::D3::Pie::Sigs < ::Spoom::Coverage::D3::Pie + # source://spoom//lib/spoom/coverage/d3/pie.rb#163 + sig { params(id: ::String, title: ::String, snapshot: ::Spoom::Coverage::Snapshot).void } + def initialize(id, title, snapshot); end + + # source://spoom//lib/spoom/coverage/d3/pie.rb#172 + sig { override.returns(::String) } + def tooltip; end +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom//lib/spoom/coverage/d3/timeline.rb#9 +class Spoom::Coverage::D3::Timeline < ::Spoom::Coverage::D3::Base + abstract! + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#16 + sig { params(id: ::String, data: T.untyped, keys: T::Array[::String]).void } + def initialize(id, data, keys); end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#187 + sig { params(y: ::String, color: ::String, curve: ::String).returns(::String) } + def area(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#203 + sig { params(y: ::String, color: ::String, curve: ::String).returns(::String) } + def line(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end + + # @abstract + # + # source://spoom//lib/spoom/coverage/d3/timeline.rb#126 + sig { abstract.returns(::String) } + def plot; end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#217 + sig { params(y: ::String).returns(::String) } + def points(y:); end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#101 + sig { override.returns(::String) } + def script; end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#129 + sig { returns(::String) } + def x_scale; end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#145 + sig { returns(::String) } + def x_ticks; end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#158 + sig { params(min: ::String, max: ::String, ticks: ::String).returns(::String) } + def y_scale(min:, max:, ticks:); end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#174 + sig { params(ticks: ::String, format: ::String, padding: ::Integer).returns(::String) } + def y_ticks(ticks:, format:, padding:); end + + class << self + # source://spoom//lib/spoom/coverage/d3/timeline.rb#79 + sig { returns(::String) } + def header_script; end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#25 + sig { returns(::String) } + def header_style; end + end +end + +# source://spoom//lib/spoom/coverage/d3/timeline.rb#448 +class Spoom::Coverage::D3::Timeline::Calls < ::Spoom::Coverage::D3::Timeline::Stacked + # source://spoom//lib/spoom/coverage/d3/timeline.rb#452 + sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } + def initialize(id, snapshots); end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#466 + sig { override.returns(::String) } + def tooltip; end +end + +# source://spoom//lib/spoom/coverage/d3/timeline.rb#505 +class Spoom::Coverage::D3::Timeline::RBIs < ::Spoom::Coverage::D3::Timeline::Stacked + # source://spoom//lib/spoom/coverage/d3/timeline.rb#509 + sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } + def initialize(id, snapshots); end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#577 + sig { override.params(y: ::String, color: ::String, curve: ::String).returns(::String) } + def line(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#617 + sig { override.returns(::String) } + def plot; end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#537 + sig { override.returns(::String) } + def script; end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#523 + sig { override.returns(::String) } + def tooltip; end +end + +# source://spoom//lib/spoom/coverage/d3/timeline.rb#282 +class Spoom::Coverage::D3::Timeline::Runtimes < ::Spoom::Coverage::D3::Timeline + # source://spoom//lib/spoom/coverage/d3/timeline.rb#286 + sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } + def initialize(id, snapshots); end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#311 + sig { override.returns(::String) } + def plot; end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#298 + sig { override.returns(::String) } + def tooltip; end +end + +# source://spoom//lib/spoom/coverage/d3/timeline.rb#421 +class Spoom::Coverage::D3::Timeline::Sigils < ::Spoom::Coverage::D3::Timeline::Stacked + # source://spoom//lib/spoom/coverage/d3/timeline.rb#425 + sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } + def initialize(id, snapshots); end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#439 + sig { override.returns(::String) } + def tooltip; end +end + +# source://spoom//lib/spoom/coverage/d3/timeline.rb#475 +class Spoom::Coverage::D3::Timeline::Sigs < ::Spoom::Coverage::D3::Timeline::Stacked + # source://spoom//lib/spoom/coverage/d3/timeline.rb#479 + sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } + def initialize(id, snapshots); end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#496 + sig { override.returns(::String) } + def tooltip; end +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom//lib/spoom/coverage/d3/timeline.rb#329 +class Spoom::Coverage::D3::Timeline::Stacked < ::Spoom::Coverage::D3::Timeline + abstract! + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#388 + sig { override.params(y: ::String, color: ::String, curve: ::String).returns(::String) } + def line(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#377 + sig { override.returns(::String) } + def plot; end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#336 + sig { override.returns(::String) } + def script; end +end + +# source://spoom//lib/spoom/coverage/d3/timeline.rb#232 +class Spoom::Coverage::D3::Timeline::Versions < ::Spoom::Coverage::D3::Timeline + # source://spoom//lib/spoom/coverage/d3/timeline.rb#236 + sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } + def initialize(id, snapshots); end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#263 + sig { override.returns(::String) } + def plot; end + + # source://spoom//lib/spoom/coverage/d3/timeline.rb#249 + sig { override.returns(::String) } + def tooltip; end +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom//lib/spoom/coverage/report.rb#38 +class Spoom::Coverage::Page < ::Spoom::Coverage::Template + abstract! + + # source://spoom//lib/spoom/coverage/report.rb#53 + sig { params(title: ::String, palette: ::Spoom::Coverage::D3::ColorPalette, template: ::String).void } + def initialize(title:, palette:, template: T.unsafe(nil)); end + + # source://spoom//lib/spoom/coverage/report.rb#75 + sig { returns(::String) } + def body_html; end + + # @abstract + # + # source://spoom//lib/spoom/coverage/report.rb#80 + sig { abstract.returns(T::Array[::Spoom::Coverage::Cards::Card]) } + def cards; end + + # source://spoom//lib/spoom/coverage/report.rb#83 + sig { returns(::String) } + def footer_html; end + + # source://spoom//lib/spoom/coverage/report.rb#70 + sig { returns(::String) } + def header_html; end + + # source://spoom//lib/spoom/coverage/report.rb#65 + sig { returns(::String) } + def header_script; end + + # source://spoom//lib/spoom/coverage/report.rb#60 + sig { returns(::String) } + def header_style; end + + # source://spoom//lib/spoom/coverage/report.rb#50 + sig { returns(::Spoom::Coverage::D3::ColorPalette) } + def palette; end + + # source://spoom//lib/spoom/coverage/report.rb#47 + sig { returns(::String) } + def title; end +end + +# source://spoom//lib/spoom/coverage/report.rb#44 +Spoom::Coverage::Page::TEMPLATE = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/coverage/report.rb#261 +class Spoom::Coverage::Report < ::Spoom::Coverage::Page + # source://spoom//lib/spoom/coverage/report.rb#276 + sig do + params( + project_name: ::String, + palette: ::Spoom::Coverage::D3::ColorPalette, + snapshots: T::Array[::Spoom::Coverage::Snapshot], + file_tree: ::Spoom::FileTree, + nodes_strictnesses: T::Hash[::Spoom::FileTree::Node, T.nilable(::String)], + nodes_strictness_scores: T::Hash[::Spoom::FileTree::Node, ::Float], + sorbet_intro_commit: T.nilable(::String), + sorbet_intro_date: T.nilable(::Time) + ).void + end + def initialize(project_name:, palette:, snapshots:, file_tree:, nodes_strictnesses:, nodes_strictness_scores:, sorbet_intro_commit: T.unsafe(nil), sorbet_intro_date: T.unsafe(nil)); end + + # source://spoom//lib/spoom/coverage/report.rb#308 + sig { override.returns(T::Array[::Spoom::Coverage::Cards::Card]) } + def cards; end + + # source://spoom//lib/spoom/coverage/report.rb#297 + sig { override.returns(::String) } + def header_html; end +end + +# source://spoom//lib/spoom/coverage/snapshot.rb#6 +class Spoom::Coverage::Snapshot < ::T::Struct + prop :timestamp, ::Integer, default: T.unsafe(nil) + prop :version_static, T.nilable(::String), default: T.unsafe(nil) + prop :version_runtime, T.nilable(::String), default: T.unsafe(nil) + prop :duration, ::Integer, default: T.unsafe(nil) + prop :commit_sha, T.nilable(::String), default: T.unsafe(nil) + prop :commit_timestamp, T.nilable(::Integer), default: T.unsafe(nil) + prop :files, ::Integer, default: T.unsafe(nil) + prop :rbi_files, ::Integer, default: T.unsafe(nil) + prop :modules, ::Integer, default: T.unsafe(nil) + prop :classes, ::Integer, default: T.unsafe(nil) + prop :singleton_classes, ::Integer, default: T.unsafe(nil) + prop :methods_without_sig, ::Integer, default: T.unsafe(nil) + prop :methods_with_sig, ::Integer, default: T.unsafe(nil) + prop :calls_untyped, ::Integer, default: T.unsafe(nil) + prop :calls_typed, ::Integer, default: T.unsafe(nil) + prop :sigils, T::Hash[::String, ::Integer], default: T.unsafe(nil) + prop :methods_with_sig_excluding_rbis, ::Integer, default: T.unsafe(nil) + prop :methods_without_sig_excluding_rbis, ::Integer, default: T.unsafe(nil) + prop :sigils_excluding_rbis, T::Hash[::String, ::Integer], default: T.unsafe(nil) + + # source://spoom//lib/spoom/coverage/snapshot.rb#33 + sig { params(out: T.any(::IO, ::StringIO), colors: T::Boolean, indent_level: ::Integer).void } + def print(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil)); end + + # source://spoom//lib/spoom/coverage/snapshot.rb#39 + sig { params(arg: T.untyped).returns(::String) } + def to_json(*arg); end + + class << self + # source://spoom//lib/spoom/coverage/snapshot.rb#47 + sig { params(json: ::String).returns(::Spoom::Coverage::Snapshot) } + def from_json(json); end + + # source://spoom//lib/spoom/coverage/snapshot.rb#52 + sig { params(obj: T::Hash[::String, T.untyped]).returns(::Spoom::Coverage::Snapshot) } + def from_obj(obj); end + + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# The strictness name as found in the Sorbet metrics file +# +# source://spoom//lib/spoom/coverage/snapshot.rb#30 +Spoom::Coverage::Snapshot::STRICTNESSES = T.let(T.unsafe(nil), Array) + +# source://spoom//lib/spoom/coverage/snapshot.rb#95 +class Spoom::Coverage::SnapshotPrinter < ::Spoom::Printer + # source://spoom//lib/spoom/coverage/snapshot.rb#99 + sig { params(snapshot: ::Spoom::Coverage::Snapshot).void } + def print_snapshot(snapshot); end + + private + + # source://spoom//lib/spoom/coverage/snapshot.rb#158 + sig { params(value: T.nilable(::Integer), total: T.nilable(::Integer)).returns(::String) } + def percent(value, total); end + + # source://spoom//lib/spoom/coverage/snapshot.rb#147 + sig { params(hash: T::Hash[::String, ::Integer], total: ::Integer).void } + def print_map(hash, total); end +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom//lib/spoom/coverage/report.rb#10 +class Spoom::Coverage::Template + abstract! + + # Create a new template from an Erb file path + # + # source://spoom//lib/spoom/coverage/report.rb#18 + sig { params(template: ::String).void } + def initialize(template:); end + + # source://spoom//lib/spoom/coverage/report.rb#23 + sig { returns(::String) } + def erb; end + + # source://spoom//lib/spoom/coverage/report.rb#33 + sig { returns(::Binding) } + def get_binding; end + + # source://spoom//lib/spoom/coverage/report.rb#28 + sig { returns(::String) } + def html; end +end + +# source://spoom//lib/spoom/deadcode/erb.rb#27 +module Spoom::Deadcode + class << self + # source://spoom//lib/spoom/deadcode/plugins.rb#75 + sig { params(context: ::Spoom::Context).returns(T::Array[T.class_of(Spoom::Deadcode::Plugins::Base)]) } + def load_custom_plugins(context); end + + # source://spoom//lib/spoom/deadcode/plugins.rb#61 + sig { params(context: ::Spoom::Context).returns(T::Set[T.class_of(Spoom::Deadcode::Plugins::Base)]) } + def plugins_from_gemfile_lock(context); end + end +end + +# source://spoom//lib/spoom/deadcode/plugins.rb#26 +Spoom::Deadcode::DEFAULT_CUSTOM_PLUGINS_PATH = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/deadcode/plugins.rb#28 +Spoom::Deadcode::DEFAULT_PLUGINS = T.let(T.unsafe(nil), Set) + +# A definition is a class, module, method, constant, etc. being defined in the code +# +# source://spoom//lib/spoom/deadcode/definition.rb#7 +class Spoom::Deadcode::Definition < ::T::Struct + const :kind, ::Spoom::Deadcode::Definition::Kind + const :name, ::String + const :full_name, ::String + const :location, ::Spoom::Location + const :status, ::Spoom::Deadcode::Definition::Status, default: T.unsafe(nil) + + # source://spoom//lib/spoom/deadcode/definition.rb#78 + sig { void } + def alive!; end + + # Status + # + # source://spoom//lib/spoom/deadcode/definition.rb#73 + sig { returns(T::Boolean) } + def alive?; end + + # Kind + # + # source://spoom//lib/spoom/deadcode/definition.rb#41 + sig { returns(T::Boolean) } + def attr_reader?; end + + # source://spoom//lib/spoom/deadcode/definition.rb#46 + sig { returns(T::Boolean) } + def attr_writer?; end + + # source://spoom//lib/spoom/deadcode/definition.rb#51 + sig { returns(T::Boolean) } + def class?; end + + # source://spoom//lib/spoom/deadcode/definition.rb#56 + sig { returns(T::Boolean) } + def constant?; end + + # source://spoom//lib/spoom/deadcode/definition.rb#83 + sig { returns(T::Boolean) } + def dead?; end + + # source://spoom//lib/spoom/deadcode/definition.rb#93 + sig { void } + def ignored!; end + + # source://spoom//lib/spoom/deadcode/definition.rb#88 + sig { returns(T::Boolean) } + def ignored?; end + + # source://spoom//lib/spoom/deadcode/definition.rb#61 + sig { returns(T::Boolean) } + def method?; end + + # source://spoom//lib/spoom/deadcode/definition.rb#66 + sig { returns(T::Boolean) } + def module?; end + + # Utils + # + # source://spoom//lib/spoom/deadcode/definition.rb#100 + sig { params(args: T.untyped).returns(::String) } + def to_json(*args); end + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://spoom//lib/spoom/deadcode/definition.rb#10 +class Spoom::Deadcode::Definition::Kind < ::T::Enum + enums do + AttrReader = new + AttrWriter = new + Class = new + Constant = new + Method = new + Module = new + end +end + +# source://spoom//lib/spoom/deadcode/definition.rb#21 +class Spoom::Deadcode::Definition::Status < ::T::Enum + enums do + ALIVE = new + DEAD = new + IGNORED = new + end +end + +# Custom engine to handle ERB templates as used by Rails +# +# source://spoom//lib/spoom/deadcode/erb.rb#29 +class Spoom::Deadcode::ERB < ::Erubi::Engine + # source://spoom//lib/spoom/deadcode/erb.rb#33 + sig { params(input: T.untyped, properties: T.untyped).void } + def initialize(input, properties = T.unsafe(nil)); end + + private + + # source://spoom//lib/spoom/deadcode/erb.rb#83 + sig { override.params(code: T.untyped).void } + def add_code(code); end + + # source://spoom//lib/spoom/deadcode/erb.rb#66 + sig { override.params(indicator: T.untyped, code: T.untyped).void } + def add_expression(indicator, code); end + + # source://spoom//lib/spoom/deadcode/erb.rb#89 + sig { override.params(_: T.untyped).void } + def add_postamble(_); end + + # source://spoom//lib/spoom/deadcode/erb.rb#48 + sig { override.params(text: T.untyped).void } + def add_text(text); end + + # source://spoom//lib/spoom/deadcode/erb.rb#95 + sig { params(src: T.untyped).void } + def flush_newline_if_pending(src); end +end + +# source://spoom//lib/spoom/deadcode/erb.rb#63 +Spoom::Deadcode::ERB::BLOCK_EXPR = T.let(T.unsafe(nil), Regexp) + +# source://spoom//lib/spoom/deadcode/index.rb#6 +class Spoom::Deadcode::Index + # source://spoom//lib/spoom/deadcode/index.rb#29 + sig { params(model: ::Spoom::Model).void } + def initialize(model); end + + # source://spoom//lib/spoom/deadcode/index.rb#219 + sig { returns(T::Array[::Spoom::Deadcode::Definition]) } + def all_definitions; end + + # source://spoom//lib/spoom/deadcode/index.rb#224 + sig { returns(T::Array[::Spoom::Model::Reference]) } + def all_references; end + + # source://spoom//lib/spoom/deadcode/index.rb#99 + sig { params(plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } + def apply_plugins!(plugins); end + + # source://spoom//lib/spoom/deadcode/index.rb#79 + sig { params(definition: ::Spoom::Deadcode::Definition).void } + def define(definition); end + + # source://spoom//lib/spoom/deadcode/index.rb#23 + sig { returns(T::Hash[::String, T::Array[::Spoom::Deadcode::Definition]]) } + def definitions; end + + # Utils + # + # source://spoom//lib/spoom/deadcode/index.rb#214 + sig { params(name: ::String).returns(T::Array[::Spoom::Deadcode::Definition]) } + def definitions_for_name(name); end + + # Mark all definitions having a reference of the same name as `alive` + # + # To be called once all the files have been indexed and all the definitions and references discovered. + # + # source://spoom//lib/spoom/deadcode/index.rb#122 + sig { void } + def finalize!; end + + # source://spoom//lib/spoom/deadcode/index.rb#94 + sig { params(symbol_def: ::Spoom::Model::SymbolDef).void } + def ignore(symbol_def); end + + # source://spoom//lib/spoom/deadcode/index.rb#50 + sig { params(erb: ::String, file: ::String, plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } + def index_erb(erb, file:, plugins: T.unsafe(nil)); end + + # Indexing + # + # source://spoom//lib/spoom/deadcode/index.rb#39 + sig { params(file: ::String, plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } + def index_file(file, plugins: T.unsafe(nil)); end + + # source://spoom//lib/spoom/deadcode/index.rb#55 + sig { params(rb: ::String, file: ::String, plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } + def index_ruby(rb, file:, plugins: T.unsafe(nil)); end + + # source://spoom//lib/spoom/deadcode/index.rb#20 + sig { returns(::Spoom::Model) } + def model; end + + # source://spoom//lib/spoom/deadcode/index.rb#84 + sig { params(name: ::String, location: ::Spoom::Location).void } + def reference_constant(name, location); end + + # source://spoom//lib/spoom/deadcode/index.rb#89 + sig { params(name: ::String, location: ::Spoom::Location).void } + def reference_method(name, location); end + + # source://spoom//lib/spoom/deadcode/index.rb#26 + sig { returns(T::Hash[::String, T::Array[::Spoom::Model::Reference]]) } + def references; end +end + +# source://spoom//lib/spoom/deadcode/index.rb#9 +class Spoom::Deadcode::Index::Error < ::Spoom::Error + # source://spoom//lib/spoom/deadcode/index.rb#13 + sig { params(message: ::String, parent: ::Exception).void } + def initialize(message, parent:); end +end + +# source://spoom//lib/spoom/deadcode/indexer.rb#6 +class Spoom::Deadcode::Indexer < ::Spoom::Visitor + # source://spoom//lib/spoom/deadcode/indexer.rb#16 + sig do + params( + path: ::String, + index: ::Spoom::Deadcode::Index, + plugins: T::Array[::Spoom::Deadcode::Plugins::Base] + ).void + end + def initialize(path, index, plugins: T.unsafe(nil)); end + + # source://spoom//lib/spoom/deadcode/indexer.rb#13 + sig { returns(::Spoom::Deadcode::Index) } + def index; end + + # source://spoom//lib/spoom/deadcode/indexer.rb#10 + sig { returns(::String) } + def path; end + + # Visit + # + # source://spoom//lib/spoom/deadcode/indexer.rb#27 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end +end + +# source://spoom//lib/spoom/deadcode/plugins.rb#36 +Spoom::Deadcode::PLUGINS_FOR_GEM = T.let(T.unsafe(nil), Hash) + +# source://spoom//lib/spoom/deadcode/plugins/base.rb#8 +module Spoom::Deadcode::Plugins; end + +# source://spoom//lib/spoom/deadcode/plugins/action_mailer.rb#7 +class Spoom::Deadcode::Plugins::ActionMailer < ::Spoom::Deadcode::Plugins::Base + # source://spoom//lib/spoom/deadcode/plugins/action_mailer.rb#11 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end +end + +# source://spoom//lib/spoom/deadcode/plugins/action_mailer_preview.rb#7 +class Spoom::Deadcode::Plugins::ActionMailerPreview < ::Spoom::Deadcode::Plugins::Base + # source://spoom//lib/spoom/deadcode/plugins/action_mailer_preview.rb#13 + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end +end + +# source://spoom//lib/spoom/deadcode/plugins/actionpack.rb#7 +class Spoom::Deadcode::Plugins::ActionPack < ::Spoom::Deadcode::Plugins::Base + # source://spoom//lib/spoom/deadcode/plugins/actionpack.rb#31 + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end + + # source://spoom//lib/spoom/deadcode/plugins/actionpack.rb#39 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end +end + +# source://spoom//lib/spoom/deadcode/plugins/actionpack.rb#12 +Spoom::Deadcode::Plugins::ActionPack::CALLBACKS = T.let(T.unsafe(nil), Array) + +# source://spoom//lib/spoom/deadcode/plugins/active_job.rb#7 +class Spoom::Deadcode::Plugins::ActiveJob < ::Spoom::Deadcode::Plugins::Base; end + +# source://spoom//lib/spoom/deadcode/plugins/active_model.rb#7 +class Spoom::Deadcode::Plugins::ActiveModel < ::Spoom::Deadcode::Plugins::Base + # source://spoom//lib/spoom/deadcode/plugins/active_model.rb#14 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end +end + +# source://spoom//lib/spoom/deadcode/plugins/active_record.rb#7 +class Spoom::Deadcode::Plugins::ActiveRecord < ::Spoom::Deadcode::Plugins::Base + # source://spoom//lib/spoom/deadcode/plugins/active_record.rb#74 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end +end + +# source://spoom//lib/spoom/deadcode/plugins/active_record.rb#64 +Spoom::Deadcode::Plugins::ActiveRecord::ARRAY_METHODS = T.let(T.unsafe(nil), Array) + +# source://spoom//lib/spoom/deadcode/plugins/active_record.rb#20 +Spoom::Deadcode::Plugins::ActiveRecord::CALLBACKS = T.let(T.unsafe(nil), Array) + +# source://spoom//lib/spoom/deadcode/plugins/active_record.rb#49 +Spoom::Deadcode::Plugins::ActiveRecord::CRUD_METHODS = T.let(T.unsafe(nil), Array) + +# source://spoom//lib/spoom/deadcode/plugins/active_support.rb#7 +class Spoom::Deadcode::Plugins::ActiveSupport < ::Spoom::Deadcode::Plugins::Base + # source://spoom//lib/spoom/deadcode/plugins/active_support.rb#22 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end +end + +# source://spoom//lib/spoom/deadcode/plugins/active_support.rb#19 +Spoom::Deadcode::Plugins::ActiveSupport::SETUP_AND_TEARDOWN_METHODS = T.let(T.unsafe(nil), Array) + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom//lib/spoom/deadcode/plugins/base.rb#9 +class Spoom::Deadcode::Plugins::Base + abstract! + + # source://spoom//lib/spoom/deadcode/plugins/base.rb#132 + sig { params(index: ::Spoom::Deadcode::Index).void } + def initialize(index); end + + # source://spoom//lib/spoom/deadcode/plugins/base.rb#129 + sig { returns(::Spoom::Deadcode::Index) } + def index; end + + # Do not override this method, use `on_define_accessor` instead. + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#158 + sig { params(definition: ::Spoom::Model::Attr).void } + def internal_on_define_accessor(definition); end + + # Do not override this method, use `on_define_class` instead. + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#182 + sig { params(definition: ::Spoom::Model::Class).void } + def internal_on_define_class(definition); end + + # Do not override this method, use `on_define_constant` instead. + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#212 + sig { params(definition: ::Spoom::Model::Constant).void } + def internal_on_define_constant(definition); end + + # Do not override this method, use `on_define_method` instead. + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#238 + sig { params(definition: ::Spoom::Model::Method).void } + def internal_on_define_method(definition); end + + # Do not override this method, use `on_define_module` instead. + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#264 + sig { params(definition: ::Spoom::Model::Module).void } + def internal_on_define_module(definition); end + + # Called when an accessor is defined. + # + # Will be called when the indexer processes a `attr_reader`, `attr_writer` or `attr_accessor` node. + # Note that when this method is called, the definition for the node has already been added to the index. + # It is still possible to ignore it from the plugin: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # def on_define_accessor(definition) + # @index.ignore(definition) if symbol_def.name == "foo" + # end + # end + # ~~~ + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#152 + sig { params(definition: ::Spoom::Model::Attr).void } + def on_define_accessor(definition); end + + # Called when a class is defined. + # + # Will be called when the indexer processes a `class` node. + # Note that when this method is called, the definition for the node has already been added to the index. + # It is still possible to ignore it from the plugin: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # def on_define_class(definition) + # @index.ignore(definition) if definition.name == "Foo" + # end + # end + # ~~~ + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#176 + sig { params(definition: ::Spoom::Model::Class).void } + def on_define_class(definition); end + + # Called when a constant is defined. + # + # Will be called when the indexer processes a `CONST =` node. + # Note that when this method is called, the definition for the node has already been added to the index. + # It is still possible to ignore it from the plugin: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # def on_define_constant(definition) + # @index.ignore(definition) if definition.name == "FOO" + # end + # end + # ~~~ + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#206 + sig { params(definition: ::Spoom::Model::Constant).void } + def on_define_constant(definition); end + + # Called when a method is defined. + # + # Will be called when the indexer processes a `def` or `defs` node. + # Note that when this method is called, the definition for the node has already been added to the index. + # It is still possible to ignore it from the plugin: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # def on_define_method(definition) + # @index.ignore(definition) if definition.name == "foo" + # end + # end + # ~~~ + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#232 + sig { params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end + + # Called when a module is defined. + # + # Will be called when the indexer processes a `module` node. + # Note that when this method is called, the definition for the node has already been added to the index. + # It is still possible to ignore it from the plugin: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # def on_define_module(definition) + # @index.ignore(definition) if definition.name == "Foo" + # end + # end + # ~~~ + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#258 + sig { params(definition: ::Spoom::Model::Module).void } + def on_define_module(definition); end + + # Called when a send is being processed + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # def on_send(send) + # return unless send.name == "dsl_method" + # return if send.args.empty? + # + # method_name = send.args.first.slice.delete_prefix(":") + # @index.reference_method(method_name, send.node, send.loc) + # end + # end + # ~~~ + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#284 + sig { params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end + + private + + # Plugin utils + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#352 + sig { params(name: ::String).returns(::String) } + def camelize(name); end + + # source://spoom//lib/spoom/deadcode/plugins/base.rb#301 + sig { params(name: T.nilable(::String)).returns(T::Boolean) } + def ignored_class_name?(name); end + + # source://spoom//lib/spoom/deadcode/plugins/base.rb#320 + sig { params(name: ::String).returns(T::Boolean) } + def ignored_constant_name?(name); end + + # source://spoom//lib/spoom/deadcode/plugins/base.rb#325 + sig { params(name: ::String).returns(T::Boolean) } + def ignored_method_name?(name); end + + # source://spoom//lib/spoom/deadcode/plugins/base.rb#330 + sig { params(name: ::String).returns(T::Boolean) } + def ignored_module_name?(name); end + + # source://spoom//lib/spoom/deadcode/plugins/base.rb#335 + sig { params(name: ::String, names_variable: ::Symbol, patterns_variable: ::Symbol).returns(T::Boolean) } + def ignored_name?(name, names_variable, patterns_variable); end + + # source://spoom//lib/spoom/deadcode/plugins/base.rb#308 + sig { params(definition: ::Spoom::Model::Class).returns(T::Boolean) } + def ignored_subclass?(definition); end + + # source://spoom//lib/spoom/deadcode/plugins/base.rb#340 + sig { params(const: ::Symbol).returns(T::Set[::String]) } + def names(const); end + + # source://spoom//lib/spoom/deadcode/plugins/base.rb#345 + sig { params(const: ::Symbol).returns(T::Array[::Regexp]) } + def patterns(const); end + + # DSL support + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#293 + sig { params(definition: ::Spoom::Model::Namespace, superclass_name: ::String).returns(T::Boolean) } + def subclass_of?(definition, superclass_name); end + + class << self + # Mark classes directly subclassing a class matching `names` as ignored. + # + # Names can be either strings or regexps: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # ignore_classes_inheriting_from( + # "Foo", + # "Bar", + # /Baz.*/, + # ) + # end + # ~~~ + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#52 + sig { params(names: T.any(::Regexp, ::String)).void } + def ignore_classes_inheriting_from(*names); end + + # Mark classes matching `names` as ignored. + # + # Names can be either strings or regexps: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # ignore_class_names( + # "Foo", + # "Bar", + # /Baz.*/, + # ) + # end + # ~~~ + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#34 + sig { params(names: T.any(::Regexp, ::String)).void } + def ignore_classes_named(*names); end + + # Mark constants matching `names` as ignored. + # + # Names can be either strings or regexps: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # ignore_class_names( + # "FOO", + # "BAR", + # /BAZ.*/, + # ) + # end + # ~~~ + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#70 + sig { params(names: T.any(::Regexp, ::String)).void } + def ignore_constants_named(*names); end + + # Mark methods matching `names` as ignored. + # + # Names can be either strings or regexps: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # ignore_method_names( + # "foo", + # "bar", + # /baz.*/, + # ) + # end + # ~~~ + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#88 + sig { params(names: T.any(::Regexp, ::String)).void } + def ignore_methods_named(*names); end + + # Mark modules matching `names` as ignored. + # + # Names can be either strings or regexps: + # + # ~~~rb + # class MyPlugin < Spoom::Deadcode::Plugins::Base + # ignore_class_names( + # "Foo", + # "Bar", + # /Baz.*/, + # ) + # end + # ~~~ + # + # source://spoom//lib/spoom/deadcode/plugins/base.rb#106 + sig { params(names: T.any(::Regexp, ::String)).void } + def ignore_modules_named(*names); end + + private + + # source://spoom//lib/spoom/deadcode/plugins/base.rb#113 + sig do + params( + names: T::Array[T.any(::Regexp, ::String)], + names_variable: ::Symbol, + patterns_variable: ::Symbol + ).void + end + def save_names_and_patterns(names, names_variable, patterns_variable); end + end +end + +# source://spoom//lib/spoom/deadcode/plugins/graphql.rb#7 +class Spoom::Deadcode::Plugins::GraphQL < ::Spoom::Deadcode::Plugins::Base + # source://spoom//lib/spoom/deadcode/plugins/graphql.rb#28 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end +end + +# source://spoom//lib/spoom/deadcode/plugins/minitest.rb#7 +class Spoom::Deadcode::Plugins::Minitest < ::Spoom::Deadcode::Plugins::Base + # source://spoom//lib/spoom/deadcode/plugins/minitest.rb#22 + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end + + # source://spoom//lib/spoom/deadcode/plugins/minitest.rb#28 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end +end + +# source://spoom//lib/spoom/deadcode/plugins/namespaces.rb#7 +class Spoom::Deadcode::Plugins::Namespaces < ::Spoom::Deadcode::Plugins::Base + # source://spoom//lib/spoom/deadcode/plugins/namespaces.rb#11 + sig { override.params(definition: ::Spoom::Model::Class).void } + def on_define_class(definition); end + + # source://spoom//lib/spoom/deadcode/plugins/namespaces.rb#16 + sig { override.params(definition: ::Spoom::Model::Module).void } + def on_define_module(definition); end + + private + + # source://spoom//lib/spoom/deadcode/plugins/namespaces.rb#23 + sig { params(symbol_def: ::Spoom::Model::Namespace).returns(T::Boolean) } + def used_as_namespace?(symbol_def); end +end + +# source://spoom//lib/spoom/deadcode/plugins/rspec.rb#7 +class Spoom::Deadcode::Plugins::RSpec < ::Spoom::Deadcode::Plugins::Base; end + +# source://spoom//lib/spoom/deadcode/plugins/rails.rb#7 +class Spoom::Deadcode::Plugins::Rails < ::Spoom::Deadcode::Plugins::Base + # source://spoom//lib/spoom/deadcode/plugins/rails.rb#13 + sig { override.params(definition: ::Spoom::Model::Class).void } + def on_define_class(definition); end + + # source://spoom//lib/spoom/deadcode/plugins/rails.rb#18 + sig { override.params(definition: ::Spoom::Model::Module).void } + def on_define_module(definition); end + + private + + # source://spoom//lib/spoom/deadcode/plugins/rails.rb#25 + sig { params(symbol_def: ::Spoom::Model::Namespace).returns(T::Boolean) } + def file_is_helper?(symbol_def); end +end + +# source://spoom//lib/spoom/deadcode/plugins/rake.rb#7 +class Spoom::Deadcode::Plugins::Rake < ::Spoom::Deadcode::Plugins::Base; end + +# source://spoom//lib/spoom/deadcode/plugins/rubocop.rb#7 +class Spoom::Deadcode::Plugins::Rubocop < ::Spoom::Deadcode::Plugins::Base + # source://spoom//lib/spoom/deadcode/plugins/rubocop.rb#18 + sig { override.params(definition: ::Spoom::Model::Constant).void } + def on_define_constant(definition); end + + # source://spoom//lib/spoom/deadcode/plugins/rubocop.rb#26 + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end +end + +# source://spoom//lib/spoom/deadcode/plugins/rubocop.rb#10 +Spoom::Deadcode::Plugins::Rubocop::RUBOCOP_CONSTANTS = T.let(T.unsafe(nil), Set) + +# source://spoom//lib/spoom/deadcode/plugins/ruby.rb#7 +class Spoom::Deadcode::Plugins::Ruby < ::Spoom::Deadcode::Plugins::Base + # source://spoom//lib/spoom/deadcode/plugins/ruby.rb#24 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end + + private + + # source://spoom//lib/spoom/deadcode/plugins/ruby.rb#46 + sig { params(send: ::Spoom::Deadcode::Send, node: ::Prism::Node).void } + def reference_symbol_as_constant(send, node); end +end + +# source://spoom//lib/spoom/deadcode/plugins/sorbet.rb#7 +class Spoom::Deadcode::Plugins::Sorbet < ::Spoom::Deadcode::Plugins::Base + # source://spoom//lib/spoom/deadcode/plugins/sorbet.rb#11 + sig { override.params(definition: ::Spoom::Model::Constant).void } + def on_define_constant(definition); end + + # source://spoom//lib/spoom/deadcode/plugins/sorbet.rb#16 + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end + + private + + # source://spoom//lib/spoom/deadcode/plugins/sorbet.rb#28 + sig { params(definition: ::Spoom::Model::Constant).returns(T::Boolean) } + def sorbet_enum_constant?(definition); end + + # source://spoom//lib/spoom/deadcode/plugins/sorbet.rb#23 + sig { params(definition: ::Spoom::Model::Constant).returns(T::Boolean) } + def sorbet_type_member?(definition); end +end + +# source://spoom//lib/spoom/deadcode/plugins/thor.rb#7 +class Spoom::Deadcode::Plugins::Thor < ::Spoom::Deadcode::Plugins::Base + # source://spoom//lib/spoom/deadcode/plugins/thor.rb#13 + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end +end + +# source://spoom//lib/spoom/deadcode/remover.rb#6 +class Spoom::Deadcode::Remover + # source://spoom//lib/spoom/deadcode/remover.rb#12 + sig { params(context: ::Spoom::Context).void } + def initialize(context); end + + # source://spoom//lib/spoom/deadcode/remover.rb#17 + sig { params(kind: T.nilable(::Spoom::Deadcode::Definition::Kind), location: ::Spoom::Location).returns(::String) } + def remove_location(kind, location); end +end + +# source://spoom//lib/spoom/deadcode/remover.rb#9 +class Spoom::Deadcode::Remover::Error < ::Spoom::Error; end + +# source://spoom//lib/spoom/deadcode/remover.rb#372 +class Spoom::Deadcode::Remover::NodeContext + # source://spoom//lib/spoom/deadcode/remover.rb#392 + sig do + params( + source: ::String, + comments: T::Hash[::Integer, ::Prism::Comment], + node: ::Prism::Node, + nesting: T::Array[::Prism::Node] + ).void + end + def initialize(source, comments, node, nesting); end + + # source://spoom//lib/spoom/deadcode/remover.rb#506 + sig { params(node: ::Prism::Node).returns(T::Array[::Prism::Comment]) } + def attached_comments(node); end + + # source://spoom//lib/spoom/deadcode/remover.rb#534 + sig { returns(T.nilable(::Prism::CallNode)) } + def attached_sig; end + + # source://spoom//lib/spoom/deadcode/remover.rb#521 + sig { returns(T::Array[::Prism::Node]) } + def attached_sigs; end + + # source://spoom//lib/spoom/deadcode/remover.rb#376 + sig { returns(T::Hash[::Integer, ::Prism::Comment]) } + def comments; end + + # source://spoom//lib/spoom/deadcode/remover.rb#494 + sig { params(start_line: ::Integer, end_line: ::Integer).returns(T::Array[::Prism::Comment]) } + def comments_between_lines(start_line, end_line); end + + # source://spoom//lib/spoom/deadcode/remover.rb#382 + sig { returns(T::Array[::Prism::Node]) } + def nesting; end + + # @return [Array] + # + # source://spoom//lib/spoom/deadcode/remover.rb#382 + def nesting=(_arg0); end + + # source://spoom//lib/spoom/deadcode/remover.rb#444 + sig { returns(T.nilable(::Prism::Node)) } + def next_node; end + + # @raise [Error] + # + # source://spoom//lib/spoom/deadcode/remover.rb#433 + sig { returns(T::Array[::Prism::Node]) } + def next_nodes; end + + # source://spoom//lib/spoom/deadcode/remover.rb#379 + sig { returns(::Prism::Node) } + def node; end + + # @raise [Error] + # + # source://spoom//lib/spoom/deadcode/remover.rb#408 + sig { returns(::Spoom::Deadcode::Remover::NodeContext) } + def parent_context; end + + # @raise [Error] + # + # source://spoom//lib/spoom/deadcode/remover.rb#400 + sig { returns(::Prism::Node) } + def parent_node; end + + # source://spoom//lib/spoom/deadcode/remover.rb#428 + sig { returns(T.nilable(::Prism::Node)) } + def previous_node; end + + # @raise [Error] + # + # source://spoom//lib/spoom/deadcode/remover.rb#417 + sig { returns(T::Array[::Prism::Node]) } + def previous_nodes; end + + # source://spoom//lib/spoom/deadcode/remover.rb#449 + sig { returns(T.nilable(::Spoom::Deadcode::Remover::NodeContext)) } + def sclass_context; end + + # source://spoom//lib/spoom/deadcode/remover.rb#482 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def sorbet_extend_sig?(node); end + + # source://spoom//lib/spoom/deadcode/remover.rb#477 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def sorbet_signature?(node); end +end + +# source://spoom//lib/spoom/deadcode/remover.rb#549 +class Spoom::Deadcode::Remover::NodeFinder < ::Spoom::Visitor + # source://spoom//lib/spoom/deadcode/remover.rb#621 + sig { params(location: ::Spoom::Location, kind: T.nilable(::Spoom::Deadcode::Definition::Kind)).void } + def initialize(location, kind); end + + # source://spoom//lib/spoom/deadcode/remover.rb#615 + sig { returns(T.nilable(::Prism::Node)) } + def node; end + + # source://spoom//lib/spoom/deadcode/remover.rb#618 + sig { returns(T::Array[::Prism::Node]) } + def nodes_nesting; end + + # source://spoom//lib/spoom/deadcode/remover.rb#630 + sig { override.params(node: T.nilable(::Prism::Node)).void } + def visit(node); end + + class << self + # source://spoom//lib/spoom/deadcode/remover.rb#556 + sig do + params( + source: ::String, + location: ::Spoom::Location, + kind: T.nilable(::Spoom::Deadcode::Definition::Kind) + ).returns(::Spoom::Deadcode::Remover::NodeContext) + end + def find(source, location, kind); end + + # source://spoom//lib/spoom/deadcode/remover.rb#590 + sig { params(node: ::Prism::Node, kind: ::Spoom::Deadcode::Definition::Kind).returns(T::Boolean) } + def node_match_kind?(node, kind); end + end +end + +# source://spoom//lib/spoom/deadcode/remover.rb#29 +class Spoom::Deadcode::Remover::NodeRemover + # source://spoom//lib/spoom/deadcode/remover.rb#36 + sig do + params( + source: ::String, + kind: T.nilable(::Spoom::Deadcode::Definition::Kind), + location: ::Spoom::Location + ).void + end + def initialize(source, kind, location); end + + # source://spoom//lib/spoom/deadcode/remover.rb#46 + sig { void } + def apply_edit; end + + # source://spoom//lib/spoom/deadcode/remover.rb#33 + sig { returns(::String) } + def new_source; end + + private + + # source://spoom//lib/spoom/deadcode/remover.rb#153 + sig { params(context: ::Spoom::Deadcode::Remover::NodeContext).void } + def delete_attr_accessor(context); end + + # source://spoom//lib/spoom/deadcode/remover.rb#331 + sig { params(start_char: ::Integer, end_char: ::Integer).void } + def delete_chars(start_char, end_char); end + + # source://spoom//lib/spoom/deadcode/remover.rb#73 + sig { params(context: ::Spoom::Deadcode::Remover::NodeContext).void } + def delete_constant_assignment(context); end + + # source://spoom//lib/spoom/deadcode/remover.rb#324 + sig { params(start_line: ::Integer, end_line: ::Integer).void } + def delete_lines(start_line, end_line); end + + # source://spoom//lib/spoom/deadcode/remover.rb#261 + sig { params(context: ::Spoom::Deadcode::Remover::NodeContext).void } + def delete_node_and_comments_and_sigs(context); end + + # source://spoom//lib/spoom/deadcode/remover.rb#218 + sig do + params( + node: ::Prism::Node, + send_context: ::Spoom::Deadcode::Remover::NodeContext, + was_removed: T::Boolean + ).void + end + def insert_accessor(node, send_context, was_removed:); end + + # source://spoom//lib/spoom/deadcode/remover.rb#336 + sig { params(start_char: ::Integer, end_char: ::Integer, replacement: ::String).void } + def replace_chars(start_char, end_char, replacement); end + + # source://spoom//lib/spoom/deadcode/remover.rb#341 + sig do + params( + node: ::Prism::CallNode, + name: ::String, + kind: T.nilable(::Spoom::Deadcode::Definition::Kind) + ).returns(::String) + end + def transform_sig(node, name:, kind:); end +end + +# An abstraction to simplify handling of Prism::CallNode nodes. +# +# source://spoom//lib/spoom/deadcode/send.rb#7 +class Spoom::Deadcode::Send < ::T::Struct + const :node, ::Prism::CallNode + const :name, ::String + const :recv, T.nilable(::Prism::Node), default: T.unsafe(nil) + const :args, T::Array[::Prism::Node], default: T.unsafe(nil) + const :block, T.nilable(::Prism::Node), default: T.unsafe(nil) + const :location, ::Spoom::Location + + # source://spoom//lib/spoom/deadcode/send.rb#22 + sig do + type_parameters(:T) + .params( + arg_type: T::Class[T.type_parameter(:T)], + block: T.proc.params(arg: T.type_parameter(:T)).void + ).void + end + def each_arg(arg_type, &block); end + + # source://spoom//lib/spoom/deadcode/send.rb#29 + sig { params(block: T.proc.params(key: ::Prism::Node, value: T.nilable(::Prism::Node)).void).void } + def each_arg_assoc(&block); end + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://spoom//lib/spoom.rb#12 +class Spoom::Error < ::StandardError; end + +# source://spoom//lib/spoom/context/exec.rb#5 +class Spoom::ExecResult < ::T::Struct + const :out, ::String + const :err, T.nilable(::String) + const :status, T::Boolean + const :exit_code, ::Integer + + # source://spoom//lib/spoom/context/exec.rb#14 + sig { returns(::String) } + def to_s; end + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://spoom//lib/spoom/file_collector.rb#5 +class Spoom::FileCollector + # Initialize a new file collector + # + # If `allow_extensions` is empty, all files are collected. + # If `allow_extensions` is an array of extensions, only files with one of these extensions are collected. + # + # If `allow_mime_types` is empty, all files are collected. + # If `allow_mime_types` is an array of mimetypes, files without an extension are collected if their mimetype is in + # the list. + # + # source://spoom//lib/spoom/file_collector.rb#26 + sig do + params( + allow_extensions: T::Array[::String], + allow_mime_types: T::Array[::String], + exclude_patterns: T::Array[::String] + ).void + end + def initialize(allow_extensions: T.unsafe(nil), allow_mime_types: T.unsafe(nil), exclude_patterns: T.unsafe(nil)); end + + # source://spoom//lib/spoom/file_collector.rb#9 + sig { returns(T::Array[::String]) } + def files; end + + # source://spoom//lib/spoom/file_collector.rb#39 + sig { params(path: ::String).void } + def visit_path(path); end + + # source://spoom//lib/spoom/file_collector.rb#34 + sig { params(paths: T::Array[::String]).void } + def visit_paths(paths); end + + private + + # source://spoom//lib/spoom/file_collector.rb#56 + sig { params(path: ::String).returns(::String) } + def clean_path(path); end + + # source://spoom//lib/spoom/file_collector.rb#73 + sig { params(path: ::String).returns(T::Boolean) } + def excluded_file?(path); end + + # source://spoom//lib/spoom/file_collector.rb#88 + sig { params(path: ::String).returns(T::Boolean) } + def excluded_path?(path); end + + # source://spoom//lib/spoom/file_collector.rb#97 + sig { params(path: ::String).returns(T.nilable(::String)) } + def mime_type_for(path); end + + # source://spoom//lib/spoom/file_collector.rb#68 + sig { params(path: ::String).void } + def visit_directory(path); end + + # source://spoom//lib/spoom/file_collector.rb#61 + sig { params(path: ::String).void } + def visit_file(path); end +end + +# Build a file hierarchy from a set of file paths. +# +# source://spoom//lib/spoom/file_tree.rb#6 +class Spoom::FileTree + # source://spoom//lib/spoom/file_tree.rb#10 + sig { params(paths: T::Enumerable[::String]).void } + def initialize(paths = T.unsafe(nil)); end + + # Add a `path` to the tree + # + # This will create all nodes until the root of `path`. + # + # source://spoom//lib/spoom/file_tree.rb#25 + sig { params(path: ::String).returns(::Spoom::FileTree::Node) } + def add_path(path); end + + # Add all `paths` to the tree + # + # source://spoom//lib/spoom/file_tree.rb#17 + sig { params(paths: T::Enumerable[::String]).void } + def add_paths(paths); end + + # All the nodes in this tree + # + # source://spoom//lib/spoom/file_tree.rb#45 + sig { returns(T::Array[::Spoom::FileTree::Node]) } + def nodes; end + + # Return a map of typing scores for each node in the tree + # + # source://spoom//lib/spoom/file_tree.rb#59 + sig { params(context: ::Spoom::Context).returns(T::Hash[::Spoom::FileTree::Node, ::Float]) } + def nodes_strictness_scores(context); end + + # All the paths in this tree + # + # source://spoom//lib/spoom/file_tree.rb#53 + sig { returns(T::Array[::String]) } + def paths; end + + # Return a map of typing scores for each path in the tree + # + # source://spoom//lib/spoom/file_tree.rb#67 + sig { params(context: ::Spoom::Context).returns(T::Hash[::String, ::Float]) } + def paths_strictness_scores(context); end + + # source://spoom//lib/spoom/file_tree.rb#72 + sig { params(out: T.any(::IO, ::StringIO), colors: T::Boolean).void } + def print(out: T.unsafe(nil), colors: T.unsafe(nil)); end + + # All root nodes + # + # source://spoom//lib/spoom/file_tree.rb#39 + sig { returns(T::Array[::Spoom::FileTree::Node]) } + def roots; end +end + +# A visitor that collects all the nodes in a tree +# +# source://spoom//lib/spoom/file_tree.rb#124 +class Spoom::FileTree::CollectNodes < ::Spoom::FileTree::Visitor + # source://spoom//lib/spoom/file_tree.rb#131 + sig { void } + def initialize; end + + # source://spoom//lib/spoom/file_tree.rb#128 + sig { returns(T::Array[::Spoom::FileTree::Node]) } + def nodes; end + + # source://spoom//lib/spoom/file_tree.rb#137 + sig { override.params(node: ::Spoom::FileTree::Node).void } + def visit_node(node); end +end + +# A visitor that collects the typing score of each node in a tree +# +# source://spoom//lib/spoom/file_tree.rb#167 +class Spoom::FileTree::CollectScores < ::Spoom::FileTree::CollectStrictnesses + # source://spoom//lib/spoom/file_tree.rb#174 + sig { params(context: ::Spoom::Context).void } + def initialize(context); end + + # source://spoom//lib/spoom/file_tree.rb#171 + sig { returns(T::Hash[::Spoom::FileTree::Node, ::Float]) } + def scores; end + + # source://spoom//lib/spoom/file_tree.rb#181 + sig { override.params(node: ::Spoom::FileTree::Node).void } + def visit_node(node); end + + private + + # source://spoom//lib/spoom/file_tree.rb#190 + sig { params(node: ::Spoom::FileTree::Node).returns(::Float) } + def node_score(node); end + + # source://spoom//lib/spoom/file_tree.rb#199 + sig { params(strictness: T.nilable(::String)).returns(::Float) } + def strictness_score(strictness); end +end + +# A visitor that collects the strictness of each node in a tree +# +# source://spoom//lib/spoom/file_tree.rb#144 +class Spoom::FileTree::CollectStrictnesses < ::Spoom::FileTree::Visitor + # source://spoom//lib/spoom/file_tree.rb#151 + sig { params(context: ::Spoom::Context).void } + def initialize(context); end + + # source://spoom//lib/spoom/file_tree.rb#148 + sig { returns(T::Hash[::Spoom::FileTree::Node, T.nilable(::String)]) } + def strictnesses; end + + # source://spoom//lib/spoom/file_tree.rb#158 + sig { override.params(node: ::Spoom::FileTree::Node).void } + def visit_node(node); end +end + +# A node representing either a file or a directory inside a FileTree +# +# source://spoom//lib/spoom/file_tree.rb#78 +class Spoom::FileTree::Node < ::T::Struct + const :parent, T.nilable(::Spoom::FileTree::Node) + const :name, ::String + const :children, T::Hash[::String, ::Spoom::FileTree::Node], default: T.unsafe(nil) + + # Full path to this node from root + # + # source://spoom//lib/spoom/file_tree.rb#92 + sig { returns(::String) } + def path; end + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# An internal class used to print a FileTree +# +# See `FileTree#print` +# +# source://spoom//lib/spoom/file_tree.rb#212 +class Spoom::FileTree::Printer < ::Spoom::FileTree::Visitor + # source://spoom//lib/spoom/file_tree.rb#222 + sig do + params( + strictnesses: T::Hash[::Spoom::FileTree::Node, T.nilable(::String)], + out: T.any(::IO, ::StringIO), + colors: T::Boolean + ).void + end + def initialize(strictnesses, out: T.unsafe(nil), colors: T.unsafe(nil)); end + + # source://spoom//lib/spoom/file_tree.rb#230 + sig { override.params(node: ::Spoom::FileTree::Node).void } + def visit_node(node); end + + private + + # source://spoom//lib/spoom/file_tree.rb#255 + sig { params(strictness: T.nilable(::String)).returns(::Spoom::Color) } + def strictness_color(strictness); end +end + +# An abstract visitor for FileTree +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom//lib/spoom/file_tree.rb#101 +class Spoom::FileTree::Visitor + abstract! + + # source://spoom//lib/spoom/file_tree.rb#113 + sig { params(node: ::Spoom::FileTree::Node).void } + def visit_node(node); end + + # source://spoom//lib/spoom/file_tree.rb#118 + sig { params(nodes: T::Array[::Spoom::FileTree::Node]).void } + def visit_nodes(nodes); end + + # source://spoom//lib/spoom/file_tree.rb#108 + sig { params(tree: ::Spoom::FileTree).void } + def visit_tree(tree); end +end + +# source://spoom//lib/spoom/context/git.rb#5 +module Spoom::Git; end + +# source://spoom//lib/spoom/context/git.rb#6 +class Spoom::Git::Commit < ::T::Struct + const :sha, ::String + const :time, ::Time + + # source://spoom//lib/spoom/context/git.rb#27 + sig { returns(::Integer) } + def timestamp; end + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + + # Parse a line formatted as `%h %at` into a `Commit` + # + # source://spoom//lib/spoom/context/git.rb#14 + sig { params(string: ::String).returns(T.nilable(::Spoom::Git::Commit)) } + def parse_line(string); end + end +end + +# source://spoom//lib/spoom/sorbet/lsp/base.rb#5 +module Spoom::LSP; end + +# source://spoom//lib/spoom/sorbet/lsp.rb#13 +class Spoom::LSP::Client + # source://spoom//lib/spoom/sorbet/lsp.rb#17 + sig { params(sorbet_bin: ::String, sorbet_args: ::String, path: ::String).void } + def initialize(sorbet_bin, *sorbet_args, path: T.unsafe(nil)); end + + # source://spoom//lib/spoom/sorbet/lsp.rb#229 + sig { void } + def close; end + + # source://spoom//lib/spoom/sorbet/lsp.rb#131 + sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::Location]) } + def definitions(uri, line, column); end + + # source://spoom//lib/spoom/sorbet/lsp.rb#212 + sig { params(uri: ::String).returns(T::Array[::Spoom::LSP::DocumentSymbol]) } + def document_symbols(uri); end + + # source://spoom//lib/spoom/sorbet/lsp.rb#89 + sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T.nilable(::Spoom::LSP::Hover)) } + def hover(uri, line, column); end + + # source://spoom//lib/spoom/sorbet/lsp.rb#27 + sig { returns(::Integer) } + def next_id; end + + # LSP requests + # + # @raise [Error::AlreadyOpen] + # + # source://spoom//lib/spoom/sorbet/lsp.rb#72 + sig { params(workspace_path: ::String).void } + def open(workspace_path); end + + # source://spoom//lib/spoom/sorbet/lsp.rb#54 + sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) } + def read; end + + # @raise [Error::BadHeaders] + # + # source://spoom//lib/spoom/sorbet/lsp.rb#43 + sig { returns(T.nilable(::String)) } + def read_raw; end + + # source://spoom//lib/spoom/sorbet/lsp.rb#173 + sig do + params( + uri: ::String, + line: ::Integer, + column: ::Integer, + include_decl: T::Boolean + ).returns(T::Array[::Spoom::LSP::Location]) + end + def references(uri, line, column, include_decl = T.unsafe(nil)); end + + # source://spoom//lib/spoom/sorbet/lsp.rb#37 + sig { params(message: ::Spoom::LSP::Message).returns(T.nilable(T::Hash[T.untyped, T.untyped])) } + def send(message); end + + # source://spoom//lib/spoom/sorbet/lsp.rb#32 + sig { params(json_string: ::String).void } + def send_raw(json_string); end + + # source://spoom//lib/spoom/sorbet/lsp.rb#110 + sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::SignatureHelp]) } + def signatures(uri, line, column); end + + # source://spoom//lib/spoom/sorbet/lsp.rb#197 + sig { params(query: ::String).returns(T::Array[::Spoom::LSP::DocumentSymbol]) } + def symbols(query); end + + # source://spoom//lib/spoom/sorbet/lsp.rb#152 + sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::Location]) } + def type_definitions(uri, line, column); end +end + +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#178 +class Spoom::LSP::Diagnostic < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :range, ::Spoom::LSP::Range + const :code, ::Integer + const :message, ::String + const :information, ::Object + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#202 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#207 + sig { returns(::String) } + def to_s; end + + class << self + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#191 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Diagnostic) } + def from_json(json); end + + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#212 +class Spoom::LSP::DocumentSymbol < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :name, ::String + const :detail, T.nilable(::String) + const :kind, ::Integer + const :location, T.nilable(::Spoom::LSP::Location) + const :range, T.nilable(::Spoom::LSP::Range) + const :children, T::Array[::Spoom::LSP::DocumentSymbol] + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#240 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#272 + sig { returns(::String) } + def kind_string; end + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#267 + sig { returns(::String) } + def to_s; end + + class << self + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#227 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::DocumentSymbol) } + def from_json(json); end + + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#276 +Spoom::LSP::DocumentSymbol::SYMBOL_KINDS = T.let(T.unsafe(nil), Hash) + +# source://spoom//lib/spoom/sorbet/lsp/errors.rb#6 +class Spoom::LSP::Error < ::Spoom::Error; end + +# source://spoom//lib/spoom/sorbet/lsp/errors.rb#7 +class Spoom::LSP::Error::AlreadyOpen < ::Spoom::LSP::Error; end + +# source://spoom//lib/spoom/sorbet/lsp/errors.rb#8 +class Spoom::LSP::Error::BadHeaders < ::Spoom::LSP::Error; end + +# source://spoom//lib/spoom/sorbet/lsp/errors.rb#10 +class Spoom::LSP::Error::Diagnostics < ::Spoom::LSP::Error + # source://spoom//lib/spoom/sorbet/lsp/errors.rb#32 + sig { params(uri: ::String, diagnostics: T::Array[::Spoom::LSP::Diagnostic]).void } + def initialize(uri, diagnostics); end + + # source://spoom//lib/spoom/sorbet/lsp/errors.rb#17 + sig { returns(T::Array[::Spoom::LSP::Diagnostic]) } + def diagnostics; end + + # source://spoom//lib/spoom/sorbet/lsp/errors.rb#14 + sig { returns(::String) } + def uri; end + + class << self + # source://spoom//lib/spoom/sorbet/lsp/errors.rb#23 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Error::Diagnostics) } + def from_json(json); end + end +end + +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#19 +class Spoom::LSP::Hover < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :contents, ::String + const :range, T.nilable(T::Range[T.untyped]) + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#39 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#45 + sig { returns(::String) } + def to_s; end + + class << self + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#30 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Hover) } + def from_json(json); end + + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#112 +class Spoom::LSP::Location < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :uri, ::String + const :range, ::Spoom::LSP::Range + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#132 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#138 + sig { returns(::String) } + def to_s; end + + class << self + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#123 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Location) } + def from_json(json); end + + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# A general message as defined by JSON-RPC. +# +# The language server protocol always uses `"2.0"` as the `jsonrpc` version. +# +# source://spoom//lib/spoom/sorbet/lsp/base.rb#12 +class Spoom::LSP::Message + # source://spoom//lib/spoom/sorbet/lsp/base.rb#16 + sig { void } + def initialize; end + + # source://spoom//lib/spoom/sorbet/lsp/base.rb#21 + sig { returns(T::Hash[T.untyped, T.untyped]) } + def as_json; end + + # source://spoom//lib/spoom/sorbet/lsp/base.rb#29 + sig { params(args: T.untyped).returns(::String) } + def to_json(*args); end +end + +# A notification message. +# +# A processed notification message must not send a response back. They work like events. +# +# source://spoom//lib/spoom/sorbet/lsp/base.rb#58 +class Spoom::LSP::Notification < ::Spoom::LSP::Message + # source://spoom//lib/spoom/sorbet/lsp/base.rb#68 + sig { params(method: ::String, params: T::Hash[T.untyped, T.untyped]).void } + def initialize(method, params); end + + # source://spoom//lib/spoom/sorbet/lsp/base.rb#62 + sig { returns(::String) } + def method; end + + # source://spoom//lib/spoom/sorbet/lsp/base.rb#65 + sig { returns(T::Hash[T.untyped, T.untyped]) } + def params; end +end + +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#50 +class Spoom::LSP::Position < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :line, ::Integer + const :char, ::Integer + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#70 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#75 + sig { returns(::String) } + def to_s; end + + class << self + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#61 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Position) } + def from_json(json); end + + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# @abstract Subclasses must implement the `abstract` methods below. +# +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#9 +module Spoom::LSP::PrintableSymbol + interface! + + # @abstract + # + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#16 + sig { abstract.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end +end + +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#80 +class Spoom::LSP::Range < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :start, ::Spoom::LSP::Position + const :end, ::Spoom::LSP::Position + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#100 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#107 + sig { returns(::String) } + def to_s; end + + class << self + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#91 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Range) } + def from_json(json); end + + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# A request message to describe a request between the client and the server. +# +# Every processed request must send a response back to the sender of the request. +# +# source://spoom//lib/spoom/sorbet/lsp/base.rb#37 +class Spoom::LSP::Request < ::Spoom::LSP::Message + # source://spoom//lib/spoom/sorbet/lsp/base.rb#47 + sig { params(id: ::Integer, method: ::String, params: T::Hash[T.untyped, T.untyped]).void } + def initialize(id, method, params); end + + # source://spoom//lib/spoom/sorbet/lsp/base.rb#41 + sig { returns(::Integer) } + def id; end + + # source://spoom//lib/spoom/sorbet/lsp/base.rb#44 + sig { returns(T::Hash[T.untyped, T.untyped]) } + def params; end +end + +# source://spoom//lib/spoom/sorbet/lsp/errors.rb#40 +class Spoom::LSP::ResponseError < ::Spoom::LSP::Error + # source://spoom//lib/spoom/sorbet/lsp/errors.rb#63 + sig { params(code: ::Integer, message: ::String, data: T::Hash[T.untyped, T.untyped]).void } + def initialize(code, message, data); end + + # source://spoom//lib/spoom/sorbet/lsp/errors.rb#44 + sig { returns(::Integer) } + def code; end + + # source://spoom//lib/spoom/sorbet/lsp/errors.rb#47 + sig { returns(T::Hash[T.untyped, T.untyped]) } + def data; end + + class << self + # source://spoom//lib/spoom/sorbet/lsp/errors.rb#53 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::ResponseError) } + def from_json(json); end + end +end + +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#143 +class Spoom::LSP::SignatureHelp < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :label, T.nilable(::String) + const :doc, ::Object + const :params, T::Array[T.untyped] + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#165 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#173 + sig { returns(::String) } + def to_s; end + + class << self + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#155 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::SignatureHelp) } + def from_json(json); end + + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#309 +class Spoom::LSP::SymbolPrinter < ::Spoom::Printer + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#326 + sig do + params( + out: T.any(::IO, ::StringIO), + colors: T::Boolean, + indent_level: ::Integer, + prefix: T.nilable(::String) + ).void + end + def initialize(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil), prefix: T.unsafe(nil)); end + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#348 + sig { params(uri: ::String).returns(::String) } + def clean_uri(uri); end + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#316 + sig { returns(T.nilable(::String)) } + def prefix; end + + # @return [String, nil] + # + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#316 + def prefix=(_arg0); end + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#356 + sig { params(objects: T::Array[::Spoom::LSP::PrintableSymbol]).void } + def print_list(objects); end + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#336 + sig { params(object: T.nilable(::Spoom::LSP::PrintableSymbol)).void } + def print_object(object); end + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#343 + sig { params(objects: T::Array[::Spoom::LSP::PrintableSymbol]).void } + def print_objects(objects); end + + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#313 + sig { returns(T::Set[::Integer]) } + def seen; end +end + +# source://spoom//lib/spoom/location.rb#5 +class Spoom::Location + include ::Comparable + + # @raise [LocationError] + # + # source://spoom//lib/spoom/location.rb#73 + sig do + params( + file: ::String, + start_line: T.nilable(::Integer), + start_column: T.nilable(::Integer), + end_line: T.nilable(::Integer), + end_column: T.nilable(::Integer) + ).void + end + def initialize(file, start_line: T.unsafe(nil), start_column: T.unsafe(nil), end_line: T.unsafe(nil), end_column: T.unsafe(nil)); end + + # source://spoom//lib/spoom/location.rb#106 + sig { override.params(other: ::BasicObject).returns(T.nilable(::Integer)) } + def <=>(other); end + + # @return [Integer, nil] + # + # source://spoom//lib/spoom/location.rb#62 + def end_column; end + + # @return [Integer, nil] + # + # source://spoom//lib/spoom/location.rb#62 + def end_line; end + + # source://spoom//lib/spoom/location.rb#59 + sig { returns(::String) } + def file; end + + # source://spoom//lib/spoom/location.rb#93 + sig { params(other: ::Spoom::Location).returns(T::Boolean) } + def include?(other); end + + # @return [Integer, nil] + # + # source://spoom//lib/spoom/location.rb#62 + def start_column; end + + # source://spoom//lib/spoom/location.rb#62 + sig { returns(T.nilable(::Integer)) } + def start_line; end + + # source://spoom//lib/spoom/location.rb#129 + sig { returns(::String) } + def to_s; end + + class << self + # source://spoom//lib/spoom/location.rb#47 + sig { params(file: ::String, location: ::Prism::Location).returns(::Spoom::Location) } + def from_prism(file, location); end + + # @raise [LocationError] + # + # source://spoom//lib/spoom/location.rb#16 + sig { params(location_string: ::String).returns(::Spoom::Location) } + def from_string(location_string); end + end +end + +# source://spoom//lib/spoom/location.rb#10 +class Spoom::Location::LocationError < ::Spoom::Error; end + +# source://spoom//lib/spoom/model/model.rb#5 +class Spoom::Model + # source://spoom//lib/spoom/model/model.rb#238 + sig { void } + def initialize; end + + # Get a symbol by it's full name + # + # Raises an error if the symbol is not found + # + # @raise [Error] + # + # source://spoom//lib/spoom/model/model.rb#247 + sig { params(full_name: ::String).returns(::Spoom::Model::Symbol) } + def [](full_name); end + + # source://spoom//lib/spoom/model/model.rb#296 + sig { void } + def finalize!; end + + # Register a new symbol by it's full name + # + # If the symbol already exists, it will be returned. + # + # source://spoom//lib/spoom/model/model.rb#258 + sig { params(full_name: ::String).returns(::Spoom::Model::Symbol) } + def register_symbol(full_name); end + + # source://spoom//lib/spoom/model/model.rb#263 + sig { params(full_name: ::String, context: ::Spoom::Model::Symbol).returns(::Spoom::Model::Symbol) } + def resolve_symbol(full_name, context:); end + + # source://spoom//lib/spoom/model/model.rb#290 + sig { params(symbol: ::Spoom::Model::Symbol).returns(T::Array[::Spoom::Model::Symbol]) } + def subtypes(symbol); end + + # source://spoom//lib/spoom/model/model.rb#284 + sig { params(symbol: ::Spoom::Model::Symbol).returns(T::Array[::Spoom::Model::Symbol]) } + def supertypes(symbol); end + + # All the symbols registered in this model + # + # source://spoom//lib/spoom/model/model.rb#232 + sig { returns(T::Hash[::String, ::Spoom::Model::Symbol]) } + def symbols; end + + # source://spoom//lib/spoom/model/model.rb#235 + sig { returns(Spoom::Poset[::Spoom::Model::Symbol]) } + def symbols_hierarchy; end + + private + + # source://spoom//lib/spoom/model/model.rb#303 + sig { void } + def compute_symbols_hierarchy!; end +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom//lib/spoom/model/model.rb#179 +class Spoom::Model::Attr < ::Spoom::Model::Property + abstract! +end + +# source://spoom//lib/spoom/model/model.rb#185 +class Spoom::Model::AttrAccessor < ::Spoom::Model::Attr; end + +# source://spoom//lib/spoom/model/model.rb#183 +class Spoom::Model::AttrReader < ::Spoom::Model::Attr; end + +# source://spoom//lib/spoom/model/model.rb#184 +class Spoom::Model::AttrWriter < ::Spoom::Model::Attr; end + +# Populate a Model by visiting the nodes from a Ruby file +# +# source://spoom//lib/spoom/model/builder.rb#7 +class Spoom::Model::Builder < ::Spoom::Model::NamespaceVisitor + # source://spoom//lib/spoom/model/builder.rb#11 + sig { params(model: ::Spoom::Model, file: ::String).void } + def initialize(model, file); end + + # Accessors + # + # source://spoom//lib/spoom/model/builder.rb#146 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end + + # Classes + # + # source://spoom//lib/spoom/model/builder.rb#24 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end + + # Constants + # + # source://spoom//lib/spoom/model/builder.rb#71 + sig { override.params(node: ::Prism::ConstantPathWriteNode).void } + def visit_constant_path_write_node(node); end + + # source://spoom//lib/spoom/model/builder.rb#92 + sig { override.params(node: ::Prism::ConstantWriteNode).void } + def visit_constant_write_node(node); end + + # Methods + # + # source://spoom//lib/spoom/model/builder.rb#127 + sig { override.params(node: ::Prism::DefNode).void } + def visit_def_node(node); end + + # Modules + # + # source://spoom//lib/spoom/model/builder.rb#55 + sig { override.params(node: ::Prism::ModuleNode).void } + def visit_module_node(node); end + + # source://spoom//lib/spoom/model/builder.rb#106 + sig { override.params(node: ::Prism::MultiWriteNode).void } + def visit_multi_write_node(node); end + + # source://spoom//lib/spoom/model/builder.rb#39 + sig { override.params(node: ::Prism::SingletonClassNode).void } + def visit_singleton_class_node(node); end + + private + + # source://spoom//lib/spoom/model/builder.rb#234 + sig { returns(T::Array[::Spoom::Model::Sig]) } + def collect_sigs; end + + # source://spoom//lib/spoom/model/builder.rb#229 + sig { returns(::Spoom::Model::Visibility) } + def current_visibility; end + + # source://spoom//lib/spoom/model/builder.rb#241 + sig { params(node: ::Prism::Node).returns(::Spoom::Location) } + def node_location(node); end +end + +# source://spoom//lib/spoom/model/model.rb#117 +class Spoom::Model::Class < ::Spoom::Model::Namespace + # source://spoom//lib/spoom/model/model.rb#129 + sig do + params( + symbol: ::Spoom::Model::Symbol, + owner: T.nilable(::Spoom::Model::Namespace), + location: ::Spoom::Location, + superclass_name: T.nilable(::String) + ).void + end + def initialize(symbol, owner:, location:, superclass_name: T.unsafe(nil)); end + + # source://spoom//lib/spoom/model/model.rb#119 + sig { returns(T.nilable(::String)) } + def superclass_name; end + + # @return [String, nil] + # + # source://spoom//lib/spoom/model/model.rb#119 + def superclass_name=(_arg0); end +end + +# source://spoom//lib/spoom/model/model.rb#138 +class Spoom::Model::Constant < ::Spoom::Model::SymbolDef + # source://spoom//lib/spoom/model/model.rb#143 + sig do + params( + symbol: ::Spoom::Model::Symbol, + owner: T.nilable(::Spoom::Model::Namespace), + location: ::Spoom::Location, + value: ::String + ).void + end + def initialize(symbol, owner:, location:, value:); end + + # source://spoom//lib/spoom/model/model.rb#140 + sig { returns(::String) } + def value; end +end + +# source://spoom//lib/spoom/model/model.rb#8 +class Spoom::Model::Error < ::Spoom::Error; end + +# source://spoom//lib/spoom/model/model.rb#213 +class Spoom::Model::Extend < ::Spoom::Model::Mixin; end + +# source://spoom//lib/spoom/model/model.rb#211 +class Spoom::Model::Include < ::Spoom::Model::Mixin; end + +# source://spoom//lib/spoom/model/model.rb#177 +class Spoom::Model::Method < ::Spoom::Model::Property; end + +# A mixin (include, prepend, extend) to a namespace +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom//lib/spoom/model/model.rb#196 +class Spoom::Model::Mixin + abstract! + + # source://spoom//lib/spoom/model/model.rb#206 + sig { params(name: ::String).void } + def initialize(name); end + + # source://spoom//lib/spoom/model/model.rb#203 + sig { returns(::String) } + def name; end +end + +# source://spoom//lib/spoom/model/model.rb#136 +class Spoom::Model::Module < ::Spoom::Model::Namespace; end + +# A class or module +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom//lib/spoom/model/model.rb#97 +class Spoom::Model::Namespace < ::Spoom::Model::SymbolDef + abstract! + + # source://spoom//lib/spoom/model/model.rb#107 + sig do + params( + symbol: ::Spoom::Model::Symbol, + owner: T.nilable(::Spoom::Model::Namespace), + location: ::Spoom::Location + ).void + end + def initialize(symbol, owner:, location:); end + + # source://spoom//lib/spoom/model/model.rb#101 + sig { returns(T::Array[::Spoom::Model::SymbolDef]) } + def children; end + + # source://spoom//lib/spoom/model/model.rb#104 + sig { returns(T::Array[::Spoom::Model::Mixin]) } + def mixins; end +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom//lib/spoom/model/namespace_visitor.rb#6 +class Spoom::Model::NamespaceVisitor < ::Spoom::Visitor + abstract! + + # source://spoom//lib/spoom/model/namespace_visitor.rb#12 + sig { void } + def initialize; end + + # source://spoom//lib/spoom/model/namespace_visitor.rb#19 + sig { override.params(node: T.nilable(::Prism::Node)).void } + def visit(node); end +end + +# source://spoom//lib/spoom/model/model.rb#212 +class Spoom::Model::Prepend < ::Spoom::Model::Mixin; end + +# A method or an attribute accessor +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom//lib/spoom/model/model.rb#151 +class Spoom::Model::Property < ::Spoom::Model::SymbolDef + abstract! + + # source://spoom//lib/spoom/model/model.rb#169 + sig do + params( + symbol: ::Spoom::Model::Symbol, + owner: T.nilable(::Spoom::Model::Namespace), + location: ::Spoom::Location, + visibility: ::Spoom::Model::Visibility, + sigs: T::Array[::Spoom::Model::Sig] + ).void + end + def initialize(symbol, owner:, location:, visibility:, sigs: T.unsafe(nil)); end + + # source://spoom//lib/spoom/model/model.rb#158 + sig { returns(T::Array[::Spoom::Model::Sig]) } + def sigs; end + + # source://spoom//lib/spoom/model/model.rb#155 + sig { returns(::Spoom::Model::Visibility) } + def visibility; end +end + +# A reference to something that looks like a constant or a method +# +# Constants could be classes, modules, or actual constants. +# Methods could be accessors, instance or class methods, aliases, etc. +# +# source://spoom//lib/spoom/model/reference.rb#10 +class Spoom::Model::Reference < ::T::Struct + const :kind, ::Spoom::Model::Reference::Kind + const :name, ::String + const :location, ::Spoom::Location + + # source://spoom//lib/spoom/model/reference.rb#39 + sig { returns(T::Boolean) } + def constant?; end + + # source://spoom//lib/spoom/model/reference.rb#44 + sig { returns(T::Boolean) } + def method?; end + + class << self + # source://spoom//lib/spoom/model/reference.rb#24 + sig { params(name: ::String, location: ::Spoom::Location).returns(::Spoom::Model::Reference) } + def constant(name, location); end + + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + + # source://spoom//lib/spoom/model/reference.rb#29 + sig { params(name: ::String, location: ::Spoom::Location).returns(::Spoom::Model::Reference) } + def method(name, location); end + end +end + +# source://spoom//lib/spoom/model/reference.rb#13 +class Spoom::Model::Reference::Kind < ::T::Enum + enums do + Constant = new + Method = new + end +end + +# Visit a file to collect all the references to constants and methods +# +# source://spoom//lib/spoom/model/references_visitor.rb#7 +class Spoom::Model::ReferencesVisitor < ::Spoom::Visitor + # source://spoom//lib/spoom/model/references_visitor.rb#14 + sig { params(file: ::String).void } + def initialize(file); end + + # source://spoom//lib/spoom/model/references_visitor.rb#11 + sig { returns(T::Array[::Spoom::Model::Reference]) } + def references; end + + # source://spoom//lib/spoom/model/references_visitor.rb#22 + sig { override.params(node: ::Prism::AliasMethodNode).void } + def visit_alias_method_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#27 + sig { override.params(node: ::Prism::AndNode).void } + def visit_and_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#33 + sig { override.params(node: ::Prism::BlockArgumentNode).void } + def visit_block_argument_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#44 + sig { override.params(node: ::Prism::CallAndWriteNode).void } + def visit_call_and_write_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#68 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#52 + sig { override.params(node: ::Prism::CallOperatorWriteNode).void } + def visit_call_operator_write_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#60 + sig { override.params(node: ::Prism::CallOrWriteNode).void } + def visit_call_or_write_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#85 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#91 + sig { override.params(node: ::Prism::ConstantAndWriteNode).void } + def visit_constant_and_write_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#97 + sig { override.params(node: ::Prism::ConstantOperatorWriteNode).void } + def visit_constant_operator_write_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#103 + sig { override.params(node: ::Prism::ConstantOrWriteNode).void } + def visit_constant_or_write_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#109 + sig { override.params(node: ::Prism::ConstantPathNode).void } + def visit_constant_path_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#115 + sig { override.params(node: ::Prism::ConstantPathWriteNode).void } + def visit_constant_path_write_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#121 + sig { override.params(node: ::Prism::ConstantReadNode).void } + def visit_constant_read_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#126 + sig { override.params(node: ::Prism::ConstantWriteNode).void } + def visit_constant_write_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#131 + sig { override.params(node: ::Prism::LocalVariableAndWriteNode).void } + def visit_local_variable_and_write_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#139 + sig { override.params(node: ::Prism::LocalVariableOperatorWriteNode).void } + def visit_local_variable_operator_write_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#147 + sig { override.params(node: ::Prism::LocalVariableOrWriteNode).void } + def visit_local_variable_or_write_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#155 + sig { override.params(node: ::Prism::LocalVariableWriteNode).void } + def visit_local_variable_write_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#161 + sig { override.params(node: ::Prism::ModuleNode).void } + def visit_module_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#166 + sig { override.params(node: ::Prism::MultiWriteNode).void } + def visit_multi_write_node(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#177 + sig { override.params(node: ::Prism::OrNode).void } + def visit_or_node(node); end + + private + + # source://spoom//lib/spoom/model/references_visitor.rb#195 + sig { params(node: ::Prism::Node).returns(::Spoom::Location) } + def node_location(node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#185 + sig { params(name: ::String, node: ::Prism::Node).void } + def reference_constant(name, node); end + + # source://spoom//lib/spoom/model/references_visitor.rb#190 + sig { params(name: ::String, node: ::Prism::Node).void } + def reference_method(name, node); end +end + +# A Sorbet signature (sig block) +# +# source://spoom//lib/spoom/model/model.rb#216 +class Spoom::Model::Sig + # source://spoom//lib/spoom/model/model.rb#223 + sig { params(string: ::String).void } + def initialize(string); end + + # source://spoom//lib/spoom/model/model.rb#220 + sig { returns(::String) } + def string; end +end + +# source://spoom//lib/spoom/model/model.rb#115 +class Spoom::Model::SingletonClass < ::Spoom::Model::Namespace; end + +# A Symbol is a uniquely named entity in the Ruby codebase +# +# A symbol can have multiple definitions, e.g. a class can be reopened. +# Sometimes a symbol can have multiple definitions of different types, +# e.g. `foo` method can be defined both as a method and as an attribute accessor. +# +# source://spoom//lib/spoom/model/model.rb#15 +class Spoom::Model::Symbol + # source://spoom//lib/spoom/model/model.rb#27 + sig { params(full_name: ::String).void } + def initialize(full_name); end + + # The definitions of this symbol (where it exists in the code) + # + # source://spoom//lib/spoom/model/model.rb#24 + sig { returns(T::Array[::Spoom::Model::SymbolDef]) } + def definitions; end + + # The full, unique name of this symbol + # + # source://spoom//lib/spoom/model/model.rb#20 + sig { returns(::String) } + def full_name; end + + # The short name of this symbol + # + # source://spoom//lib/spoom/model/model.rb#34 + sig { returns(::String) } + def name; end + + # source://spoom//lib/spoom/model/model.rb#39 + sig { returns(::String) } + def to_s; end +end + +# A SymbolDef is a definition of a Symbol +# +# It can be a class, module, constant, method, etc. +# A SymbolDef has a location pointing to the actual code that defines the symbol. +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom//lib/spoom/model/model.rb#55 +class Spoom::Model::SymbolDef + abstract! + + # source://spoom//lib/spoom/model/model.rb#74 + sig do + params( + symbol: ::Spoom::Model::Symbol, + owner: T.nilable(::Spoom::Model::Namespace), + location: ::Spoom::Location + ).void + end + def initialize(symbol, owner:, location:); end + + # The full name of the symbol this definition belongs to + # + # source://spoom//lib/spoom/model/model.rb#85 + sig { returns(::String) } + def full_name; end + + # The actual code location of this definition + # + # source://spoom//lib/spoom/model/model.rb#71 + sig { returns(::Spoom::Location) } + def location; end + + # The short name of the symbol this definition belongs to + # + # source://spoom//lib/spoom/model/model.rb#91 + sig { returns(::String) } + def name; end + + # The enclosing namespace this definition belongs to + # + # source://spoom//lib/spoom/model/model.rb#67 + sig { returns(T.nilable(::Spoom::Model::Namespace)) } + def owner; end + + # The symbol this definition belongs to + # + # source://spoom//lib/spoom/model/model.rb#63 + sig { returns(::Spoom::Model::Symbol) } + def symbol; end +end + +# source://spoom//lib/spoom/model/model.rb#44 +class Spoom::Model::UnresolvedSymbol < ::Spoom::Model::Symbol + # source://spoom//lib/spoom/model/model.rb#46 + sig { override.returns(::String) } + def to_s; end +end + +# source://spoom//lib/spoom/model/model.rb#187 +class Spoom::Model::Visibility < ::T::Enum + enums do + Public = new + Protected = new + Private = new + end +end + +# source://spoom//lib/spoom/parse.rb#7 +class Spoom::ParseError < ::Spoom::Error; end + +# A Poset is a set of elements with a partial order relation. +# +# The partial order relation is a binary relation that is reflexive, antisymmetric, and transitive. +# It can be used to represent a hierarchy of classes or modules, the dependencies between gems, etc. +# +# source://spoom//lib/spoom/poset.rb#9 +class Spoom::Poset + extend T::Generic + + E = type_member { { upper: Object } } + + # source://spoom//lib/spoom/poset.rb#18 + sig { void } + def initialize; end + + # Get the POSet element for a given value + # + # Raises if the element is not found + # + # @raise [Error] + # + # source://spoom//lib/spoom/poset.rb#26 + sig { params(value: E).returns(Spoom::Poset::Element[E]) } + def [](value); end + + # Add a direct edge from one element to another + # + # Transitive edges (transitive closure) are automatically computed. + # Adds the elements if they don't exist. + # If the direct edge already exists, nothing is done. + # + # source://spoom//lib/spoom/poset.rb#54 + sig { params(from: E, to: E).void } + def add_direct_edge(from, to); end + + # Add an element to the POSet + # + # source://spoom//lib/spoom/poset.rb#35 + sig { params(value: E).returns(Spoom::Poset::Element[E]) } + def add_element(value); end + + # Is there a direct edge from `from` to `to`? + # + # source://spoom//lib/spoom/poset.rb#101 + sig { params(from: E, to: E).returns(T::Boolean) } + def direct_edge?(from, to); end + + # Is there an edge (direct or indirect) from `from` to `to`? + # + # source://spoom//lib/spoom/poset.rb#92 + sig { params(from: E, to: E).returns(T::Boolean) } + def edge?(from, to); end + + # Is the given value a element in the POSet? + # + # source://spoom//lib/spoom/poset.rb#44 + sig { params(value: E).returns(T::Boolean) } + def element?(value); end + + # Show the POSet as a DOT graph using xdot (used for debugging) + # + # source://spoom//lib/spoom/poset.rb#107 + sig { params(direct: T::Boolean, transitive: T::Boolean).void } + def show_dot(direct: T.unsafe(nil), transitive: T.unsafe(nil)); end + + # Return the POSet as a DOT graph + # + # source://spoom//lib/spoom/poset.rb#116 + sig { params(direct: T::Boolean, transitive: T::Boolean).returns(::String) } + def to_dot(direct: T.unsafe(nil), transitive: T.unsafe(nil)); end +end + +# An element in a POSet +# +# source://spoom//lib/spoom/poset.rb#136 +class Spoom::Poset::Element + extend T::Generic + include ::Comparable + + E = type_member { { upper: Object } } + + # source://spoom//lib/spoom/poset.rb#152 + sig { params(value: E).void } + def initialize(value); end + + # source://spoom//lib/spoom/poset.rb#161 + sig { params(other: T.untyped).returns(T.nilable(::Integer)) } + def <=>(other); end + + # Direct and indirect ancestors of this element + # + # source://spoom//lib/spoom/poset.rb#180 + sig { returns(T::Array[E]) } + def ancestors; end + + # Direct children of this element + # + # source://spoom//lib/spoom/poset.rb#186 + sig { returns(T::Array[E]) } + def children; end + + # Direct and indirect descendants of this element + # + # source://spoom//lib/spoom/poset.rb#192 + sig { returns(T::Array[E]) } + def descendants; end + + # Edges (direct and indirect) from this element to other elements in the same POSet + # + # @return [Set] + # + # source://spoom//lib/spoom/poset.rb#149 + def dfroms; end + + # Edges (direct and indirect) from this element to other elements in the same POSet + # + # source://spoom//lib/spoom/poset.rb#149 + sig { returns(T::Set[Spoom::Poset::Element[E]]) } + def dtos; end + + # Edges (direct and indirect) from this element to other elements in the same POSet + # + # @return [Set] + # + # source://spoom//lib/spoom/poset.rb#149 + def froms; end + + # Direct parents of this element + # + # source://spoom//lib/spoom/poset.rb#174 + sig { returns(T::Array[E]) } + def parents; end + + # Edges (direct and indirect) from this element to other elements in the same POSet + # + # @return [Set] + # + # source://spoom//lib/spoom/poset.rb#149 + def tos; end + + # The value held by this element + # + # source://spoom//lib/spoom/poset.rb#145 + sig { returns(E) } + def value; end +end + +# source://spoom//lib/spoom/poset.rb#13 +class Spoom::Poset::Error < ::Spoom::Error; end + +# source://spoom//lib/spoom/printer.rb#7 +class Spoom::Printer + include ::Spoom::Colorize + + # source://spoom//lib/spoom/printer.rb#17 + sig { params(out: T.any(::IO, ::StringIO), colors: T::Boolean, indent_level: ::Integer).void } + def initialize(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil)); end + + # Colorize `string` with color if `@colors` + # + # source://spoom//lib/spoom/printer.rb#78 + sig { params(string: ::String, color: ::Spoom::Color).returns(::String) } + def colorize(string, *color); end + + # Decrease indent level + # + # source://spoom//lib/spoom/printer.rb#31 + sig { void } + def dedent; end + + # Increase indent level + # + # source://spoom//lib/spoom/printer.rb#25 + sig { void } + def indent; end + + # source://spoom//lib/spoom/printer.rb#14 + sig { returns(T.any(::IO, ::StringIO)) } + def out; end + + # @return [IO, StringIO] + # + # source://spoom//lib/spoom/printer.rb#14 + def out=(_arg0); end + + # Print `string` into `out` + # + # source://spoom//lib/spoom/printer.rb#37 + sig { params(string: T.nilable(::String)).void } + def print(string); end + + # Print `string` colored with `color` into `out` + # + # Does not use colors unless `@colors`. + # + # source://spoom//lib/spoom/printer.rb#47 + sig { params(string: T.nilable(::String), color: ::Spoom::Color).void } + def print_colored(string, *color); end + + # Print `string` with indent and newline + # + # source://spoom//lib/spoom/printer.rb#62 + sig { params(string: T.nilable(::String)).void } + def printl(string); end + + # Print a new line into `out` + # + # source://spoom//lib/spoom/printer.rb#56 + sig { void } + def printn; end + + # Print an indent space into `out` + # + # source://spoom//lib/spoom/printer.rb#72 + sig { void } + def printt; end +end + +# source://spoom//lib/spoom.rb#10 +Spoom::SPOOM_PATH = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/sorbet/config.rb#5 +module Spoom::Sorbet; end + +# source://spoom//lib/spoom/sorbet.rb#39 +Spoom::Sorbet::BIN_PATH = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/sorbet.rb#36 +Spoom::Sorbet::CONFIG_PATH = T.let(T.unsafe(nil), String) + +# Parse Sorbet config files +# +# Parses a Sorbet config file: +# +# ```ruby +# config = Spoom::Sorbet::Config.parse_file("sorbet/config") +# puts config.paths # "." +# ``` +# +# Parses a Sorbet config string: +# +# ```ruby +# config = Spoom::Sorbet::Config.parse_string(<<~CONFIG) +# a +# --file=b +# --ignore=c +# CONFIG +# puts config.paths # "a", "b" +# puts config.ignore # "c" +# ``` +# +# source://spoom//lib/spoom/sorbet/config.rb#26 +class Spoom::Sorbet::Config + # source://spoom//lib/spoom/sorbet/config.rb#38 + sig { void } + def initialize; end + + # @return [Array] + # + # source://spoom//lib/spoom/sorbet/config.rb#32 + def allowed_extensions; end + + # @return [Array] + # + # source://spoom//lib/spoom/sorbet/config.rb#32 + def allowed_extensions=(_arg0); end + + # source://spoom//lib/spoom/sorbet/config.rb#46 + sig { returns(::Spoom::Sorbet::Config) } + def copy; end + + # @return [Array] + # + # source://spoom//lib/spoom/sorbet/config.rb#32 + def ignore; end + + # @return [Array] + # + # source://spoom//lib/spoom/sorbet/config.rb#32 + def ignore=(_arg0); end + + # source://spoom//lib/spoom/sorbet/config.rb#35 + sig { returns(T::Boolean) } + def no_stdlib; end + + # @return [Boolean] + # + # source://spoom//lib/spoom/sorbet/config.rb#35 + def no_stdlib=(_arg0); end + + # Returns self as a string of options that can be passed to Sorbet + # + # Example: + # ~~~rb + # config = Sorbet::Config.new + # config.paths << "/foo" + # config.paths << "/bar" + # config.ignore << "/baz" + # config.allowed_extensions << ".rb" + # + # puts config.options_string # "/foo /bar --ignore /baz --allowed-extension .rb" + # ~~~ + # + # source://spoom//lib/spoom/sorbet/config.rb#68 + sig { returns(::String) } + def options_string; end + + # source://spoom//lib/spoom/sorbet/config.rb#32 + sig { returns(T::Array[::String]) } + def paths; end + + # @return [Array] + # + # source://spoom//lib/spoom/sorbet/config.rb#32 + def paths=(_arg0); end + + class << self + # source://spoom//lib/spoom/sorbet/config.rb#81 + sig { params(sorbet_config_path: ::String).returns(::Spoom::Sorbet::Config) } + def parse_file(sorbet_config_path); end + + # source://spoom//lib/spoom/sorbet/config.rb#86 + sig { params(sorbet_config: ::String).returns(::Spoom::Sorbet::Config) } + def parse_string(sorbet_config); end + + private + + # source://spoom//lib/spoom/sorbet/config.rb#150 + sig { params(line: ::String).returns(::String) } + def parse_option(line); end + end +end + +# source://spoom//lib/spoom/sorbet/config.rb#29 +Spoom::Sorbet::Config::DEFAULT_ALLOWED_EXTENSIONS = T.let(T.unsafe(nil), Array) + +# source://spoom//lib/spoom/sorbet.rb#14 +class Spoom::Sorbet::Error < ::Spoom::Error + # source://spoom//lib/spoom/sorbet.rb#29 + sig { params(message: ::String, result: ::Spoom::ExecResult).void } + def initialize(message, result); end + + # source://spoom//lib/spoom/sorbet.rb#21 + sig { returns(::Spoom::ExecResult) } + def result; end +end + +# source://spoom//lib/spoom/sorbet.rb#17 +class Spoom::Sorbet::Error::Killed < ::Spoom::Sorbet::Error; end + +# source://spoom//lib/spoom/sorbet.rb#18 +class Spoom::Sorbet::Error::Segfault < ::Spoom::Sorbet::Error; end + +# source://spoom//lib/spoom/sorbet/errors.rb#6 +module Spoom::Sorbet::Errors + class << self + # source://spoom//lib/spoom/sorbet/errors.rb#13 + sig { params(errors: T::Array[::Spoom::Sorbet::Errors::Error]).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } + def sort_errors_by_code(errors); end + end +end + +# source://spoom//lib/spoom/sorbet/errors.rb#7 +Spoom::Sorbet::Errors::DEFAULT_ERROR_URL_BASE = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/sorbet/errors.rb#127 +class Spoom::Sorbet::Errors::Error + include ::Comparable + + # source://spoom//lib/spoom/sorbet/errors.rb#153 + sig do + params( + file: T.nilable(::String), + line: T.nilable(::Integer), + message: T.nilable(::String), + code: T.nilable(::Integer), + more: T::Array[::String] + ).void + end + def initialize(file, line, message, code, more = T.unsafe(nil)); end + + # By default errors are sorted by location + # + # source://spoom//lib/spoom/sorbet/errors.rb#164 + sig { params(other: T.untyped).returns(::Integer) } + def <=>(other); end + + # @return [Integer, nil] + # + # source://spoom//lib/spoom/sorbet/errors.rb#135 + def code; end + + # source://spoom//lib/spoom/sorbet/errors.rb#132 + sig { returns(T.nilable(::String)) } + def file; end + + # Other files associated with the error + # + # source://spoom//lib/spoom/sorbet/errors.rb#142 + sig { returns(T::Set[::String]) } + def files_from_error_sections; end + + # source://spoom//lib/spoom/sorbet/errors.rb#135 + sig { returns(T.nilable(::Integer)) } + def line; end + + # @return [String, nil] + # + # source://spoom//lib/spoom/sorbet/errors.rb#132 + def message; end + + # source://spoom//lib/spoom/sorbet/errors.rb#138 + sig { returns(T::Array[::String]) } + def more; end + + # source://spoom//lib/spoom/sorbet/errors.rb#171 + sig { returns(::String) } + def to_s; end +end + +# Parse errors from Sorbet output +# +# source://spoom//lib/spoom/sorbet/errors.rb#18 +class Spoom::Sorbet::Errors::Parser + # source://spoom//lib/spoom/sorbet/errors.rb#45 + sig { params(error_url_base: ::String).void } + def initialize(error_url_base: T.unsafe(nil)); end + + # source://spoom//lib/spoom/sorbet/errors.rb#52 + sig { params(output: ::String).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } + def parse(output); end + + private + + # @raise [ParseError] + # + # source://spoom//lib/spoom/sorbet/errors.rb#116 + sig { params(line: ::String).void } + def append_error(line); end + + # @raise [ParseError] + # + # source://spoom//lib/spoom/sorbet/errors.rb#108 + sig { void } + def close_error; end + + # source://spoom//lib/spoom/sorbet/errors.rb#75 + sig { params(error_url_base: ::String).returns(::Regexp) } + def error_line_match_regexp(error_url_base); end + + # source://spoom//lib/spoom/sorbet/errors.rb#92 + sig { params(line: ::String).returns(T.nilable(::Spoom::Sorbet::Errors::Error)) } + def match_error_line(line); end + + # @raise [ParseError] + # + # source://spoom//lib/spoom/sorbet/errors.rb#101 + sig { params(error: ::Spoom::Sorbet::Errors::Error).void } + def open_error(error); end + + class << self + # source://spoom//lib/spoom/sorbet/errors.rb#38 + sig { params(output: ::String, error_url_base: ::String).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } + def parse_string(output, error_url_base: T.unsafe(nil)); end + end +end + +# source://spoom//lib/spoom/sorbet/errors.rb#23 +Spoom::Sorbet::Errors::Parser::HEADER = T.let(T.unsafe(nil), Array) + +# source://spoom//lib/spoom/sorbet/errors.rb#21 +class Spoom::Sorbet::Errors::Parser::ParseError < ::Spoom::Error; end + +# source://spoom//lib/spoom/sorbet.rb#37 +Spoom::Sorbet::GEM_PATH = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/sorbet.rb#38 +Spoom::Sorbet::GEM_VERSION = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/sorbet.rb#41 +Spoom::Sorbet::KILLED_CODE = T.let(T.unsafe(nil), Integer) + +# source://spoom//lib/spoom/sorbet/metrics.rb#8 +module Spoom::Sorbet::MetricsParser + class << self + # source://spoom//lib/spoom/sorbet/metrics.rb#15 + sig { params(path: ::String, prefix: ::String).returns(T::Hash[::String, ::Integer]) } + def parse_file(path, prefix = T.unsafe(nil)); end + + # source://spoom//lib/spoom/sorbet/metrics.rb#25 + sig { params(obj: T::Hash[::String, T.untyped], prefix: ::String).returns(T::Hash[::String, ::Integer]) } + def parse_hash(obj, prefix = T.unsafe(nil)); end + + # source://spoom//lib/spoom/sorbet/metrics.rb#20 + sig { params(string: ::String, prefix: ::String).returns(T::Hash[::String, ::Integer]) } + def parse_string(string, prefix = T.unsafe(nil)); end + end +end + +# source://spoom//lib/spoom/sorbet/metrics.rb#9 +Spoom::Sorbet::MetricsParser::DEFAULT_PREFIX = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/sorbet.rb#42 +Spoom::Sorbet::SEGFAULT_CODE = T.let(T.unsafe(nil), Integer) + +# source://spoom//lib/spoom/sorbet/sigils.rb#9 +module Spoom::Sorbet::Sigils + class << self + # changes the sigil in the file at the passed path to the specified new strictness + # + # source://spoom//lib/spoom/sorbet/sigils.rb#72 + sig { params(path: T.any(::Pathname, ::String), new_strictness: ::String).returns(T::Boolean) } + def change_sigil_in_file(path, new_strictness); end + + # changes the sigil to have a new strictness in a list of files + # + # source://spoom//lib/spoom/sorbet/sigils.rb#83 + sig { params(path_list: T::Array[::String], new_strictness: ::String).returns(T::Array[::String]) } + def change_sigil_in_files(path_list, new_strictness); end + + # returns a string containing the strictness of a sigil in a file at the passed path + # * returns nil if no sigil + # + # source://spoom//lib/spoom/sorbet/sigils.rb#63 + sig { params(path: T.any(::Pathname, ::String)).returns(T.nilable(::String)) } + def file_strictness(path); end + + # returns the full sigil comment string for the passed strictness + # + # source://spoom//lib/spoom/sorbet/sigils.rb#38 + sig { params(strictness: ::String).returns(::String) } + def sigil_string(strictness); end + + # returns the strictness of a sigil in the passed file content string (nil if no sigil) + # + # source://spoom//lib/spoom/sorbet/sigils.rb#50 + sig { params(content: ::String).returns(T.nilable(::String)) } + def strictness_in_content(content); end + + # returns a string which is the passed content but with the sigil updated to a new strictness + # + # source://spoom//lib/spoom/sorbet/sigils.rb#56 + sig { params(content: ::String, new_strictness: ::String).returns(::String) } + def update_sigil(content, new_strictness); end + + # returns true if the passed string is a valid strictness (else false) + # + # source://spoom//lib/spoom/sorbet/sigils.rb#44 + sig { params(strictness: ::String).returns(T::Boolean) } + def valid_strictness?(strictness); end + end +end + +# source://spoom//lib/spoom/sorbet/sigils.rb#31 +Spoom::Sorbet::Sigils::SIGIL_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://spoom//lib/spoom/sorbet/sigils.rb#13 +Spoom::Sorbet::Sigils::STRICTNESS_FALSE = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/sorbet/sigils.rb#12 +Spoom::Sorbet::Sigils::STRICTNESS_IGNORE = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/sorbet/sigils.rb#17 +Spoom::Sorbet::Sigils::STRICTNESS_INTERNAL = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/sorbet/sigils.rb#15 +Spoom::Sorbet::Sigils::STRICTNESS_STRICT = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/sorbet/sigils.rb#16 +Spoom::Sorbet::Sigils::STRICTNESS_STRONG = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/sorbet/sigils.rb#14 +Spoom::Sorbet::Sigils::STRICTNESS_TRUE = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/sorbet/sigils.rb#19 +Spoom::Sorbet::Sigils::VALID_STRICTNESS = T.let(T.unsafe(nil), Array) + +# source://spoom//lib/spoom/timeline.rb#5 +class Spoom::Timeline + # source://spoom//lib/spoom/timeline.rb#9 + sig { params(context: ::Spoom::Context, from: ::Time, to: ::Time).void } + def initialize(context, from, to); end + + # Return one commit for each date in `dates` + # + # source://spoom//lib/spoom/timeline.rb#36 + sig { params(dates: T::Array[::Time]).returns(T::Array[::Spoom::Git::Commit]) } + def commits_for_dates(dates); end + + # Return all months between `from` and `to` + # + # source://spoom//lib/spoom/timeline.rb#23 + sig { returns(T::Array[::Time]) } + def months; end + + # Return one commit for each month between `from` and `to` + # + # source://spoom//lib/spoom/timeline.rb#17 + sig { returns(T::Array[::Spoom::Git::Commit]) } + def ticks; end +end + +# source://spoom//lib/spoom/version.rb#5 +Spoom::VERSION = T.let(T.unsafe(nil), String) + +# source://spoom//lib/spoom/visitor.rb#7 +class Spoom::Visitor < ::Prism::Visitor + # source://spoom//lib/spoom/visitor.rb#16 + sig { override.params(node: ::Prism::AliasGlobalVariableNode).void } + def visit_alias_global_variable_node(node); end + + # source://spoom//lib/spoom/visitor.rb#21 + sig { override.params(node: ::Prism::AliasMethodNode).void } + def visit_alias_method_node(node); end + + # source://spoom//lib/spoom/visitor.rb#26 + sig { override.params(node: ::Prism::AlternationPatternNode).void } + def visit_alternation_pattern_node(node); end + + # source://spoom//lib/spoom/visitor.rb#31 + sig { override.params(node: ::Prism::AndNode).void } + def visit_and_node(node); end + + # source://spoom//lib/spoom/visitor.rb#36 + sig { override.params(node: ::Prism::ArgumentsNode).void } + def visit_arguments_node(node); end + + # source://spoom//lib/spoom/visitor.rb#41 + sig { override.params(node: ::Prism::ArrayNode).void } + def visit_array_node(node); end + + # source://spoom//lib/spoom/visitor.rb#46 + sig { override.params(node: ::Prism::ArrayPatternNode).void } + def visit_array_pattern_node(node); end + + # source://spoom//lib/spoom/visitor.rb#51 + sig { override.params(node: ::Prism::AssocNode).void } + def visit_assoc_node(node); end + + # source://spoom//lib/spoom/visitor.rb#56 + sig { override.params(node: ::Prism::AssocSplatNode).void } + def visit_assoc_splat_node(node); end + + # source://spoom//lib/spoom/visitor.rb#61 + sig { override.params(node: ::Prism::BackReferenceReadNode).void } + def visit_back_reference_read_node(node); end + + # source://spoom//lib/spoom/visitor.rb#66 + sig { override.params(node: ::Prism::BeginNode).void } + def visit_begin_node(node); end + + # source://spoom//lib/spoom/visitor.rb#71 + sig { override.params(node: ::Prism::BlockArgumentNode).void } + def visit_block_argument_node(node); end + + # source://spoom//lib/spoom/visitor.rb#76 + sig { override.params(node: ::Prism::BlockLocalVariableNode).void } + def visit_block_local_variable_node(node); end + + # source://spoom//lib/spoom/visitor.rb#81 + sig { override.params(node: ::Prism::BlockNode).void } + def visit_block_node(node); end + + # source://spoom//lib/spoom/visitor.rb#86 + sig { override.params(node: ::Prism::BlockParameterNode).void } + def visit_block_parameter_node(node); end + + # source://spoom//lib/spoom/visitor.rb#91 + sig { override.params(node: ::Prism::BlockParametersNode).void } + def visit_block_parameters_node(node); end + + # source://spoom//lib/spoom/visitor.rb#96 + sig { override.params(node: ::Prism::BreakNode).void } + def visit_break_node(node); end + + # source://spoom//lib/spoom/visitor.rb#101 + sig { override.params(node: ::Prism::CallAndWriteNode).void } + def visit_call_and_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#106 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end + + # source://spoom//lib/spoom/visitor.rb#111 + sig { override.params(node: ::Prism::CallOperatorWriteNode).void } + def visit_call_operator_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#116 + sig { override.params(node: ::Prism::CallOrWriteNode).void } + def visit_call_or_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#121 + sig { override.params(node: ::Prism::CallTargetNode).void } + def visit_call_target_node(node); end + + # source://spoom//lib/spoom/visitor.rb#126 + sig { override.params(node: ::Prism::CapturePatternNode).void } + def visit_capture_pattern_node(node); end + + # source://spoom//lib/spoom/visitor.rb#131 + sig { override.params(node: ::Prism::CaseMatchNode).void } + def visit_case_match_node(node); end + + # source://spoom//lib/spoom/visitor.rb#136 + sig { override.params(node: ::Prism::CaseNode).void } + def visit_case_node(node); end + + # source://spoom//lib/spoom/visitor.rb#11 + sig { override.params(node: ::Prism::Node).void } + def visit_child_nodes(node); end + + # source://spoom//lib/spoom/visitor.rb#141 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end + + # source://spoom//lib/spoom/visitor.rb#146 + sig { override.params(node: ::Prism::ClassVariableAndWriteNode).void } + def visit_class_variable_and_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#151 + sig { override.params(node: ::Prism::ClassVariableOperatorWriteNode).void } + def visit_class_variable_operator_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#156 + sig { override.params(node: ::Prism::ClassVariableOrWriteNode).void } + def visit_class_variable_or_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#161 + sig { override.params(node: ::Prism::ClassVariableReadNode).void } + def visit_class_variable_read_node(node); end + + # source://spoom//lib/spoom/visitor.rb#166 + sig { override.params(node: ::Prism::ClassVariableTargetNode).void } + def visit_class_variable_target_node(node); end + + # source://spoom//lib/spoom/visitor.rb#171 + sig { override.params(node: ::Prism::ClassVariableWriteNode).void } + def visit_class_variable_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#176 + sig { override.params(node: ::Prism::ConstantAndWriteNode).void } + def visit_constant_and_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#181 + sig { override.params(node: ::Prism::ConstantOperatorWriteNode).void } + def visit_constant_operator_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#186 + sig { override.params(node: ::Prism::ConstantOrWriteNode).void } + def visit_constant_or_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#191 + sig { override.params(node: ::Prism::ConstantPathAndWriteNode).void } + def visit_constant_path_and_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#196 + sig { override.params(node: ::Prism::ConstantPathNode).void } + def visit_constant_path_node(node); end + + # source://spoom//lib/spoom/visitor.rb#201 + sig { override.params(node: ::Prism::ConstantPathOperatorWriteNode).void } + def visit_constant_path_operator_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#206 + sig { override.params(node: ::Prism::ConstantPathOrWriteNode).void } + def visit_constant_path_or_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#211 + sig { override.params(node: ::Prism::ConstantPathTargetNode).void } + def visit_constant_path_target_node(node); end + + # source://spoom//lib/spoom/visitor.rb#216 + sig { override.params(node: ::Prism::ConstantPathWriteNode).void } + def visit_constant_path_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#221 + sig { override.params(node: ::Prism::ConstantReadNode).void } + def visit_constant_read_node(node); end + + # source://spoom//lib/spoom/visitor.rb#226 + sig { override.params(node: ::Prism::ConstantTargetNode).void } + def visit_constant_target_node(node); end + + # source://spoom//lib/spoom/visitor.rb#231 + sig { override.params(node: ::Prism::ConstantWriteNode).void } + def visit_constant_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#236 + sig { override.params(node: ::Prism::DefNode).void } + def visit_def_node(node); end + + # source://spoom//lib/spoom/visitor.rb#241 + sig { override.params(node: ::Prism::DefinedNode).void } + def visit_defined_node(node); end + + # source://spoom//lib/spoom/visitor.rb#246 + sig { override.params(node: ::Prism::ElseNode).void } + def visit_else_node(node); end + + # source://spoom//lib/spoom/visitor.rb#251 + sig { override.params(node: ::Prism::EmbeddedStatementsNode).void } + def visit_embedded_statements_node(node); end + + # source://spoom//lib/spoom/visitor.rb#256 + sig { override.params(node: ::Prism::EmbeddedVariableNode).void } + def visit_embedded_variable_node(node); end + + # source://spoom//lib/spoom/visitor.rb#261 + sig { override.params(node: ::Prism::EnsureNode).void } + def visit_ensure_node(node); end + + # source://spoom//lib/spoom/visitor.rb#266 + sig { override.params(node: ::Prism::FalseNode).void } + def visit_false_node(node); end + + # source://spoom//lib/spoom/visitor.rb#271 + sig { override.params(node: ::Prism::FindPatternNode).void } + def visit_find_pattern_node(node); end + + # source://spoom//lib/spoom/visitor.rb#276 + sig { override.params(node: ::Prism::FlipFlopNode).void } + def visit_flip_flop_node(node); end + + # source://spoom//lib/spoom/visitor.rb#281 + sig { override.params(node: ::Prism::FloatNode).void } + def visit_float_node(node); end + + # source://spoom//lib/spoom/visitor.rb#286 + sig { override.params(node: ::Prism::ForNode).void } + def visit_for_node(node); end + + # source://spoom//lib/spoom/visitor.rb#291 + sig { override.params(node: ::Prism::ForwardingArgumentsNode).void } + def visit_forwarding_arguments_node(node); end + + # source://spoom//lib/spoom/visitor.rb#296 + sig { override.params(node: ::Prism::ForwardingParameterNode).void } + def visit_forwarding_parameter_node(node); end + + # source://spoom//lib/spoom/visitor.rb#301 + sig { override.params(node: ::Prism::ForwardingSuperNode).void } + def visit_forwarding_super_node(node); end + + # source://spoom//lib/spoom/visitor.rb#306 + sig { override.params(node: ::Prism::GlobalVariableAndWriteNode).void } + def visit_global_variable_and_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#311 + sig { override.params(node: ::Prism::GlobalVariableOperatorWriteNode).void } + def visit_global_variable_operator_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#316 + sig { override.params(node: ::Prism::GlobalVariableOrWriteNode).void } + def visit_global_variable_or_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#321 + sig { override.params(node: ::Prism::GlobalVariableReadNode).void } + def visit_global_variable_read_node(node); end + + # source://spoom//lib/spoom/visitor.rb#326 + sig { override.params(node: ::Prism::GlobalVariableTargetNode).void } + def visit_global_variable_target_node(node); end + + # source://spoom//lib/spoom/visitor.rb#331 + sig { override.params(node: ::Prism::GlobalVariableWriteNode).void } + def visit_global_variable_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#336 + sig { override.params(node: ::Prism::HashNode).void } + def visit_hash_node(node); end + + # source://spoom//lib/spoom/visitor.rb#341 + sig { override.params(node: ::Prism::HashPatternNode).void } + def visit_hash_pattern_node(node); end + + # source://spoom//lib/spoom/visitor.rb#346 + sig { override.params(node: ::Prism::IfNode).void } + def visit_if_node(node); end + + # source://spoom//lib/spoom/visitor.rb#351 + sig { override.params(node: ::Prism::ImaginaryNode).void } + def visit_imaginary_node(node); end + + # source://spoom//lib/spoom/visitor.rb#356 + sig { override.params(node: ::Prism::ImplicitNode).void } + def visit_implicit_node(node); end + + # source://spoom//lib/spoom/visitor.rb#361 + sig { override.params(node: ::Prism::ImplicitRestNode).void } + def visit_implicit_rest_node(node); end + + # source://spoom//lib/spoom/visitor.rb#366 + sig { override.params(node: ::Prism::InNode).void } + def visit_in_node(node); end + + # source://spoom//lib/spoom/visitor.rb#371 + sig { override.params(node: ::Prism::IndexAndWriteNode).void } + def visit_index_and_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#376 + sig { override.params(node: ::Prism::IndexOperatorWriteNode).void } + def visit_index_operator_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#381 + sig { override.params(node: ::Prism::IndexOrWriteNode).void } + def visit_index_or_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#386 + sig { override.params(node: ::Prism::IndexTargetNode).void } + def visit_index_target_node(node); end + + # source://spoom//lib/spoom/visitor.rb#391 + sig { override.params(node: ::Prism::InstanceVariableAndWriteNode).void } + def visit_instance_variable_and_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#396 + sig { override.params(node: ::Prism::InstanceVariableOperatorWriteNode).void } + def visit_instance_variable_operator_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#401 + sig { override.params(node: ::Prism::InstanceVariableOrWriteNode).void } + def visit_instance_variable_or_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#406 + sig { override.params(node: ::Prism::InstanceVariableReadNode).void } + def visit_instance_variable_read_node(node); end + + # source://spoom//lib/spoom/visitor.rb#411 + sig { override.params(node: ::Prism::InstanceVariableTargetNode).void } + def visit_instance_variable_target_node(node); end + + # source://spoom//lib/spoom/visitor.rb#416 + sig { override.params(node: ::Prism::InstanceVariableWriteNode).void } + def visit_instance_variable_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#421 + sig { override.params(node: ::Prism::IntegerNode).void } + def visit_integer_node(node); end + + # source://spoom//lib/spoom/visitor.rb#426 + sig { override.params(node: ::Prism::InterpolatedMatchLastLineNode).void } + def visit_interpolated_match_last_line_node(node); end + + # source://spoom//lib/spoom/visitor.rb#431 + sig { override.params(node: ::Prism::InterpolatedRegularExpressionNode).void } + def visit_interpolated_regular_expression_node(node); end + + # source://spoom//lib/spoom/visitor.rb#436 + sig { override.params(node: ::Prism::InterpolatedStringNode).void } + def visit_interpolated_string_node(node); end + + # source://spoom//lib/spoom/visitor.rb#441 + sig { override.params(node: ::Prism::InterpolatedSymbolNode).void } + def visit_interpolated_symbol_node(node); end + + # source://spoom//lib/spoom/visitor.rb#446 + sig { override.params(node: ::Prism::InterpolatedXStringNode).void } + def visit_interpolated_x_string_node(node); end + + # source://spoom//lib/spoom/visitor.rb#451 + sig { override.params(node: ::Prism::KeywordHashNode).void } + def visit_keyword_hash_node(node); end + + # source://spoom//lib/spoom/visitor.rb#456 + sig { override.params(node: ::Prism::KeywordRestParameterNode).void } + def visit_keyword_rest_parameter_node(node); end + + # source://spoom//lib/spoom/visitor.rb#461 + sig { override.params(node: ::Prism::LambdaNode).void } + def visit_lambda_node(node); end + + # source://spoom//lib/spoom/visitor.rb#466 + sig { override.params(node: ::Prism::LocalVariableAndWriteNode).void } + def visit_local_variable_and_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#471 + sig { override.params(node: ::Prism::LocalVariableOperatorWriteNode).void } + def visit_local_variable_operator_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#476 + sig { override.params(node: ::Prism::LocalVariableOrWriteNode).void } + def visit_local_variable_or_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#481 + sig { override.params(node: ::Prism::LocalVariableReadNode).void } + def visit_local_variable_read_node(node); end + + # source://spoom//lib/spoom/visitor.rb#486 + sig { override.params(node: ::Prism::LocalVariableTargetNode).void } + def visit_local_variable_target_node(node); end + + # source://spoom//lib/spoom/visitor.rb#491 + sig { override.params(node: ::Prism::LocalVariableWriteNode).void } + def visit_local_variable_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#496 + sig { override.params(node: ::Prism::MatchLastLineNode).void } + def visit_match_last_line_node(node); end + + # source://spoom//lib/spoom/visitor.rb#501 + sig { override.params(node: ::Prism::MatchPredicateNode).void } + def visit_match_predicate_node(node); end + + # source://spoom//lib/spoom/visitor.rb#506 + sig { override.params(node: ::Prism::MatchRequiredNode).void } + def visit_match_required_node(node); end + + # source://spoom//lib/spoom/visitor.rb#511 + sig { override.params(node: ::Prism::MatchWriteNode).void } + def visit_match_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#516 + sig { override.params(node: ::Prism::MissingNode).void } + def visit_missing_node(node); end + + # source://spoom//lib/spoom/visitor.rb#521 + sig { override.params(node: ::Prism::ModuleNode).void } + def visit_module_node(node); end + + # source://spoom//lib/spoom/visitor.rb#526 + sig { override.params(node: ::Prism::MultiTargetNode).void } + def visit_multi_target_node(node); end + + # source://spoom//lib/spoom/visitor.rb#531 + sig { override.params(node: ::Prism::MultiWriteNode).void } + def visit_multi_write_node(node); end + + # source://spoom//lib/spoom/visitor.rb#536 + sig { override.params(node: ::Prism::NextNode).void } + def visit_next_node(node); end + + # source://spoom//lib/spoom/visitor.rb#541 + sig { override.params(node: ::Prism::NilNode).void } + def visit_nil_node(node); end + + # source://spoom//lib/spoom/visitor.rb#546 + sig { override.params(node: ::Prism::NoKeywordsParameterNode).void } + def visit_no_keywords_parameter_node(node); end + + # source://spoom//lib/spoom/visitor.rb#551 + sig { override.params(node: ::Prism::NumberedParametersNode).void } + def visit_numbered_parameters_node(node); end + + # source://spoom//lib/spoom/visitor.rb#556 + sig { override.params(node: ::Prism::NumberedReferenceReadNode).void } + def visit_numbered_reference_read_node(node); end + + # source://spoom//lib/spoom/visitor.rb#561 + sig { override.params(node: ::Prism::OptionalKeywordParameterNode).void } + def visit_optional_keyword_parameter_node(node); end + + # source://spoom//lib/spoom/visitor.rb#566 + sig { override.params(node: ::Prism::OptionalParameterNode).void } + def visit_optional_parameter_node(node); end + + # source://spoom//lib/spoom/visitor.rb#571 + sig { override.params(node: ::Prism::OrNode).void } + def visit_or_node(node); end + + # source://spoom//lib/spoom/visitor.rb#576 + sig { override.params(node: ::Prism::ParametersNode).void } + def visit_parameters_node(node); end + + # source://spoom//lib/spoom/visitor.rb#581 + sig { override.params(node: ::Prism::ParenthesesNode).void } + def visit_parentheses_node(node); end + + # source://spoom//lib/spoom/visitor.rb#586 + sig { override.params(node: ::Prism::PinnedExpressionNode).void } + def visit_pinned_expression_node(node); end + + # source://spoom//lib/spoom/visitor.rb#591 + sig { override.params(node: ::Prism::PinnedVariableNode).void } + def visit_pinned_variable_node(node); end + + # source://spoom//lib/spoom/visitor.rb#596 + sig { override.params(node: ::Prism::PostExecutionNode).void } + def visit_post_execution_node(node); end + + # source://spoom//lib/spoom/visitor.rb#601 + sig { override.params(node: ::Prism::PreExecutionNode).void } + def visit_pre_execution_node(node); end + + # source://spoom//lib/spoom/visitor.rb#606 + sig { override.params(node: ::Prism::ProgramNode).void } + def visit_program_node(node); end + + # source://spoom//lib/spoom/visitor.rb#611 + sig { override.params(node: ::Prism::RangeNode).void } + def visit_range_node(node); end + + # source://spoom//lib/spoom/visitor.rb#616 + sig { override.params(node: ::Prism::RationalNode).void } + def visit_rational_node(node); end + + # source://spoom//lib/spoom/visitor.rb#621 + sig { override.params(node: ::Prism::RedoNode).void } + def visit_redo_node(node); end + + # source://spoom//lib/spoom/visitor.rb#626 + sig { override.params(node: ::Prism::RegularExpressionNode).void } + def visit_regular_expression_node(node); end + + # source://spoom//lib/spoom/visitor.rb#631 + sig { override.params(node: ::Prism::RequiredKeywordParameterNode).void } + def visit_required_keyword_parameter_node(node); end + + # source://spoom//lib/spoom/visitor.rb#636 + sig { override.params(node: ::Prism::RequiredParameterNode).void } + def visit_required_parameter_node(node); end + + # source://spoom//lib/spoom/visitor.rb#641 + sig { override.params(node: ::Prism::RescueModifierNode).void } + def visit_rescue_modifier_node(node); end + + # source://spoom//lib/spoom/visitor.rb#646 + sig { override.params(node: ::Prism::RescueNode).void } + def visit_rescue_node(node); end + + # source://spoom//lib/spoom/visitor.rb#651 + sig { override.params(node: ::Prism::RestParameterNode).void } + def visit_rest_parameter_node(node); end + + # source://spoom//lib/spoom/visitor.rb#656 + sig { override.params(node: ::Prism::RetryNode).void } + def visit_retry_node(node); end + + # source://spoom//lib/spoom/visitor.rb#661 + sig { override.params(node: ::Prism::ReturnNode).void } + def visit_return_node(node); end + + # source://spoom//lib/spoom/visitor.rb#666 + sig { override.params(node: ::Prism::SelfNode).void } + def visit_self_node(node); end + + # source://spoom//lib/spoom/visitor.rb#671 + sig { override.params(node: ::Prism::SingletonClassNode).void } + def visit_singleton_class_node(node); end + + # source://spoom//lib/spoom/visitor.rb#676 + sig { override.params(node: ::Prism::SourceEncodingNode).void } + def visit_source_encoding_node(node); end + + # source://spoom//lib/spoom/visitor.rb#681 + sig { override.params(node: ::Prism::SourceFileNode).void } + def visit_source_file_node(node); end + + # source://spoom//lib/spoom/visitor.rb#686 + sig { override.params(node: ::Prism::SourceLineNode).void } + def visit_source_line_node(node); end + + # source://spoom//lib/spoom/visitor.rb#691 + sig { override.params(node: ::Prism::SplatNode).void } + def visit_splat_node(node); end + + # source://spoom//lib/spoom/visitor.rb#696 + sig { override.params(node: ::Prism::StatementsNode).void } + def visit_statements_node(node); end + + # source://spoom//lib/spoom/visitor.rb#701 + sig { override.params(node: ::Prism::StringNode).void } + def visit_string_node(node); end + + # source://spoom//lib/spoom/visitor.rb#706 + sig { override.params(node: ::Prism::SuperNode).void } + def visit_super_node(node); end + + # source://spoom//lib/spoom/visitor.rb#711 + sig { override.params(node: ::Prism::SymbolNode).void } + def visit_symbol_node(node); end + + # source://spoom//lib/spoom/visitor.rb#716 + sig { override.params(node: ::Prism::TrueNode).void } + def visit_true_node(node); end + + # source://spoom//lib/spoom/visitor.rb#721 + sig { override.params(node: ::Prism::UndefNode).void } + def visit_undef_node(node); end + + # source://spoom//lib/spoom/visitor.rb#726 + sig { override.params(node: ::Prism::UnlessNode).void } + def visit_unless_node(node); end + + # source://spoom//lib/spoom/visitor.rb#731 + sig { override.params(node: ::Prism::UntilNode).void } + def visit_until_node(node); end + + # source://spoom//lib/spoom/visitor.rb#736 + sig { override.params(node: ::Prism::WhenNode).void } + def visit_when_node(node); end + + # source://spoom//lib/spoom/visitor.rb#741 + sig { override.params(node: ::Prism::WhileNode).void } + def visit_while_node(node); end + + # source://spoom//lib/spoom/visitor.rb#746 + sig { override.params(node: ::Prism::XStringNode).void } + def visit_x_string_node(node); end + + # source://spoom//lib/spoom/visitor.rb#751 + sig { override.params(node: ::Prism::YieldNode).void } + def visit_yield_node(node); end +end diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/tapioca@0.15.1.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/tapioca@0.15.1.rbi new file mode 100644 index 0000000..bafa82e --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/tapioca@0.15.1.rbi @@ -0,0 +1,3562 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `tapioca` gem. +# Please instead update this file by running `bin/tapioca gem tapioca`. + + +class Bundler::Dependency < ::Gem::Dependency + include ::Tapioca::BundlerExt::AutoRequireHook +end + +# source://tapioca//lib/tapioca/helpers/git_attributes.rb#4 +class GitAttributes + class << self + # source://tapioca//lib/tapioca/helpers/git_attributes.rb#9 + sig { params(path: ::Pathname).void } + def create_generated_attribute_file(path); end + + # source://tapioca//lib/tapioca/helpers/git_attributes.rb#16 + sig { params(path: ::Pathname).void } + def create_vendored_attribute_file(path); end + + private + + # source://tapioca//lib/tapioca/helpers/git_attributes.rb#25 + sig { params(path: ::Pathname, content: ::String).void } + def create_gitattributes_file(path, content); end + end +end + +# We need to do the alias-method-chain dance since Bootsnap does the same, +# and prepended modules and alias-method-chain don't play well together. +# +# So, why does Bootsnap do alias-method-chain and not prepend? Glad you asked! +# That's because RubyGems does alias-method-chain for Kernel#require and such, +# so, if Bootsnap were to do prepend, it might end up breaking RubyGems. +# +# source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#68 +class Module + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#101 + def append_features(constant); end + + # source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#71 + def autoload(const_name, path); end + + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#111 + def extend_object(obj); end + + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#91 + def prepend_features(constant); end +end + +# source://tapioca//lib/tapioca/rbi_ext/model.rb#4 +module RBI; end + +# source://tapioca//lib/tapioca/rbi_ext/model.rb#5 +class RBI::Tree < ::RBI::NodeWithComments + # source://rbi/0.1.14/lib/rbi/model.rb#121 + sig do + params( + loc: T.nilable(::RBI::Loc), + comments: 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 + + # source://rbi/0.1.14/lib/rbi/model.rb#128 + sig { params(node: ::RBI::Node).void } + def <<(node); end + + # source://rbi/0.1.14/lib/rbi/rewriters/add_sig_templates.rb#66 + sig { params(with_todo_comment: T::Boolean).void } + def add_sig_templates!(with_todo_comment: T.unsafe(nil)); end + + # source://rbi/0.1.14/lib/rbi/rewriters/annotate.rb#49 + 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 + + # source://tapioca//lib/tapioca/rbi_ext/model.rb#38 + sig do + params( + name: ::String, + superclass_name: T.nilable(::String), + block: T.nilable(T.proc.params(scope: ::RBI::Scope).void) + ).returns(::RBI::Scope) + end + def create_class(name, superclass_name: T.unsafe(nil), &block); end + + # source://tapioca//lib/tapioca/rbi_ext/model.rb#45 + sig { params(name: ::String, value: ::String).void } + def create_constant(name, value:); end + + # source://tapioca//lib/tapioca/rbi_ext/model.rb#55 + sig { params(name: ::String).void } + def create_extend(name); end + + # source://tapioca//lib/tapioca/rbi_ext/model.rb#50 + sig { params(name: ::String).void } + def create_include(name); end + + # source://tapioca//lib/tapioca/rbi_ext/model.rb#89 + sig do + params( + name: ::String, + parameters: T::Array[::RBI::TypedParam], + return_type: ::String, + class_method: T::Boolean, + visibility: ::RBI::Visibility, + comments: T::Array[::RBI::Comment] + ).void + end + def create_method(name, parameters: T.unsafe(nil), return_type: T.unsafe(nil), class_method: T.unsafe(nil), visibility: T.unsafe(nil), comments: T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/rbi_ext/model.rb#113 + sig do + params( + name: ::String, + sigs: T::Array[::RBI::Sig], + parameters: T::Array[::RBI::Param], + class_method: T::Boolean, + visibility: ::RBI::Visibility, + comments: T::Array[::RBI::Comment] + ).void + end + def create_method_with_sigs(name, sigs:, parameters: T.unsafe(nil), class_method: T.unsafe(nil), visibility: T.unsafe(nil), comments: T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/rbi_ext/model.rb#60 + sig { params(name: ::String).void } + def create_mixes_in_class_methods(name); end + + # source://tapioca//lib/tapioca/rbi_ext/model.rb#25 + sig { params(name: ::String, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) } + def create_module(name, &block); end + + # source://tapioca//lib/tapioca/rbi_ext/model.rb#9 + sig { params(constant: ::Module, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) } + def create_path(constant, &block); end + + # source://tapioca//lib/tapioca/rbi_ext/model.rb#135 + sig do + params( + parameters: T::Hash[T.any(::String, ::Symbol), ::String], + type_parameters: T::Array[::String], + return_type: ::String + ).returns(::RBI::Sig) + end + def create_sig(parameters:, type_parameters: T.unsafe(nil), return_type: T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/rbi_ext/model.rb#74 + sig do + params( + name: ::String, + type: ::String, + variance: ::Symbol, + fixed: T.nilable(::String), + upper: T.nilable(::String), + lower: T.nilable(::String) + ).void + end + def create_type_variable(name, type:, variance: T.unsafe(nil), fixed: T.unsafe(nil), upper: T.unsafe(nil), lower: T.unsafe(nil)); end + + # source://rbi/0.1.14/lib/rbi/rewriters/deannotate.rb#41 + sig { params(annotation: ::String).void } + def deannotate!(annotation); end + + # source://rbi/0.1.14/lib/rbi/model.rb#134 + sig { returns(T::Boolean) } + def empty?; end + + # source://rbi/0.1.14/lib/rbi/rewriters/filter_versions.rb#118 + sig { params(version: ::Gem::Version).void } + def filter_versions!(version); end + + # source://rbi/0.1.14/lib/rbi/rewriters/group_nodes.rb#81 + sig { void } + def group_nodes!; end + + # source://rbi/0.1.14/lib/rbi/index.rb#68 + sig { returns(::RBI::Index) } + def index; end + + # source://rbi/0.1.14/lib/rbi/rewriters/merge_trees.rb#324 + 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 + + # source://rbi/0.1.14/lib/rbi/rewriters/nest_non_public_methods.rb#46 + sig { void } + def nest_non_public_methods!; end + + # source://rbi/0.1.14/lib/rbi/rewriters/nest_singleton_methods.rb#36 + sig { void } + def nest_singleton_methods!; end + + # source://rbi/0.1.14/lib/rbi/model.rb#112 + sig { returns(T::Array[::RBI::Node]) } + def nodes; end + + # source://rbi/0.1.14/lib/rbi/rewriters/attr_to_methods.rb#53 + sig { void } + def replace_attributes_with_methods!; end + + # source://rbi/0.1.14/lib/rbi/rewriters/sort_nodes.rb#119 + sig { void } + def sort_nodes!; end + + private + + # source://tapioca//lib/tapioca/rbi_ext/model.rb#150 + sig { params(node: ::RBI::Node).returns(::RBI::Node) } + def create_node(node); end + + # source://tapioca//lib/tapioca/rbi_ext/model.rb#145 + sig { returns(T::Hash[::String, ::RBI::Node]) } + def nodes_cache; end +end + +# source://tapioca//lib/tapioca/rbi_ext/model.rb#160 +class RBI::TypedParam < ::T::Struct + const :param, ::RBI::Param + const :type, ::String + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#5 +module T::Generic + include ::Kernel + + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#13 + def [](*types); end + + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#47 + def has_attached_class!(variance = T.unsafe(nil), &bounds_proc); end + + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#21 + def type_member(variance = T.unsafe(nil), &bounds_proc); end + + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#34 + def type_template(variance = T.unsafe(nil), &bounds_proc); end +end + +# This module intercepts calls to generic type instantiations and type variable definitions. +# Tapioca stores the data from those calls in a `GenericTypeRegistry` which can then be used +# to look up the original call details when we are trying to do code generation. +# +# We are interested in the data of the `[]`, `type_member` and `type_template` calls which +# are all needed to generate good generic information at runtime. +# +# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#12 +module T::Generic::TypeStoragePatch + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#13 + def [](*types); end + + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#47 + def has_attached_class!(variance = T.unsafe(nil), &bounds_proc); end + + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#21 + def type_member(variance = T.unsafe(nil), &bounds_proc); end + + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#34 + def type_template(variance = T.unsafe(nil), &bounds_proc); end +end + +# source://tapioca//lib/tapioca/sorbet_ext/proc_bind_patch.rb#28 +module T::Private::Methods + class << self + # source://tapioca//lib/tapioca/sorbet_ext/proc_bind_patch.rb#30 + def finalize_proc(decl); end + end +end + +class T::Private::Methods::Declaration < ::Struct + def bind; end + def bind=(_); end + def checked; end + def checked=(_); end + def finalized; end + def finalized=(_); end + def mod; end + def mod=(_); end + def mode; end + def mode=(_); end + def on_failure; end + def on_failure=(_); end + def override_allow_incompatible; end + def override_allow_incompatible=(_); end + def params; end + def params=(_); end + def raw; end + def raw=(_); end + def returns; end + def returns=(_); end + def type_parameters; end + def type_parameters=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +class T::Private::Methods::DeclarationBlock < ::Struct + def blk; end + def blk=(_); end + def final; end + def final=(_); end + def loc; end + def loc=(_); end + def mod; end + def mod=(_); end + def raw; end + def raw=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# source://tapioca//lib/tapioca/sorbet_ext/proc_bind_patch.rb#29 +module T::Private::Methods::ProcBindPatch + # source://tapioca//lib/tapioca/sorbet_ext/proc_bind_patch.rb#30 + def finalize_proc(decl); end +end + +class T::Types::Proc < ::T::Types::Base; end + +# source://tapioca//lib/tapioca/sorbet_ext/proc_bind_patch.rb#6 +module T::Types::ProcBindPatch + # source://tapioca//lib/tapioca/sorbet_ext/proc_bind_patch.rb#7 + def initialize(arg_types, returns, bind = T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/sorbet_ext/proc_bind_patch.rb#15 + def name; end +end + +# source://tapioca//lib/tapioca/sorbet_ext/name_patch.rb#6 +class T::Types::Simple < ::T::Types::Base + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#70 + def name; end +end + +# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#65 +module T::Types::Simple::GenericPatch + # This method intercepts calls to the `name` method for simple types, so that + # it can ask the name to the type if the type is generic, since, by this point, + # we've created a clone of that type with the `name` method returning the + # appropriate name for that specific concrete type. + # + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#70 + def name; end +end + +# source://tapioca//lib/tapioca/sorbet_ext/name_patch.rb#7 +module T::Types::Simple::NamePatch + # source://tapioca//lib/tapioca/sorbet_ext/name_patch.rb#10 + def name; end + + # source://tapioca//lib/tapioca/sorbet_ext/name_patch.rb#16 + def qualified_name_of(constant); end +end + +# source://tapioca//lib/tapioca/sorbet_ext/name_patch.rb#8 +T::Types::Simple::NamePatch::NAME_METHOD = T.let(T.unsafe(nil), UnboundMethod) + +# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#87 +module T::Utils::Private + class << self + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#89 + def coerce_and_check_module_types(val, check_val, check_module_type); end + end +end + +# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#88 +module T::Utils::Private::PrivateCoercePatch + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#89 + def coerce_and_check_module_types(val, check_val, check_module_type); end +end + +# source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#4 +module Tapioca + class << self + # source://tapioca//lib/tapioca.rb#20 + sig do + type_parameters(:Result) + .params( + blk: T.proc.returns(T.type_parameter(:Result)) + ).returns(T.type_parameter(:Result)) + end + def silence_warnings(&blk); end + end +end + +# source://tapioca//lib/tapioca.rb#38 +Tapioca::BINARY_FILE = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca/bundler_ext/auto_require_hook.rb#5 +module Tapioca::BundlerExt; end + +# This is a module that gets prepended to `Bundler::Dependency` and +# makes sure even gems marked as `require: false` are required during +# `Bundler.require`. +# +# source://tapioca//lib/tapioca/bundler_ext/auto_require_hook.rb#9 +module Tapioca::BundlerExt::AutoRequireHook + requires_ancestor { Bundler::Dependency } + + # source://tapioca//lib/tapioca/bundler_ext/auto_require_hook.rb#46 + sig { returns(T.untyped) } + def autorequire; end + + class << self + # @return [Boolean] + # + # source://tapioca//lib/tapioca/bundler_ext/auto_require_hook.rb#26 + def enabled?; end + + # source://tapioca//lib/tapioca/bundler_ext/auto_require_hook.rb#22 + sig { params(name: T.untyped).returns(T::Boolean) } + def excluded?(name); end + + # source://tapioca//lib/tapioca/bundler_ext/auto_require_hook.rb#36 + sig do + type_parameters(:Result) + .params( + exclude: T::Array[::String], + blk: T.proc.returns(T.type_parameter(:Result)) + ).returns(T.type_parameter(:Result)) + end + def override_require_false(exclude:, &blk); end + end +end + +# source://tapioca//lib/tapioca.rb#61 +Tapioca::CENTRAL_REPO_ANNOTATIONS_DIR = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca.rb#60 +Tapioca::CENTRAL_REPO_INDEX_PATH = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca.rb#59 +Tapioca::CENTRAL_REPO_ROOT_URI = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca/cli.rb#5 +class Tapioca::Cli < ::Thor + include ::Tapioca::CliHelper + include ::Tapioca::ConfigHelper + include ::Tapioca::EnvHelper + + # source://tapioca//lib/tapioca/cli.rb#366 + def __print_version; end + + # source://tapioca//lib/tapioca/cli.rb#348 + def annotations; end + + # source://tapioca//lib/tapioca/cli.rb#320 + def check_shims; end + + # source://tapioca//lib/tapioca/cli.rb#46 + def configure; end + + # source://tapioca//lib/tapioca/cli.rb#147 + def dsl(*constant_or_paths); end + + # @raise [MalformattedArgumentError] + # + # source://tapioca//lib/tapioca/cli.rb#264 + def gem(*gems); end + + # source://tapioca//lib/tapioca/cli.rb#27 + def init; end + + # source://tapioca//lib/tapioca/cli.rb#57 + def require; end + + # source://tapioca//lib/tapioca/cli.rb#74 + def todo; end + + private + + # source://tapioca//lib/tapioca/cli.rb#380 + def print_init_next_steps; end + + class << self + # source://tapioca//lib/tapioca/cli.rb#372 + def exit_on_failure?; end + end +end + +# source://tapioca//lib/tapioca/cli.rb#10 +Tapioca::Cli::FILE_HEADER_OPTION_DESC = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca/helpers/cli_helper.rb#5 +module Tapioca::CliHelper + requires_ancestor { Thor::Shell } + + # source://tapioca//lib/tapioca/helpers/cli_helper.rb#33 + sig { params(options: T::Hash[::Symbol, T.untyped]).returns(T.nilable(::String)) } + def netrc_file(options); end + + # source://tapioca//lib/tapioca/helpers/cli_helper.rb#26 + sig { params(options: T::Hash[::Symbol, T.untyped]).returns(::Tapioca::RBIFormatter) } + def rbi_formatter(options); end + + # source://tapioca//lib/tapioca/helpers/cli_helper.rb#12 + sig { params(message: ::String, color: T.any(::Symbol, T::Array[::Symbol])).void } + def say_error(message = T.unsafe(nil), *color); end +end + +# source://tapioca//lib/tapioca/commands.rb#5 +module Tapioca::Commands; end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://tapioca//lib/tapioca/commands/abstract_dsl.rb#6 +class Tapioca::Commands::AbstractDsl < ::Tapioca::Commands::CommandWithoutTracker + include ::Tapioca::SorbetHelper + include ::Tapioca::RBIFilesHelper + + abstract! + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#33 + sig do + params( + requested_constants: T::Array[::String], + requested_paths: T::Array[::Pathname], + outpath: ::Pathname, + only: T::Array[::String], + exclude: T::Array[::String], + file_header: T::Boolean, + tapioca_path: ::String, + skip_constant: T::Array[::String], + quiet: T::Boolean, + verbose: T::Boolean, + number_of_workers: T.nilable(::Integer), + auto_strictness: T::Boolean, + gem_dir: ::String, + rbi_formatter: ::Tapioca::RBIFormatter, + app_root: ::String, + halt_upon_load_error: T::Boolean, + compiler_options: T::Hash[::String, T.untyped] + ).void + end + def initialize(requested_constants:, requested_paths:, outpath:, only:, exclude:, file_header:, tapioca_path:, skip_constant: T.unsafe(nil), quiet: T.unsafe(nil), verbose: T.unsafe(nil), number_of_workers: T.unsafe(nil), auto_strictness: T.unsafe(nil), gem_dir: T.unsafe(nil), rbi_formatter: T.unsafe(nil), app_root: T.unsafe(nil), halt_upon_load_error: T.unsafe(nil), compiler_options: T.unsafe(nil)); end + + private + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#100 + sig { returns(T::Array[::String]) } + def all_requested_constants; end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#293 + sig { params(cause: ::Symbol, files: T::Array[::String]).returns(::String) } + def build_error_for_files(cause, files); end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#217 + sig do + params( + constant_name: ::String, + rbi: ::RBI::File, + outpath: ::Pathname, + quiet: T::Boolean + ).returns(T.nilable(::Pathname)) + end + def compile_dsl_rbi(constant_name, rbi, outpath: T.unsafe(nil), quiet: T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#154 + sig { params(constant_names: T::Array[::String], ignore_missing: T::Boolean).returns(T::Array[::Module]) } + def constantize(constant_names, ignore_missing: T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#177 + sig { params(compiler_names: T::Array[::String]).returns(T::Array[T.class_of(Tapioca::Dsl::Compiler)]) } + def constantize_compilers(compiler_names); end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#353 + sig { returns(T::Array[::String]) } + def constants_from_requested_paths; end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#123 + sig { returns(::Tapioca::Dsl::Pipeline) } + def create_pipeline; end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#256 + sig { params(constant_name: ::String).returns(::Pathname) } + def dsl_rbi_filename(constant_name); end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#140 + sig { params(requested_constants: T::Array[::String], path: ::Pathname).returns(T::Set[::Pathname]) } + def existing_rbi_filenames(requested_constants, path: T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#348 + sig { params(constant: ::String).returns(::String) } + def generate_command_for(constant); end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#76 + sig { params(outpath: ::Pathname, quiet: T::Boolean).returns(T::Set[::Pathname]) } + def generate_dsl_rbi_files(outpath, quiet:); end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#113 + sig { void } + def load_application; end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#235 + sig { params(dir: ::Pathname).void } + def perform_dsl_verification(dir); end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#108 + sig { returns(::Tapioca::Dsl::Pipeline) } + def pipeline; end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#244 + sig { params(files: T::Set[::Pathname]).void } + def purge_stale_dsl_rbi_files(files); end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#343 + sig { params(constant: ::String).returns(::String) } + def rbi_filename_for(constant); end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#324 + sig { params(path: ::Pathname).returns(T::Array[::Pathname]) } + def rbi_files_in(path); end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#302 + sig { params(diff: T::Hash[::String, ::Symbol], command: ::Symbol).void } + def report_diff_and_exit_if_out_of_date(diff, command); end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#197 + sig { params(name: ::String).returns(T.nilable(T.class_of(Tapioca::Dsl::Compiler))) } + def resolve(name); end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#331 + sig { params(class_name: ::String).returns(::String) } + def underscore(class_name); end + + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#261 + sig { params(tmp_dir: ::Pathname).returns(T::Hash[::String, ::Symbol]) } + def verify_dsl_rbi(tmp_dir:); end +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://tapioca//lib/tapioca/commands/abstract_gem.rb#6 +class Tapioca::Commands::AbstractGem < ::Tapioca::Commands::Command + include ::Tapioca::SorbetHelper + include ::Tapioca::RBIFilesHelper + + abstract! + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#32 + sig do + params( + gem_names: T::Array[::String], + exclude: T::Array[::String], + include_dependencies: T::Boolean, + prerequire: T.nilable(::String), + postrequire: ::String, + typed_overrides: T::Hash[::String, ::String], + outpath: ::Pathname, + file_header: T::Boolean, + include_doc: T::Boolean, + include_loc: T::Boolean, + include_exported_rbis: T::Boolean, + number_of_workers: T.nilable(::Integer), + auto_strictness: T::Boolean, + dsl_dir: ::String, + rbi_formatter: ::Tapioca::RBIFormatter, + halt_upon_load_error: T::Boolean + ).void + end + def initialize(gem_names:, exclude:, include_dependencies:, prerequire:, postrequire:, typed_overrides:, outpath:, file_header:, include_doc:, include_loc:, include_exported_rbis:, number_of_workers: T.unsafe(nil), auto_strictness: T.unsafe(nil), dsl_dir: T.unsafe(nil), rbi_formatter: T.unsafe(nil), halt_upon_load_error: T.unsafe(nil)); end + + private + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#223 + sig { returns(T::Array[::String]) } + def added_rbis; end + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#284 + sig { params(cause: ::Symbol, files: T::Array[::String]).returns(::String) } + def build_error_for_files(cause, files); end + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#110 + sig { params(gem: ::Tapioca::Gemfile::GemSpec).void } + def compile_gem_rbi(gem); end + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#218 + sig { params(gem_name: ::String).returns(::Pathname) } + def existing_rbi(gem_name); end + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#266 + sig { returns(T::Hash[::String, ::String]) } + def existing_rbis; end + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#230 + sig { params(gem_name: ::String).returns(::Pathname) } + def expected_rbi(gem_name); end + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#272 + sig { returns(T::Hash[::String, ::String]) } + def expected_rbis; end + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#98 + sig do + params( + gem: ::Tapioca::Gemfile::GemSpec, + dependencies: T::Array[::Tapioca::Gemfile::GemSpec] + ).returns(T::Array[::Tapioca::Gemfile::GemSpec]) + end + def gem_dependencies(gem, dependencies = T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#235 + sig { params(gem_name: ::String).returns(T::Boolean) } + def gem_rbi_exists?(gem_name); end + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#279 + sig { params(gem_name: ::String, version: ::String).returns(::Pathname) } + def gem_rbi_filename(gem_name, version); end + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#77 + sig { params(gem_names: T::Array[::String]).returns(T::Array[::Tapioca::Gemfile::GemSpec]) } + def gems_to_generate(gem_names); end + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#289 + sig { params(gem: ::Tapioca::Gemfile::GemSpec, file: ::RBI::File).void } + def merge_with_exported_rbi(gem, file); end + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#260 + sig { params(old_filename: ::Pathname, new_filename: ::Pathname).void } + def move(old_filename, new_filename); end + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#170 + sig { void } + def perform_additions; end + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#143 + sig { void } + def perform_removals; end + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#213 + sig { returns(T::Array[::String]) } + def removed_rbis; end + + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#240 + sig { params(diff: T::Hash[::String, ::Symbol], command: ::Symbol).void } + def report_diff_and_exit_if_out_of_date(diff, command); end +end + +# source://tapioca//lib/tapioca/commands/annotations.rb#6 +class Tapioca::Commands::Annotations < ::Tapioca::Commands::CommandWithoutTracker + # source://tapioca//lib/tapioca/commands/annotations.rb#18 + sig do + params( + central_repo_root_uris: T::Array[::String], + auth: T.nilable(::String), + netrc_file: T.nilable(::String), + central_repo_index_path: ::String, + typed_overrides: T::Hash[::String, ::String] + ).void + end + def initialize(central_repo_root_uris:, auth: T.unsafe(nil), netrc_file: T.unsafe(nil), central_repo_index_path: T.unsafe(nil), typed_overrides: T.unsafe(nil)); end + + private + + # source://tapioca//lib/tapioca/commands/annotations.rb#197 + sig { params(name: ::String, content: ::String).returns(::String) } + def add_header(name, content); end + + # source://tapioca//lib/tapioca/commands/annotations.rb#217 + sig { params(name: ::String, content: ::String).returns(::String) } + def apply_typed_override(name, content); end + + # source://tapioca//lib/tapioca/commands/annotations.rb#39 + sig { override.void } + def execute; end + + # source://tapioca//lib/tapioca/commands/annotations.rb#136 + sig { params(repo_uris: T::Array[::String], gem_info: ::Tapioca::GemInfo).void } + def fetch_annotation(repo_uris, gem_info); end + + # source://tapioca//lib/tapioca/commands/annotations.rb#113 + sig { params(project_gems: T::Array[::Tapioca::GemInfo]).returns(T::Array[::String]) } + def fetch_annotations(project_gems); end + + # source://tapioca//lib/tapioca/commands/annotations.rb#156 + sig { params(repo_uri: ::String, path: ::String).returns(T.nilable(::String)) } + def fetch_file(repo_uri, path); end + + # source://tapioca//lib/tapioca/commands/annotations.rb#173 + sig { params(repo_uri: ::String, path: ::String).returns(T.nilable(::String)) } + def fetch_http_file(repo_uri, path); end + + # source://tapioca//lib/tapioca/commands/annotations.rb#102 + sig { params(repo_uri: ::String, repo_number: T.nilable(::Integer)).returns(T.nilable(Tapioca::RepoIndex)) } + def fetch_index(repo_uri, repo_number:); end + + # source://tapioca//lib/tapioca/commands/annotations.rb#81 + sig { returns(T::Hash[::String, Tapioca::RepoIndex]) } + def fetch_indexes; end + + # source://tapioca//lib/tapioca/commands/annotations.rb#165 + sig { params(repo_uri: ::String, path: ::String).returns(T.nilable(::String)) } + def fetch_local_file(repo_uri, path); end + + # source://tapioca//lib/tapioca/commands/annotations.rb#229 + sig { params(gem_version: ::Gem::Version, content: ::String).returns(::String) } + def filter_versions(gem_version, content); end + + # source://tapioca//lib/tapioca/commands/annotations.rb#50 + sig { returns(T::Array[::Tapioca::GemInfo]) } + def list_gemfile_gems; end + + # source://tapioca//lib/tapioca/commands/annotations.rb#237 + sig { params(gem_name: ::String, contents: T::Array[::String]).returns(T.nilable(::String)) } + def merge_files(gem_name, contents); end + + # source://tapioca//lib/tapioca/commands/annotations.rb#60 + sig { params(project_gems: T::Array[::Tapioca::GemInfo]).void } + def remove_expired_annotations(project_gems); end + + # source://tapioca//lib/tapioca/commands/annotations.rb#264 + sig { returns(T::Hash[::String, T.nilable(::String)]) } + def repo_tokens; end + + # source://tapioca//lib/tapioca/commands/annotations.rb#292 + sig { params(path: ::String, repo_uri: ::String, message: ::String).void } + def say_http_error(path, repo_uri, message:); end + + # source://tapioca//lib/tapioca/commands/annotations.rb#276 + sig { params(repo_uri: ::String).returns(T.nilable(::String)) } + def token_for(repo_uri); end +end + +# source://tapioca//lib/tapioca/commands/check_shims.rb#6 +class Tapioca::Commands::CheckShims < ::Tapioca::Commands::CommandWithoutTracker + include ::Tapioca::SorbetHelper + include ::Tapioca::RBIFilesHelper + + # source://tapioca//lib/tapioca/commands/check_shims.rb#22 + sig do + params( + gem_rbi_dir: ::String, + dsl_rbi_dir: ::String, + annotations_rbi_dir: ::String, + shim_rbi_dir: ::String, + todo_rbi_file: ::String, + payload: T::Boolean, + number_of_workers: T.nilable(::Integer) + ).void + end + def initialize(gem_rbi_dir:, dsl_rbi_dir:, annotations_rbi_dir:, shim_rbi_dir:, todo_rbi_file:, payload:, number_of_workers:); end + + private + + # source://tapioca//lib/tapioca/commands/check_shims.rb#44 + sig { override.void } + def execute; end +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://tapioca//lib/tapioca/commands/command.rb#6 +class Tapioca::Commands::Command + include ::Thor::Base + include ::Thor::Invocation + include ::Thor::Shell + include ::Tapioca::CliHelper + extend ::Thor::Base::ClassMethods + extend ::Thor::Invocation::ClassMethods + + abstract! + + # source://tapioca//lib/tapioca/commands/command.rb#20 + sig { void } + def initialize; end + + # source://thor/1.3.2/lib/thor/base.rb#155 + sig { returns(::Thor::Actions) } + def file_writer; end + + # source://tapioca//lib/tapioca/commands/command.rb#25 + sig(:final) { void } + def run; end + + private + + # source://tapioca//lib/tapioca/commands/command.rb#53 + sig do + params( + path: T.any(::Pathname, ::String), + content: ::String, + force: T::Boolean, + skip: T::Boolean, + verbose: T::Boolean + ).void + end + def create_file(path, content, force: T.unsafe(nil), skip: T.unsafe(nil), verbose: T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/commands/command.rb#37 + sig { params(command: ::Symbol, args: ::String).returns(::String) } + def default_command(command, *args); end + + # @abstract + # + # source://tapioca//lib/tapioca/commands/command.rb#34 + sig { abstract.void } + def execute; end + + # source://tapioca//lib/tapioca/commands/command.rb#63 + sig { params(path: T.any(::Pathname, ::String), verbose: T::Boolean).void } + def remove_file(path, verbose: T.unsafe(nil)); end +end + +# source://tapioca//lib/tapioca/commands/command.rb#10 +class Tapioca::Commands::Command::FileWriter < ::Thor + include ::Thor::Actions + extend ::Thor::Actions::ClassMethods +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://tapioca//lib/tapioca/commands/command_without_tracker.rb#6 +class Tapioca::Commands::CommandWithoutTracker < ::Tapioca::Commands::Command + abstract! + + # source://tapioca//lib/tapioca/commands/command_without_tracker.rb#12 + sig { void } + def initialize; end +end + +# source://tapioca//lib/tapioca/commands/configure.rb#6 +class Tapioca::Commands::Configure < ::Tapioca::Commands::CommandWithoutTracker + # source://tapioca//lib/tapioca/commands/configure.rb#14 + sig { params(sorbet_config: ::String, tapioca_config: ::String, default_postrequire: ::String).void } + def initialize(sorbet_config:, tapioca_config:, default_postrequire:); end + + private + + # source://tapioca//lib/tapioca/commands/configure.rb#79 + sig { void } + def create_binstub; end + + # source://tapioca//lib/tapioca/commands/configure.rb#69 + sig { void } + def create_post_require; end + + # source://tapioca//lib/tapioca/commands/configure.rb#40 + sig { void } + def create_sorbet_config; end + + # source://tapioca//lib/tapioca/commands/configure.rb#50 + sig { void } + def create_tapioca_config; end + + # source://tapioca//lib/tapioca/commands/configure.rb#32 + sig { override.void } + def execute; end + + # source://tapioca//lib/tapioca/commands/configure.rb#92 + sig { returns(::Bundler::Installer) } + def installer; end + + # source://tapioca//lib/tapioca/commands/configure.rb#97 + sig { returns(T.any(::Bundler::StubSpecification, ::Gem::Specification)) } + def spec; end +end + +# source://tapioca//lib/tapioca/commands/dsl_compiler_list.rb#6 +class Tapioca::Commands::DslCompilerList < ::Tapioca::Commands::AbstractDsl + private + + # source://tapioca//lib/tapioca/commands/dsl_compiler_list.rb#10 + sig { override.void } + def execute; end +end + +# source://tapioca//lib/tapioca/commands/dsl_generate.rb#6 +class Tapioca::Commands::DslGenerate < ::Tapioca::Commands::AbstractDsl + private + + # source://tapioca//lib/tapioca/commands/dsl_generate.rb#10 + sig { override.void } + def execute; end +end + +# source://tapioca//lib/tapioca/commands/dsl_verify.rb#6 +class Tapioca::Commands::DslVerify < ::Tapioca::Commands::AbstractDsl + private + + # source://tapioca//lib/tapioca/commands/dsl_verify.rb#10 + sig { override.void } + def execute; end +end + +# source://tapioca//lib/tapioca/commands/gem_generate.rb#6 +class Tapioca::Commands::GemGenerate < ::Tapioca::Commands::AbstractGem + private + + # source://tapioca//lib/tapioca/commands/gem_generate.rb#10 + sig { override.void } + def execute; end +end + +# source://tapioca//lib/tapioca/commands/gem_sync.rb#6 +class Tapioca::Commands::GemSync < ::Tapioca::Commands::AbstractGem + private + + # source://tapioca//lib/tapioca/commands/gem_sync.rb#10 + sig { override.void } + def execute; end +end + +# source://tapioca//lib/tapioca/commands/gem_verify.rb#6 +class Tapioca::Commands::GemVerify < ::Tapioca::Commands::AbstractGem + private + + # source://tapioca//lib/tapioca/commands/gem_verify.rb#10 + sig { override.void } + def execute; end + + # source://tapioca//lib/tapioca/commands/gem_verify.rb#17 + sig { void } + def perform_sync_verification; end +end + +# source://tapioca//lib/tapioca/commands/require.rb#6 +class Tapioca::Commands::Require < ::Tapioca::Commands::CommandWithoutTracker + # source://tapioca//lib/tapioca/commands/require.rb#13 + sig { params(requires_path: ::String, sorbet_config_path: ::String).void } + def initialize(requires_path:, sorbet_config_path:); end + + private + + # source://tapioca//lib/tapioca/commands/require.rb#23 + sig { override.void } + def execute; end +end + +# source://tapioca//lib/tapioca/commands/todo.rb#6 +class Tapioca::Commands::Todo < ::Tapioca::Commands::CommandWithoutTracker + include ::Tapioca::SorbetHelper + + # source://tapioca//lib/tapioca/commands/todo.rb#26 + sig { params(todo_file: ::String, file_header: T::Boolean).void } + def initialize(todo_file:, file_header:); end + + # source://tapioca//lib/tapioca/commands/todo.rb#34 + sig { void } + def run_with_deprecation; end + + private + + # source://tapioca//lib/tapioca/commands/todo.rb#44 + sig { override.void } + def execute; end + + # source://tapioca//lib/tapioca/commands/todo.rb#68 + sig { params(constants: T::Array[::String], command: ::String).returns(::RBI::File) } + def rbi(constants, command:); end + + # source://tapioca//lib/tapioca/commands/todo.rb#88 + sig { returns(T::Array[::String]) } + def unresolved_constants; end +end + +# source://tapioca//lib/tapioca/commands/todo.rb#9 +Tapioca::Commands::Todo::DEPRECATION_MESSAGE = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca/helpers/config_helper.rb#5 +module Tapioca::ConfigHelper + requires_ancestor { Thor } + + # source://tapioca//lib/tapioca/helpers/config_helper.rb#18 + sig { params(args: T.untyped, local_options: T.untyped, config: T.untyped).void } + def initialize(args = T.unsafe(nil), local_options = T.unsafe(nil), config = T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/helpers/config_helper.rb#12 + sig { returns(::String) } + def command_name; end + + # source://tapioca//lib/tapioca/helpers/config_helper.rb#15 + sig { returns(::Thor::CoreExt::HashWithIndifferentAccess) } + def defaults; end + + # source://tapioca//lib/tapioca/helpers/config_helper.rb#34 + sig { returns(::Thor::CoreExt::HashWithIndifferentAccess) } + def options; end + + private + + # source://tapioca//lib/tapioca/helpers/config_helper.rb#153 + sig { params(msg: ::String).returns(::Tapioca::ConfigHelper::ConfigError) } + def build_error(msg); end + + # source://tapioca//lib/tapioca/helpers/config_helper.rb#178 + sig { params(config_file: ::String, errors: T::Array[::Tapioca::ConfigHelper::ConfigError]).returns(::String) } + def build_error_message(config_file, errors); end + + # source://tapioca//lib/tapioca/helpers/config_helper.rb#56 + sig do + params( + options: ::Thor::CoreExt::HashWithIndifferentAccess + ).returns(::Thor::CoreExt::HashWithIndifferentAccess) + end + def config_options(options); end + + # source://tapioca//lib/tapioca/helpers/config_helper.rb#46 + sig { params(options: T::Hash[::Symbol, ::Thor::Option]).void } + def filter_defaults(options); end + + # source://tapioca//lib/tapioca/helpers/config_helper.rb#196 + sig do + params( + options: T.nilable(::Thor::CoreExt::HashWithIndifferentAccess) + ).returns(::Thor::CoreExt::HashWithIndifferentAccess) + end + def merge_options(*options); end + + # source://tapioca//lib/tapioca/helpers/config_helper.rb#70 + sig { params(config_file: ::String, config: T::Hash[T.untyped, T.untyped]).void } + def validate_config!(config_file, config); end + + # source://tapioca//lib/tapioca/helpers/config_helper.rb#102 + sig do + params( + command_options: T::Hash[::Symbol, ::Thor::Option], + config_key: ::String, + config_options: T::Hash[T.untyped, T.untyped] + ).returns(T::Array[::Tapioca::ConfigHelper::ConfigError]) + end + def validate_config_options(command_options, config_key, config_options); end +end + +# source://tapioca//lib/tapioca/helpers/config_helper.rb#148 +class Tapioca::ConfigHelper::ConfigError < ::T::Struct + const :message_parts, T::Array[::Tapioca::ConfigHelper::ConfigErrorMessagePart] + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://tapioca//lib/tapioca/helpers/config_helper.rb#143 +class Tapioca::ConfigHelper::ConfigErrorMessagePart < ::T::Struct + const :message, ::String + const :colors, T::Array[::Symbol] + + class << self + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://tapioca//lib/tapioca.rb#45 +Tapioca::DEFAULT_ANNOTATIONS_DIR = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca.rb#41 +Tapioca::DEFAULT_DSL_DIR = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca.rb#57 +Tapioca::DEFAULT_ENVIRONMENT = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca.rb#42 +Tapioca::DEFAULT_GEM_DIR = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca.rb#47 +Tapioca::DEFAULT_OVERRIDES = T.let(T.unsafe(nil), Hash) + +# source://tapioca//lib/tapioca.rb#39 +Tapioca::DEFAULT_POSTREQUIRE_FILE = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca.rb#40 +Tapioca::DEFAULT_RBI_DIR = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca/rbi_formatter.rb#31 +Tapioca::DEFAULT_RBI_FORMATTER = T.let(T.unsafe(nil), Tapioca::RBIFormatter) + +# source://tapioca//lib/tapioca.rb#56 +Tapioca::DEFAULT_RBI_MAX_LINE_LENGTH = T.let(T.unsafe(nil), Integer) + +# source://tapioca//lib/tapioca.rb#43 +Tapioca::DEFAULT_SHIM_DIR = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca.rb#44 +Tapioca::DEFAULT_TODO_FILE = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca/dsl/compilers.rb#5 +module Tapioca::Dsl; end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://tapioca//lib/tapioca/dsl/compiler.rb#6 +class Tapioca::Dsl::Compiler + extend T::Generic + include ::Tapioca::SorbetHelper + include ::Tapioca::RBIHelper + include ::Tapioca::Runtime::AttachedClassOf + include ::Tapioca::Runtime::Reflection + extend ::Tapioca::Runtime::AttachedClassOf + extend ::Tapioca::Runtime::Reflection + + abstract! + + ConstantType = type_member { { upper: Module } } + + # source://tapioca//lib/tapioca/dsl/compiler.rb#74 + sig do + params( + pipeline: ::Tapioca::Dsl::Pipeline, + root: ::RBI::Tree, + constant: ConstantType, + options: T::Hash[::String, T.untyped] + ).void + end + def initialize(pipeline, root, constant, options = T.unsafe(nil)); end + + # NOTE: This should eventually accept an `Error` object or `Exception` rather than simply a `String`. + # + # source://tapioca//lib/tapioca/dsl/compiler.rb#92 + sig { params(error: ::String).void } + def add_error(error); end + + # source://tapioca//lib/tapioca/dsl/compiler.rb#83 + sig { params(compiler_name: ::String).returns(T::Boolean) } + def compiler_enabled?(compiler_name); end + + # source://tapioca//lib/tapioca/dsl/compiler.rb#20 + sig { returns(ConstantType) } + def constant; end + + # @abstract + # + # source://tapioca//lib/tapioca/dsl/compiler.rb#88 + sig { abstract.void } + def decorate; end + + # source://tapioca//lib/tapioca/dsl/compiler.rb#26 + sig { returns(T::Hash[::String, T.untyped]) } + def options; end + + # source://tapioca//lib/tapioca/dsl/compiler.rb#23 + sig { returns(::RBI::Tree) } + def root; end + + private + + # source://tapioca//lib/tapioca/dsl/compiler.rb#141 + sig { params(method_def: T.any(::Method, ::UnboundMethod)).returns(T::Array[::RBI::TypedParam]) } + def compile_method_parameters_to_rbi(method_def); end + + # source://tapioca//lib/tapioca/dsl/compiler.rb#177 + sig { params(method_def: T.any(::Method, ::UnboundMethod)).returns(::String) } + def compile_method_return_type_to_rbi(method_def); end + + # source://tapioca//lib/tapioca/dsl/compiler.rb#131 + sig { params(scope: ::RBI::Scope, method_def: T.any(::Method, ::UnboundMethod), class_method: T::Boolean).void } + def create_method_from_def(scope, method_def, class_method: T.unsafe(nil)); end + + # Get the types of each parameter from a method signature + # + # source://tapioca//lib/tapioca/dsl/compiler.rb#105 + sig { params(method_def: T.any(::Method, ::UnboundMethod), signature: T.untyped).returns(T::Array[::String]) } + def parameters_types_from_signature(method_def, signature); end + + class << self + # @abstract + # + # source://tapioca//lib/tapioca/dsl/compiler.rb#37 + sig { abstract.returns(T::Enumerable[::Module]) } + def gather_constants; end + + # source://tapioca//lib/tapioca/dsl/compiler.rb#32 + sig { params(constant: ::Module).returns(T::Boolean) } + def handles?(constant); end + + # source://tapioca//lib/tapioca/dsl/compiler.rb#40 + sig { returns(T::Set[::Module]) } + def processable_constants; end + + private + + # source://tapioca//lib/tapioca/dsl/compiler.rb#50 + sig { returns(T::Enumerable[T::Class[T.anything]]) } + def all_classes; end + + # source://tapioca//lib/tapioca/dsl/compiler.rb#58 + sig { returns(T::Enumerable[::Module]) } + def all_modules; end + end +end + +# source://tapioca//lib/tapioca/dsl/compilers.rb#6 +module Tapioca::Dsl::Compilers; end + +# DSL compilers are either built-in to Tapioca and live under the +# `Tapioca::Dsl::Compilers` namespace (i.e. this namespace), and +# can be referred to by just using the class name, or they live in +# a different namespace and can only be referred to using their fully +# qualified name. This constant encapsulates that dual lookup when +# a compiler needs to be resolved by name. +# +# source://tapioca//lib/tapioca/dsl/compilers.rb#13 +Tapioca::Dsl::Compilers::NAMESPACES = T.let(T.unsafe(nil), Array) + +# source://tapioca//lib/tapioca/dsl/pipeline.rb#6 +class Tapioca::Dsl::Pipeline + # source://tapioca//lib/tapioca/dsl/pipeline.rb#39 + sig do + params( + requested_constants: T::Array[::Module], + requested_paths: T::Array[::Pathname], + requested_compilers: T::Array[T.class_of(Tapioca::Dsl::Compiler)], + excluded_compilers: T::Array[T.class_of(Tapioca::Dsl::Compiler)], + error_handler: T.proc.params(error: ::String).void, + skipped_constants: T::Array[::Module], + number_of_workers: T.nilable(::Integer), + compiler_options: T::Hash[::String, T.untyped] + ).void + end + def initialize(requested_constants:, requested_paths: T.unsafe(nil), requested_compilers: T.unsafe(nil), excluded_compilers: T.unsafe(nil), error_handler: T.unsafe(nil), skipped_constants: T.unsafe(nil), number_of_workers: T.unsafe(nil), compiler_options: T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/dsl/pipeline.rb#10 + sig { returns(T::Enumerable[T.class_of(Tapioca::Dsl::Compiler)]) } + def active_compilers; end + + # source://tapioca//lib/tapioca/dsl/pipeline.rb#102 + sig { params(error: ::String).void } + def add_error(error); end + + # source://tapioca//lib/tapioca/dsl/pipeline.rb#107 + sig { params(compiler_name: ::String).returns(T::Boolean) } + def compiler_enabled?(compiler_name); end + + # source://tapioca//lib/tapioca/dsl/pipeline.rb#116 + sig { returns(T::Array[T.class_of(Tapioca::Dsl::Compiler)]) } + def compilers; end + + # source://tapioca//lib/tapioca/dsl/pipeline.rb#22 + sig { returns(T.proc.params(error: ::String).void) } + def error_handler; end + + # source://tapioca//lib/tapioca/dsl/pipeline.rb#25 + sig { returns(T::Array[::String]) } + def errors; end + + # source://tapioca//lib/tapioca/dsl/pipeline.rb#13 + sig { returns(T::Array[::Module]) } + def requested_constants; end + + # source://tapioca//lib/tapioca/dsl/pipeline.rb#16 + sig { returns(T::Array[::Pathname]) } + def requested_paths; end + + # source://tapioca//lib/tapioca/dsl/pipeline.rb#67 + sig do + type_parameters(:T) + .params( + blk: T.proc.params(constant: ::Module, rbi: ::RBI::File).returns(T.type_parameter(:T)) + ).returns(T::Array[T.type_parameter(:T)]) + end + def run(&blk); end + + # source://tapioca//lib/tapioca/dsl/pipeline.rb#19 + sig { returns(T::Array[::Module]) } + def skipped_constants; end + + private + + # source://tapioca//lib/tapioca/dsl/pipeline.rb#223 + sig { void } + def abort_if_pending_migrations!; end + + # source://tapioca//lib/tapioca/dsl/pipeline.rb#168 + sig { params(constants: T::Set[::Module]).returns(T::Set[::Module]) } + def filter_anonymous_and_reloaded_constants(constants); end + + # source://tapioca//lib/tapioca/dsl/pipeline.rb#133 + sig do + params( + requested_compilers: T::Array[T.class_of(Tapioca::Dsl::Compiler)], + excluded_compilers: T::Array[T.class_of(Tapioca::Dsl::Compiler)] + ).returns(T::Enumerable[T.class_of(Tapioca::Dsl::Compiler)]) + end + def gather_active_compilers(requested_compilers, excluded_compilers); end + + # source://tapioca//lib/tapioca/dsl/pipeline.rb#147 + sig do + params( + requested_constants: T::Array[::Module], + requested_paths: T::Array[::Pathname], + skipped_constants: T::Array[::Module] + ).returns(T::Set[::Module]) + end + def gather_constants(requested_constants, requested_paths, skipped_constants); end + + # source://tapioca//lib/tapioca/dsl/pipeline.rb#197 + sig { params(constant: ::Module).returns(T.nilable(::RBI::File)) } + def rbi_for_constant(constant); end + + # source://tapioca//lib/tapioca/dsl/pipeline.rb#216 + sig { params(error: ::String).returns(T.noreturn) } + def report_error(error); end +end + +# source://tapioca//lib/tapioca/helpers/env_helper.rb#5 +module Tapioca::EnvHelper + requires_ancestor { Thor } + + # source://tapioca//lib/tapioca/helpers/env_helper.rb#12 + sig { params(options: T::Hash[::Symbol, T.untyped]).void } + def set_environment(options); end +end + +class Tapioca::Error < ::StandardError; end + +# source://tapioca//lib/tapioca/executor.rb#5 +class Tapioca::Executor + # source://tapioca//lib/tapioca/executor.rb#11 + sig { params(queue: T::Array[T.untyped], number_of_workers: T.nilable(::Integer)).void } + def initialize(queue, number_of_workers: T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/executor.rb#28 + sig do + type_parameters(:T) + .params( + block: T.proc.params(item: T.untyped).returns(T.type_parameter(:T)) + ).returns(T::Array[T.type_parameter(:T)]) + end + def run_in_parallel(&block); end + + private + + # source://tapioca//lib/tapioca/executor.rb#37 + sig { returns(::Integer) } + def max_processors; end +end + +# source://tapioca//lib/tapioca/executor.rb#8 +Tapioca::Executor::MINIMUM_ITEMS_PER_WORKER = T.let(T.unsafe(nil), Integer) + +# source://tapioca//lib/tapioca/gem/events.rb#5 +module Tapioca::Gem; end + +# source://tapioca//lib/tapioca/gem/events.rb#77 +class Tapioca::Gem::ConstNodeAdded < ::Tapioca::Gem::NodeAdded + # source://tapioca//lib/tapioca/gem/events.rb#84 + sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Const).void } + def initialize(symbol, constant, node); end + + # source://tapioca//lib/tapioca/gem/events.rb#81 + sig { returns(::RBI::Const) } + def node; end +end + +# source://tapioca//lib/tapioca/gem/events.rb#26 +class Tapioca::Gem::ConstantFound < ::Tapioca::Gem::Event + # source://tapioca//lib/tapioca/gem/events.rb#36 + sig { params(symbol: ::String, constant: ::BasicObject).void } + def initialize(symbol, constant); end + + # source://tapioca//lib/tapioca/gem/events.rb#33 + sig { returns(::BasicObject) } + def constant; end + + # source://tapioca//lib/tapioca/gem/events.rb#30 + sig { returns(::String) } + def symbol; end +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://tapioca//lib/tapioca/gem/events.rb#6 +class Tapioca::Gem::Event + abstract! +end + +# source://tapioca//lib/tapioca/gem/events.rb#43 +class Tapioca::Gem::ForeignConstantFound < ::Tapioca::Gem::ConstantFound + # source://tapioca//lib/tapioca/gem/events.rb#52 + sig { params(symbol: ::String, constant: ::Module).void } + def initialize(symbol, constant); end + + # source://tapioca//lib/tapioca/gem/events.rb#47 + sig { override.returns(::Module) } + def constant; end +end + +# source://tapioca//lib/tapioca/gem/events.rb#103 +class Tapioca::Gem::ForeignScopeNodeAdded < ::Tapioca::Gem::ScopeNodeAdded; end + +# source://tapioca//lib/tapioca/gem/listeners/base.rb#6 +module Tapioca::Gem::Listeners; end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://tapioca//lib/tapioca/gem/listeners/base.rb#7 +class Tapioca::Gem::Listeners::Base + abstract! + + # source://tapioca//lib/tapioca/gem/listeners/base.rb#14 + sig { params(pipeline: ::Tapioca::Gem::Pipeline).void } + def initialize(pipeline); end + + # source://tapioca//lib/tapioca/gem/listeners/base.rb#19 + sig { params(event: ::Tapioca::Gem::NodeAdded).void } + def dispatch(event); end + + private + + # source://tapioca//lib/tapioca/gem/listeners/base.rb#49 + sig { params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } + def ignore?(event); end + + # source://tapioca//lib/tapioca/gem/listeners/base.rb#37 + sig { params(event: ::Tapioca::Gem::ConstNodeAdded).void } + def on_const(event); end + + # source://tapioca//lib/tapioca/gem/listeners/base.rb#45 + sig { params(event: ::Tapioca::Gem::MethodNodeAdded).void } + def on_method(event); end + + # source://tapioca//lib/tapioca/gem/listeners/base.rb#41 + sig { params(event: ::Tapioca::Gem::ScopeNodeAdded).void } + def on_scope(event); end +end + +# source://tapioca//lib/tapioca/gem/listeners/dynamic_mixins.rb#7 +class Tapioca::Gem::Listeners::DynamicMixins < ::Tapioca::Gem::Listeners::Base + include ::Tapioca::Runtime::AttachedClassOf + include ::Tapioca::Runtime::Reflection + + private + + # source://tapioca//lib/tapioca/gem/listeners/dynamic_mixins.rb#31 + sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } + def ignore?(event); end + + # source://tapioca//lib/tapioca/gem/listeners/dynamic_mixins.rb#15 + sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } + def on_scope(event); end +end + +# source://tapioca//lib/tapioca/gem/listeners/foreign_constants.rb#7 +class Tapioca::Gem::Listeners::ForeignConstants < ::Tapioca::Gem::Listeners::Base + include ::Tapioca::Runtime::AttachedClassOf + include ::Tapioca::Runtime::Reflection + + private + + # source://tapioca//lib/tapioca/gem/listeners/foreign_constants.rb#60 + sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } + def ignore?(event); end + + # source://tapioca//lib/tapioca/gem/listeners/foreign_constants.rb#55 + sig { params(location: ::String).returns(T::Boolean) } + def mixed_in_by_gem?(location); end + + # source://tapioca//lib/tapioca/gem/listeners/foreign_constants.rb#15 + sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } + def on_scope(event); end +end + +# source://tapioca//lib/tapioca/gem/listeners/methods.rb#7 +class Tapioca::Gem::Listeners::Methods < ::Tapioca::Gem::Listeners::Base + include ::Tapioca::SorbetHelper + include ::Tapioca::RBIHelper + include ::Tapioca::Runtime::AttachedClassOf + include ::Tapioca::Runtime::Reflection + + private + + # source://tapioca//lib/tapioca/gem/listeners/methods.rb#35 + sig do + params( + tree: ::RBI::Tree, + module_name: ::String, + mod: ::Module, + for_visibility: T::Array[::Symbol], + attached_class: T.nilable(::Module) + ).void + end + def compile_directly_owned_methods(tree, module_name, mod, for_visibility = T.unsafe(nil), attached_class: T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/gem/listeners/methods.rb#71 + sig do + params( + tree: ::RBI::Tree, + symbol_name: ::String, + constant: ::Module, + method: T.nilable(::UnboundMethod), + visibility: ::RBI::Visibility + ).void + end + def compile_method(tree, symbol_name, constant, method, visibility = T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/gem/listeners/methods.rb#211 + sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } + def ignore?(event); end + + # source://tapioca//lib/tapioca/gem/listeners/methods.rb#204 + sig { params(constant: ::Module).returns(T.nilable(::UnboundMethod)) } + def initialize_method_for(constant); end + + # source://tapioca//lib/tapioca/gem/listeners/methods.rb#172 + sig { params(mod: ::Module).returns(T::Hash[::Symbol, T::Array[::Symbol]]) } + def method_names_by_visibility(mod); end + + # source://tapioca//lib/tapioca/gem/listeners/methods.rb#196 + sig { params(attached_class: T.nilable(::Module), method_name: ::Symbol).returns(T.nilable(T::Boolean)) } + def method_new_in_abstract_class?(attached_class, method_name); end + + # Check whether the method is defined by the constant. + # + # In most cases, it works to check that the constant is the method owner. However, + # in the case that a method is also defined in a module prepended to the constant, it + # will be owned by the prepended module, not the constant. + # + # This method implements a better way of checking whether a constant defines a method. + # It walks up the ancestor tree via the `super_method` method; if any of the super + # methods are owned by the constant, it means that the constant declares the method. + # + # source://tapioca//lib/tapioca/gem/listeners/methods.rb#158 + sig { params(method: ::UnboundMethod, constant: ::Module).returns(T::Boolean) } + def method_owned_by_constant?(method, constant); end + + # source://tapioca//lib/tapioca/gem/listeners/methods.rb#16 + sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } + def on_scope(event); end + + # source://tapioca//lib/tapioca/gem/listeners/methods.rb#181 + sig { params(constant: ::Module, method_name: ::String).returns(T::Boolean) } + def struct_method?(constant, method_name); end +end + +# source://tapioca//lib/tapioca/gem/listeners/mixins.rb#7 +class Tapioca::Gem::Listeners::Mixins < ::Tapioca::Gem::Listeners::Base + include ::Tapioca::Runtime::AttachedClassOf + include ::Tapioca::Runtime::Reflection + + private + + # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#42 + sig do + params( + tree: ::RBI::Tree, + constant: ::Module, + mods: T::Array[::Module], + mixin_type: ::Tapioca::Runtime::Trackers::Mixin::Type + ).void + end + def add_mixins(tree, constant, mods, mixin_type); end + + # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#84 + sig { params(mixin_name: ::String).returns(T::Boolean) } + def filtered_mixin?(mixin_name); end + + # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#91 + sig { params(constant: ::Module).returns(T::Array[::Module]) } + def interesting_ancestors_of(constant); end + + # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#75 + sig do + params( + constant: ::Module, + mixin: ::Module, + mixin_type: ::Tapioca::Runtime::Trackers::Mixin::Type + ).returns(T::Boolean) + end + def mixed_in_by_gem?(constant, mixin, mixin_type); end + + # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#15 + sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } + def on_scope(event); end +end + +# source://tapioca//lib/tapioca/gem/listeners/remove_empty_payload_scopes.rb#7 +class Tapioca::Gem::Listeners::RemoveEmptyPayloadScopes < ::Tapioca::Gem::Listeners::Base + include ::Tapioca::Runtime::AttachedClassOf + include ::Tapioca::Runtime::Reflection + + private + + # source://tapioca//lib/tapioca/gem/listeners/remove_empty_payload_scopes.rb#20 + sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } + def ignore?(event); end + + # source://tapioca//lib/tapioca/gem/listeners/remove_empty_payload_scopes.rb#15 + sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } + def on_scope(event); end +end + +# source://tapioca//lib/tapioca/gem/listeners/sorbet_enums.rb#7 +class Tapioca::Gem::Listeners::SorbetEnums < ::Tapioca::Gem::Listeners::Base + private + + # source://tapioca//lib/tapioca/gem/listeners/sorbet_enums.rb#25 + sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } + def ignore?(event); end + + # source://tapioca//lib/tapioca/gem/listeners/sorbet_enums.rb#13 + sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } + def on_scope(event); end +end + +# source://tapioca//lib/tapioca/gem/listeners/sorbet_helpers.rb#7 +class Tapioca::Gem::Listeners::SorbetHelpers < ::Tapioca::Gem::Listeners::Base + include ::Tapioca::Runtime::AttachedClassOf + include ::Tapioca::Runtime::Reflection + + private + + # source://tapioca//lib/tapioca/gem/listeners/sorbet_helpers.rb#27 + sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } + def ignore?(event); end + + # source://tapioca//lib/tapioca/gem/listeners/sorbet_helpers.rb#15 + sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } + def on_scope(event); end +end + +# source://tapioca//lib/tapioca/gem/listeners/sorbet_props.rb#7 +class Tapioca::Gem::Listeners::SorbetProps < ::Tapioca::Gem::Listeners::Base + include ::Tapioca::SorbetHelper + include ::Tapioca::RBIHelper + + private + + # source://tapioca//lib/tapioca/gem/listeners/sorbet_props.rb#33 + sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } + def ignore?(event); end + + # source://tapioca//lib/tapioca/gem/listeners/sorbet_props.rb#14 + sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } + def on_scope(event); end +end + +# source://tapioca//lib/tapioca/gem/listeners/sorbet_required_ancestors.rb#7 +class Tapioca::Gem::Listeners::SorbetRequiredAncestors < ::Tapioca::Gem::Listeners::Base + private + + # source://tapioca//lib/tapioca/gem/listeners/sorbet_required_ancestors.rb#23 + sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } + def ignore?(event); end + + # source://tapioca//lib/tapioca/gem/listeners/sorbet_required_ancestors.rb#13 + sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } + def on_scope(event); end +end + +# source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#7 +class Tapioca::Gem::Listeners::SorbetSignatures < ::Tapioca::Gem::Listeners::Base + include ::Tapioca::Runtime::AttachedClassOf + include ::Tapioca::Runtime::Reflection + include ::Tapioca::SorbetHelper + include ::Tapioca::RBIHelper + + private + + # source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#26 + sig { params(signature: T.untyped, parameters: T::Array[[::Symbol, ::String]]).returns(::RBI::Sig) } + def compile_signature(signature, parameters); end + + # source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#79 + sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } + def ignore?(event); end + + # source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#18 + sig { override.params(event: ::Tapioca::Gem::MethodNodeAdded).void } + def on_method(event); end + + # source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#68 + sig { params(signature: T.untyped).returns(T::Boolean) } + def signature_final?(signature); end +end + +# source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#13 +Tapioca::Gem::Listeners::SorbetSignatures::TYPE_PARAMETER_MATCHER = T.let(T.unsafe(nil), Regexp) + +# source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#7 +class Tapioca::Gem::Listeners::SorbetTypeVariables < ::Tapioca::Gem::Listeners::Base + include ::Tapioca::Runtime::AttachedClassOf + include ::Tapioca::Runtime::Reflection + + private + + # source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#27 + sig { params(tree: ::RBI::Tree, constant: ::Module).void } + def compile_type_variable_declarations(tree, constant); end + + # source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#63 + sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } + def ignore?(event); end + + # source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#50 + sig { params(type_variable: ::Tapioca::TypeVariableModule).returns(T.nilable(::RBI::Node)) } + def node_from_type_variable(type_variable); end + + # source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#15 + sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } + def on_scope(event); end +end + +# source://tapioca//lib/tapioca/gem/listeners/source_location.rb#7 +class Tapioca::Gem::Listeners::SourceLocation < ::Tapioca::Gem::Listeners::Base + private + + # source://tapioca//lib/tapioca/gem/listeners/source_location.rb#41 + sig { params(node: ::RBI::NodeWithComments, file: T.nilable(::String), line: T.nilable(::Integer)).void } + def add_source_location_comment(node, file, line); end + + # source://tapioca//lib/tapioca/gem/listeners/source_location.rb#13 + sig { override.params(event: ::Tapioca::Gem::ConstNodeAdded).void } + def on_const(event); end + + # source://tapioca//lib/tapioca/gem/listeners/source_location.rb#35 + sig { override.params(event: ::Tapioca::Gem::MethodNodeAdded).void } + def on_method(event); end + + # source://tapioca//lib/tapioca/gem/listeners/source_location.rb#19 + sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } + def on_scope(event); end +end + +# source://tapioca//lib/tapioca/gem/listeners/subconstants.rb#7 +class Tapioca::Gem::Listeners::Subconstants < ::Tapioca::Gem::Listeners::Base + include ::Tapioca::Runtime::AttachedClassOf + include ::Tapioca::Runtime::Reflection + + private + + # source://tapioca//lib/tapioca/gem/listeners/subconstants.rb#36 + sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } + def ignore?(event); end + + # source://tapioca//lib/tapioca/gem/listeners/subconstants.rb#15 + sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } + def on_scope(event); end +end + +# source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#7 +class Tapioca::Gem::Listeners::YardDoc < ::Tapioca::Gem::Listeners::Base + # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#27 + sig { params(pipeline: ::Tapioca::Gem::Pipeline).void } + def initialize(pipeline); end + + private + + # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#55 + sig { params(name: ::String, sigs: T::Array[::RBI::Sig]).returns(T::Array[::RBI::Comment]) } + def documentation_comments(name, sigs: T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#99 + sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } + def ignore?(event); end + + # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#36 + sig { override.params(event: ::Tapioca::Gem::ConstNodeAdded).void } + def on_const(event); end + + # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#46 + sig { override.params(event: ::Tapioca::Gem::MethodNodeAdded).void } + def on_method(event); end + + # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#41 + sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } + def on_scope(event); end +end + +# source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#10 +Tapioca::Gem::Listeners::YardDoc::IGNORED_COMMENTS = T.let(T.unsafe(nil), Array) + +# source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#24 +Tapioca::Gem::Listeners::YardDoc::IGNORED_SIG_TAGS = T.let(T.unsafe(nil), Array) + +# source://tapioca//lib/tapioca/gem/events.rb#105 +class Tapioca::Gem::MethodNodeAdded < ::Tapioca::Gem::NodeAdded + # source://tapioca//lib/tapioca/gem/events.rb#130 + sig do + params( + symbol: ::String, + constant: ::Module, + method: ::UnboundMethod, + node: ::RBI::Method, + signature: T.untyped, + parameters: T::Array[[::Symbol, ::String]] + ).void + end + def initialize(symbol, constant, method, node, signature, parameters); end + + # source://tapioca//lib/tapioca/gem/events.rb#109 + sig { returns(::UnboundMethod) } + def method; end + + # source://tapioca//lib/tapioca/gem/events.rb#112 + sig { returns(::RBI::Method) } + def node; end + + # source://tapioca//lib/tapioca/gem/events.rb#118 + sig { returns(T::Array[[::Symbol, ::String]]) } + def parameters; end + + # source://tapioca//lib/tapioca/gem/events.rb#115 + sig { returns(T.untyped) } + def signature; end +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://tapioca//lib/tapioca/gem/events.rb#57 +class Tapioca::Gem::NodeAdded < ::Tapioca::Gem::Event + abstract! + + # source://tapioca//lib/tapioca/gem/events.rb#70 + sig { params(symbol: ::String, constant: ::Module).void } + def initialize(symbol, constant); end + + # source://tapioca//lib/tapioca/gem/events.rb#67 + sig { returns(::Module) } + def constant; end + + # source://tapioca//lib/tapioca/gem/events.rb#64 + sig { returns(::String) } + def symbol; end +end + +# source://tapioca//lib/tapioca/gem/pipeline.rb#6 +class Tapioca::Gem::Pipeline + include ::Tapioca::Runtime::AttachedClassOf + include ::Tapioca::Runtime::Reflection + include ::Tapioca::SorbetHelper + include ::Tapioca::RBIHelper + + # source://tapioca//lib/tapioca/gem/pipeline.rb#17 + sig { params(gem: ::Tapioca::Gemfile::GemSpec, include_doc: T::Boolean, include_loc: T::Boolean).void } + def initialize(gem, include_doc: T.unsafe(nil), include_loc: T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#48 + sig { returns(::RBI::Tree) } + def compile; end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#119 + sig { params(name: T.any(::String, ::Symbol)).returns(T::Boolean) } + def constant_in_gem?(name); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#14 + sig { returns(::Tapioca::Gemfile::GemSpec) } + def gem; end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#137 + sig { params(method: ::UnboundMethod).returns(T::Boolean) } + def method_in_gem?(method); end + + # Helpers + # + # source://tapioca//lib/tapioca/gem/pipeline.rb#147 + sig { params(constant: ::Module).returns(T.nilable(::String)) } + def name_of(constant); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#71 + sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Const).void } + def push_const(symbol, constant, node); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#61 + sig { params(symbol: ::String, constant: ::BasicObject).void } + def push_constant(symbol, constant); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#66 + sig { params(symbol: ::String, constant: ::Module).void } + def push_foreign_constant(symbol, constant); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#85 + sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Scope).void } + def push_foreign_scope(symbol, constant, node); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#99 + sig do + params( + symbol: ::String, + constant: ::Module, + method: ::UnboundMethod, + node: ::RBI::Method, + signature: T.untyped, + parameters: T::Array[[::Symbol, ::String]] + ).void + end + def push_method(symbol, constant, method, node, signature, parameters); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#78 + sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Scope).void } + def push_scope(symbol, constant, node); end + + # Events handling + # + # source://tapioca//lib/tapioca/gem/pipeline.rb#56 + sig { params(symbol: ::String).void } + def push_symbol(symbol); end + + # Constants and properties filtering + # + # source://tapioca//lib/tapioca/gem/pipeline.rb#106 + sig { params(symbol_name: ::String).returns(T::Boolean) } + def symbol_in_payload?(symbol_name); end + + private + + # source://tapioca//lib/tapioca/gem/pipeline.rb#440 + sig { params(name: ::String).void } + def add_to_alias_namespace(name); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#445 + sig { params(name: ::String).returns(T::Boolean) } + def alias_namespaced?(name); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#244 + sig { params(name: ::String, constant: ::Module).void } + def compile_alias(name, constant); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#230 + sig { params(symbol: ::String, constant: ::BasicObject).void } + def compile_constant(symbol, constant); end + + # Compiling + # + # source://tapioca//lib/tapioca/gem/pipeline.rb#219 + sig { params(symbol: ::String, constant: ::Module).void } + def compile_foreign_constant(symbol, constant); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#298 + sig { params(name: ::String, constant: ::Module).void } + def compile_module(name, constant); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#265 + sig { params(name: ::String, value: ::BasicObject).void } + def compile_object(name, value); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#309 + sig { params(name: ::String, constant: ::Module).returns(::RBI::Scope) } + def compile_scope(name, constant); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#323 + sig { params(constant: T::Class[T.anything]).returns(T.nilable(::String)) } + def compile_superclass(constant); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#421 + sig { params(constant: ::Module, strict: T::Boolean).returns(T::Boolean) } + def defined_in_gem?(constant, strict: T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#177 + sig { params(event: ::Tapioca::Gem::Event).void } + def dispatch(event); end + + # Helpers + # + # source://tapioca//lib/tapioca/gem/pipeline.rb#464 + sig { params(constant: T.all(::Module, ::T::Generic)).returns(::String) } + def generic_name_of(constant); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#433 + sig { params(constant: ::Module).returns(T::Set[::String]) } + def get_file_candidates(constant); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#162 + sig { params(gem: ::Tapioca::Gemfile::GemSpec).returns(T::Set[::String]) } + def load_bootstrap_symbols(gem); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#480 + sig { params(constant: ::Module, class_name: T.nilable(::String)).returns(T.nilable(::String)) } + def name_of_proxy_target(constant, class_name); end + + # Events handling + # + # source://tapioca//lib/tapioca/gem/pipeline.rb#172 + sig { returns(::Tapioca::Gem::Event) } + def next_event; end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#200 + sig { params(event: ::Tapioca::Gem::ConstantFound).void } + def on_constant(event); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#212 + sig { params(event: ::Tapioca::Gem::NodeAdded).void } + def on_node(event); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#191 + sig { params(event: ::Tapioca::Gem::SymbolFound).void } + def on_symbol(event); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#452 + sig { params(name: ::String).void } + def seen!(name); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#457 + sig { params(name: ::String).returns(T::Boolean) } + def seen?(name); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#391 + sig { params(name: ::String, constant: ::Module).returns(T::Boolean) } + def skip_alias?(name, constant); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#379 + sig { params(name: ::String, constant: T.anything).returns(T::Boolean) } + def skip_constant?(name, constant); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#408 + sig { params(name: ::String, constant: ::Module).returns(T::Boolean) } + def skip_foreign_constant?(name, constant); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#413 + sig { params(name: ::String, constant: ::Module).returns(T::Boolean) } + def skip_module?(name, constant); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#400 + sig { params(name: ::String, constant: ::BasicObject).returns(T::Boolean) } + def skip_object?(name, constant); end + + # Constants and properties filtering + # + # source://tapioca//lib/tapioca/gem/pipeline.rb#374 + sig { params(name: ::String).returns(T::Boolean) } + def skip_symbol?(name); end +end + +# this looks something like: +# "(eval at /path/to/file.rb:123)" +# and we are just interested in the "/path/to/file.rb" part +# +# source://tapioca//lib/tapioca/gem/pipeline.rb#116 +Tapioca::Gem::Pipeline::EVAL_SOURCE_FILE_PATTERN = T.let(T.unsafe(nil), Regexp) + +# source://tapioca//lib/tapioca/gem/pipeline.rb#11 +Tapioca::Gem::Pipeline::IGNORED_SYMBOLS = T.let(T.unsafe(nil), Array) + +# source://tapioca//lib/tapioca/gem/events.rb#90 +class Tapioca::Gem::ScopeNodeAdded < ::Tapioca::Gem::NodeAdded + # source://tapioca//lib/tapioca/gem/events.rb#97 + sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Scope).void } + def initialize(symbol, constant, node); end + + # source://tapioca//lib/tapioca/gem/events.rb#94 + sig { returns(::RBI::Scope) } + def node; end +end + +# source://tapioca//lib/tapioca/gem/events.rb#13 +class Tapioca::Gem::SymbolFound < ::Tapioca::Gem::Event + # source://tapioca//lib/tapioca/gem/events.rb#20 + sig { params(symbol: ::String).void } + def initialize(symbol); end + + # source://tapioca//lib/tapioca/gem/events.rb#17 + sig { returns(::String) } + def symbol; end +end + +# source://tapioca//lib/tapioca/helpers/gem_helper.rb#5 +module Tapioca::GemHelper + # source://tapioca//lib/tapioca/helpers/gem_helper.rb#9 + sig { params(app_dir: T.any(::Pathname, ::String), full_gem_path: ::String).returns(T::Boolean) } + def gem_in_app_dir?(app_dir, full_gem_path); end + + # source://tapioca//lib/tapioca/helpers/gem_helper.rb#17 + sig { params(full_gem_path: ::String).returns(T::Boolean) } + def gem_in_bundle_path?(full_gem_path); end + + # source://tapioca//lib/tapioca/helpers/gem_helper.rb#22 + sig { params(full_gem_path: ::String).returns(T::Boolean) } + def gem_in_ruby_path?(full_gem_path); end + + # source://tapioca//lib/tapioca/helpers/gem_helper.rb#27 + sig { params(path: T.any(::Pathname, ::String)).returns(::String) } + def to_realpath(path); end + + private + + # source://tapioca//lib/tapioca/helpers/gem_helper.rb#36 + sig { params(path: T.any(::Pathname, ::String), dir: T.any(::Pathname, ::String)).returns(T::Boolean) } + def path_in_dir?(path, dir); end +end + +# source://tapioca//lib/tapioca/gem_info.rb#5 +class Tapioca::GemInfo < ::T::Struct + const :name, ::String + const :version, ::Gem::Version + + class << self + # source://tapioca//lib/tapioca/gem_info.rb#13 + sig { params(spec: ::Bundler::LazySpecification).returns(::Tapioca::GemInfo) } + def from_spec(spec); end + + # source://sorbet-runtime/0.5.11609/lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://tapioca//lib/tapioca/gemfile.rb#7 +class Tapioca::Gemfile + # source://tapioca//lib/tapioca/gemfile.rb#27 + sig { params(excluded_gems: T::Array[::String]).void } + def initialize(excluded_gems); end + + # source://tapioca//lib/tapioca/gemfile.rb#18 + sig { returns(::Bundler::Definition) } + def definition; end + + # source://tapioca//lib/tapioca/gemfile.rb#21 + sig { returns(T::Array[::Tapioca::Gemfile::GemSpec]) } + def dependencies; end + + # source://tapioca//lib/tapioca/gemfile.rb#40 + sig { params(gem_name: ::String).returns(T.nilable(::Tapioca::Gemfile::GemSpec)) } + def gem(gem_name); end + + # source://tapioca//lib/tapioca/gemfile.rb#24 + sig { returns(T::Array[::String]) } + def missing_specs; end + + # source://tapioca//lib/tapioca/gemfile.rb#45 + sig { void } + def require_bundle; end + + private + + # source://tapioca//lib/tapioca/gemfile.rb#92 + sig { returns(::String) } + def dir; end + + # source://tapioca//lib/tapioca/gemfile.rb#54 + sig { returns(::File) } + def gemfile; end + + # source://tapioca//lib/tapioca/gemfile.rb#87 + sig { returns(T::Array[::Symbol]) } + def groups; end + + # source://tapioca//lib/tapioca/gemfile.rb#57 + sig { returns([T::Array[::Tapioca::Gemfile::GemSpec], T::Array[::String]]) } + def load_dependencies; end + + # @return [File] + # + # source://tapioca//lib/tapioca/gemfile.rb#54 + def lockfile; end + + # source://tapioca//lib/tapioca/gemfile.rb#68 + sig { returns([T::Enumerable[T.any(::Bundler::StubSpecification, ::Gem::Specification)], T::Array[::String]]) } + def materialize_deps; end + + # source://tapioca//lib/tapioca/gemfile.rb#82 + sig { returns(::Bundler::Runtime) } + def runtime; end +end + +# source://tapioca//lib/tapioca/gemfile.rb#96 +class Tapioca::Gemfile::GemSpec + include ::Tapioca::GemHelper + + # source://tapioca//lib/tapioca/gemfile.rb#136 + sig { params(spec: T.any(::Bundler::StubSpecification, ::Gem::Specification)).void } + def initialize(spec); end + + # source://tapioca//lib/tapioca/gemfile.rb#146 + sig { params(other: ::BasicObject).returns(T::Boolean) } + def ==(other); end + + # source://tapioca//lib/tapioca/gemfile.rb#171 + sig { params(path: ::String).returns(T::Boolean) } + def contains_path?(path); end + + # source://tapioca//lib/tapioca/gemfile.rb#161 + sig { returns(T::Array[::Gem::Dependency]) } + def dependencies; end + + # source://tapioca//lib/tapioca/gemfile.rb#201 + sig { returns(T::Boolean) } + def export_rbi_files?; end + + # source://tapioca//lib/tapioca/gemfile.rb#196 + sig { returns(T::Array[::String]) } + def exported_rbi_files; end + + # source://tapioca//lib/tapioca/gemfile.rb#206 + sig { returns(::RBI::MergeTree) } + def exported_rbi_tree; end + + # source://tapioca//lib/tapioca/gemfile.rb#133 + sig { returns(T::Array[::Pathname]) } + def files; end + + # source://tapioca//lib/tapioca/gemfile.rb#130 + sig { returns(::String) } + def full_gem_path; end + + # source://tapioca//lib/tapioca/gemfile.rb#151 + sig { params(gemfile_dir: ::String).returns(T::Boolean) } + def ignore?(gemfile_dir); end + + # source://tapioca//lib/tapioca/gemfile.rb#156 + sig { returns(::String) } + def name; end + + # source://tapioca//lib/tapioca/gemfile.rb#180 + sig { void } + def parse_yard_docs; end + + # source://tapioca//lib/tapioca/gemfile.rb#166 + sig { returns(::String) } + def rbi_file_name; end + + # source://tapioca//lib/tapioca/gemfile.rb#218 + sig { params(file: ::Pathname).returns(::Pathname) } + def relative_path_for(file); end + + # @return [String] + # + # source://tapioca//lib/tapioca/gemfile.rb#130 + def version; end + + private + + # source://tapioca//lib/tapioca/gemfile.rb#229 + sig { returns(T::Array[::Pathname]) } + def collect_files; end + + # source://tapioca//lib/tapioca/gemfile.rb#244 + sig { returns(T.nilable(T::Boolean)) } + def default_gem?; end + + # source://tapioca//lib/tapioca/gemfile.rb#303 + sig { returns(T::Boolean) } + def gem_ignored?; end + + # source://tapioca//lib/tapioca/gemfile.rb#282 + sig { params(path: ::String).returns(T::Boolean) } + def has_parent_gemspec?(path); end + + # source://tapioca//lib/tapioca/gemfile.rb#249 + sig { returns(::Regexp) } + def require_paths_prefix_matcher; end + + # source://tapioca//lib/tapioca/gemfile.rb#261 + sig { params(file: ::String).returns(::Pathname) } + def resolve_to_ruby_lib_dir(file); end + + # source://tapioca//lib/tapioca/gemfile.rb#275 + sig { returns(::String) } + def version_string; end + + class << self + # source://tapioca//lib/tapioca/gemfile.rb#104 + sig { returns(T::Hash[::String, ::Tapioca::Gemfile::GemSpec]) } + def spec_lookup_by_file_path; end + end +end + +# source://tapioca//lib/tapioca/gemfile.rb#116 +Tapioca::Gemfile::GemSpec::IGNORED_GEMS = T.let(T.unsafe(nil), Array) + +# source://tapioca//lib/tapioca/gemfile.rb#10 +Tapioca::Gemfile::Spec = T.type_alias { T.any(::Bundler::StubSpecification, ::Gem::Specification) } + +# source://tapioca//lib/tapioca/loaders/loader.rb#5 +module Tapioca::Loaders; end + +# source://tapioca//lib/tapioca/loaders/dsl.rb#6 +class Tapioca::Loaders::Dsl < ::Tapioca::Loaders::Loader + # source://tapioca//lib/tapioca/loaders/dsl.rb#38 + sig do + params( + tapioca_path: ::String, + eager_load: T::Boolean, + app_root: ::String, + halt_upon_load_error: T::Boolean + ).void + end + def initialize(tapioca_path:, eager_load: T.unsafe(nil), app_root: T.unsafe(nil), halt_upon_load_error: T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/loaders/dsl.rb#27 + sig { override.void } + def load; end + + protected + + # source://tapioca//lib/tapioca/loaders/dsl.rb#81 + sig { void } + def load_application; end + + # source://tapioca//lib/tapioca/loaders/dsl.rb#63 + sig { void } + def load_dsl_compilers; end + + # source://tapioca//lib/tapioca/loaders/dsl.rb#48 + sig { void } + def load_dsl_extensions; end + + class << self + # source://tapioca//lib/tapioca/loaders/dsl.rb#15 + sig do + params( + tapioca_path: ::String, + eager_load: T::Boolean, + app_root: ::String, + halt_upon_load_error: T::Boolean + ).void + end + def load_application(tapioca_path:, eager_load: T.unsafe(nil), app_root: T.unsafe(nil), halt_upon_load_error: T.unsafe(nil)); end + end +end + +# source://tapioca//lib/tapioca/loaders/gem.rb#6 +class Tapioca::Loaders::Gem < ::Tapioca::Loaders::Loader + # source://tapioca//lib/tapioca/loaders/gem.rb#49 + sig do + params( + bundle: ::Tapioca::Gemfile, + prerequire: T.nilable(::String), + postrequire: ::String, + default_command: ::String, + halt_upon_load_error: T::Boolean + ).void + end + def initialize(bundle:, prerequire:, postrequire:, default_command:, halt_upon_load_error:); end + + # source://tapioca//lib/tapioca/loaders/gem.rb#34 + sig { override.void } + def load; end + + protected + + # source://tapioca//lib/tapioca/loaders/gem.rb#80 + sig { params(file: ::String, error: ::LoadError).void } + def explain_failed_require(file, error); end + + # source://tapioca//lib/tapioca/loaders/gem.rb#60 + sig { void } + def require_gem_file; end + + class << self + # source://tapioca//lib/tapioca/loaders/gem.rb#21 + sig do + params( + bundle: ::Tapioca::Gemfile, + prerequire: T.nilable(::String), + postrequire: ::String, + default_command: ::String, + halt_upon_load_error: T::Boolean + ).void + end + def load_application(bundle:, prerequire:, postrequire:, default_command:, halt_upon_load_error:); end + end +end + +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://tapioca//lib/tapioca/loaders/loader.rb#6 +class Tapioca::Loaders::Loader + include ::Thor::Base + include ::Thor::Invocation + include ::Thor::Shell + include ::Tapioca::CliHelper + include ::Tapioca::GemHelper + extend ::Thor::Base::ClassMethods + extend ::Thor::Invocation::ClassMethods + + abstract! + + # @abstract + # + # source://tapioca//lib/tapioca/loaders/loader.rb#17 + sig { abstract.void } + def load; end + + private + + # Rails 7.2 renamed `eager_load_paths` to `all_eager_load_paths`, which maintains the same original functionality. + # The `eager_load_paths` method still exists, but doesn't return all paths anymore and causes Tapioca to miss some + # engine paths. The following commit is the change: + # https://github.com/rails/rails/commit/ebfca905db14020589c22e6937382e6f8f687664 + # + # @param engine [T.class_of(Rails::Engine)] + # @return [Array] + # + # source://sorbet-runtime/0.5.11609/lib/types/private/methods/_methods.rb#257 + def eager_load_paths(*args, **_arg1, &blk); end + + # source://tapioca//lib/tapioca/loaders/loader.rb#188 + sig { void } + def eager_load_rails_app; end + + # @return [Array] + # + # source://tapioca//lib/tapioca/loaders/loader.rb#167 + def engines; end + + # source://tapioca//lib/tapioca/loaders/loader.rb#29 + sig do + params( + gemfile: ::Tapioca::Gemfile, + initialize_file: T.nilable(::String), + require_file: T.nilable(::String), + halt_upon_load_error: T::Boolean + ).void + end + def load_bundle(gemfile, initialize_file, require_file, halt_upon_load_error); end + + # source://tapioca//lib/tapioca/loaders/loader.rb#125 + sig { void } + def load_engines_in_classic_mode; end + + # source://tapioca//lib/tapioca/loaders/loader.rb#103 + sig { void } + def load_engines_in_zeitwerk_mode; end + + # source://tapioca//lib/tapioca/loaders/loader.rb#49 + sig do + params( + environment_load: T::Boolean, + eager_load: T::Boolean, + app_root: ::String, + halt_upon_load_error: T::Boolean + ).void + end + def load_rails_application(environment_load: T.unsafe(nil), eager_load: T.unsafe(nil), app_root: T.unsafe(nil), halt_upon_load_error: T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/loaders/loader.rb#78 + sig { void } + def load_rails_engines; end + + # source://tapioca//lib/tapioca/loaders/loader.rb#209 + sig { params(file: T.nilable(::String)).void } + def require_helper(file); end + + # source://tapioca//lib/tapioca/loaders/loader.rb#92 + def run_initializers; end + + # source://tapioca//lib/tapioca/loaders/loader.rb#181 + sig { params(path: ::String).void } + def safe_require(path); end + + # source://tapioca//lib/tapioca/loaders/loader.rb#150 + sig { params(blk: T.proc.void).void } + def with_rails_application(&blk); end + + # source://tapioca//lib/tapioca/loaders/loader.rb#143 + sig { returns(T::Boolean) } + def zeitwerk_mode?; end +end + +# source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#5 +module Tapioca::RBIFilesHelper + requires_ancestor { Tapioca::SorbetHelper } + requires_ancestor { Thor::Shell } + + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#48 + sig do + params( + index: ::RBI::Index, + shim_rbi_dir: ::String, + todo_rbi_file: ::String + ).returns(T::Hash[::String, T::Array[::RBI::Node]]) + end + def duplicated_nodes_from_index(index, shim_rbi_dir:, todo_rbi_file:); end + + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#13 + sig { params(index: ::RBI::Index, kind: ::String, file: ::String).void } + def index_rbi(index, kind, file); end + + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#25 + sig { params(index: ::RBI::Index, kind: ::String, dir: ::String, number_of_workers: T.nilable(::Integer)).void } + def index_rbis(index, kind, dir, number_of_workers:); end + + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#65 + sig { params(loc: ::RBI::Loc, path_prefix: T.nilable(::String)).returns(::String) } + def location_to_payload_url(loc, path_prefix:); end + + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#86 + sig do + params( + command: ::String, + gem_dir: ::String, + dsl_dir: ::String, + auto_strictness: T::Boolean, + gems: T::Array[::Tapioca::Gemfile::GemSpec], + compilers: T::Enumerable[T.class_of(Tapioca::Dsl::Compiler)] + ).void + end + def validate_rbi_files(command:, gem_dir:, dsl_dir:, auto_strictness:, gems: T.unsafe(nil), compilers: T.unsafe(nil)); end + + private + + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#223 + sig { params(nodes: T::Array[::RBI::Node]).returns(T::Array[::RBI::Scope]) } + def extract_empty_scopes(nodes); end + + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#228 + sig { params(nodes: T::Array[::RBI::Node]).returns(T::Array[T.any(::RBI::Attr, ::RBI::Method)]) } + def extract_methods_and_attrs(nodes); end + + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#238 + sig { params(nodes: T::Array[::RBI::Node]).returns(T::Array[T.any(::RBI::Mixin, ::RBI::RequiresAncestor)]) } + def extract_mixins(nodes); end + + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#248 + sig do + params( + nodes: T::Array[T.any(::RBI::Attr, ::RBI::Method)] + ).returns(T::Array[T.any(::RBI::Attr, ::RBI::Method)]) + end + def extract_nodes_with_sigs(nodes); end + + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#216 + sig do + params( + nodes: T::Array[::RBI::Node], + shim_rbi_dir: ::String, + todo_rbi_file: ::String + ).returns(T::Array[::RBI::Node]) + end + def extract_shims_and_todos(nodes, shim_rbi_dir:, todo_rbi_file:); end + + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#280 + sig { params(path: ::String).returns(::String) } + def gem_name_from_rbi_path(path); end + + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#155 + sig { params(index: ::RBI::Index, files: T::Array[::String], number_of_workers: T.nilable(::Integer)).void } + def parse_and_index_files(index, files, number_of_workers:); end + + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#171 + sig { params(nodes: T::Array[::RBI::Node], shim_rbi_dir: ::String, todo_rbi_file: ::String).returns(T::Boolean) } + def shims_or_todos_have_duplicates?(nodes, shim_rbi_dir:, todo_rbi_file:); end + + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#253 + sig { params(errors: T::Array[::Spoom::Sorbet::Errors::Error], gem_dir: ::String).void } + def update_gem_rbis_strictnesses(errors, gem_dir); end +end + +# source://tapioca//lib/tapioca/rbi_formatter.rb#5 +class Tapioca::RBIFormatter < ::RBI::Formatter + # source://tapioca//lib/tapioca/rbi_formatter.rb#24 + sig { params(file: ::RBI::File).void } + def write_empty_body_comment!(file); end + + # source://tapioca//lib/tapioca/rbi_formatter.rb#15 + sig { params(file: ::RBI::File, command: ::String, reason: T.nilable(::String)).void } + def write_header!(file, command, reason: T.unsafe(nil)); end +end + +# source://tapioca//lib/tapioca/helpers/rbi_helper.rb#5 +module Tapioca::RBIHelper + include ::Tapioca::SorbetHelper + extend ::Tapioca::SorbetHelper + extend ::Tapioca::RBIHelper + + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#91 + sig { params(type: ::String).returns(::String) } + def as_nilable_type(type); end + + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#100 + sig { params(type: ::String).returns(::String) } + def as_non_nilable_type(type); end + + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#72 + sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) } + def create_block_param(name, type:); end + + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#62 + sig { params(name: ::String, type: ::String, default: ::String).returns(::RBI::TypedParam) } + def create_kw_opt_param(name, type:, default:); end + + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#57 + sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) } + def create_kw_param(name, type:); end + + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#67 + sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) } + def create_kw_rest_param(name, type:); end + + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#47 + sig { params(name: ::String, type: ::String, default: ::String).returns(::RBI::TypedParam) } + def create_opt_param(name, type:, default:); end + + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#42 + sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) } + def create_param(name, type:); end + + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#52 + sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) } + def create_rest_param(name, type:); end + + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#77 + sig { params(param: ::RBI::Param, type: ::String).returns(::RBI::TypedParam) } + def create_typed_param(param, type); end + + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#82 + sig { params(sig_string: ::String).returns(::String) } + def sanitize_signature_types(sig_string); end + + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#109 + sig { params(name: ::String).returns(T::Boolean) } + def valid_method_name?(name); end + + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#123 + sig { params(name: ::String).returns(T::Boolean) } + def valid_parameter_name?(name); end + + class << self + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#23 + sig do + params( + type: ::String, + variance: ::Symbol, + fixed: T.nilable(::String), + upper: T.nilable(::String), + lower: T.nilable(::String) + ).returns(::String) + end + def serialize_type_variable(type, variance, fixed, upper, lower); end + end +end + +# source://tapioca//lib/tapioca/repo_index.rb#5 +class Tapioca::RepoIndex + # source://tapioca//lib/tapioca/repo_index.rb#26 + sig { void } + def initialize; end + + # source://tapioca//lib/tapioca/repo_index.rb#31 + sig { params(gem_name: ::String).void } + def <<(gem_name); end + + # source://tapioca//lib/tapioca/repo_index.rb#36 + sig { returns(T::Enumerable[::String]) } + def gems; end + + # source://tapioca//lib/tapioca/repo_index.rb#41 + sig { params(gem_name: ::String).returns(T::Boolean) } + def has_gem?(gem_name); end + + class << self + # source://tapioca//lib/tapioca/repo_index.rb#18 + sig { params(hash: T::Hash[::String, T::Hash[T.untyped, T.untyped]]).returns(Tapioca::RepoIndex) } + def from_hash(hash); end + + # source://tapioca//lib/tapioca/repo_index.rb#13 + sig { params(json: ::String).returns(Tapioca::RepoIndex) } + def from_json(json); end + end +end + +# source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#5 +module Tapioca::Runtime; end + +# This module should only be included when running versions of Ruby +# older than 3.2. Because the Class#attached_object method is not +# available, it implements finding the attached class of a singleton +# class by iterating through ObjectSpace. +module Tapioca::Runtime::AttachedClassOf + # source://tapioca//lib/tapioca/runtime/attached_class_of_32.rb#14 + sig { params(singleton_class: ::Class).returns(T.nilable(::Module)) } + def attached_class_of(singleton_class); end +end + +# source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#6 +class Tapioca::Runtime::DynamicMixinCompiler + include ::Tapioca::Runtime::AttachedClassOf + include ::Tapioca::Runtime::Reflection + + # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#20 + sig { params(constant: ::Module).void } + def initialize(constant); end + + # @return [Array] + # + # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#14 + def class_attribute_predicates; end + + # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#14 + sig { returns(T::Array[::Symbol]) } + def class_attribute_readers; end + + # @return [Array] + # + # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#14 + def class_attribute_writers; end + + # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#137 + sig { params(tree: ::RBI::Tree).void } + def compile_class_attributes(tree); end + + # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#180 + sig { params(tree: ::RBI::Tree).returns([T::Array[::Module], T::Array[::Module]]) } + def compile_mixes_in_class_methods(tree); end + + # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#11 + sig { returns(T::Array[::Module]) } + def dynamic_extends; end + + # @return [Array] + # + # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#11 + def dynamic_includes; end + + # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#132 + sig { returns(T::Boolean) } + def empty_attributes?; end + + # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#222 + sig { params(qualified_mixin_name: ::String).returns(T::Boolean) } + def filtered_mixin?(qualified_mixin_name); end + + # @return [Array] + # + # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#17 + def instance_attribute_predicates; end + + # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#17 + sig { returns(T::Array[::Symbol]) } + def instance_attribute_readers; end + + # @return [Array] + # + # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#17 + def instance_attribute_writers; end + + # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#215 + sig { params(mod: ::Module, dynamic_extends: T::Array[::Module]).returns(T::Boolean) } + def module_included_by_another_dynamic_extend?(mod, dynamic_extends); end +end + +# This class is responsible for storing and looking up information related to generic types. +# +# The class stores 2 different kinds of data, in two separate lookup tables: +# 1. a lookup of generic type instances by name: `@generic_instances` +# 2. a lookup of type variable serializer by constant and type variable +# instance: `@type_variables` +# +# By storing the above data, we can cheaply query each constant against this registry +# to see if it declares any generic type variables. This becomes a simple lookup in the +# `@type_variables` hash table with the given constant. +# +# If there is no entry, then we can cheaply know that we can skip generic type +# information generation for this type. +# +# On the other hand, if we get a result, then the result will be a hash of type +# variable to type variable serializers. This allows us to associate type variables +# to the constant names that represent them, easily. +# +# source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#23 +module Tapioca::Runtime::GenericTypeRegistry + class << self + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#80 + sig { params(instance: ::Object).returns(T::Boolean) } + def generic_type_instance?(instance); end + + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#85 + sig { params(constant: ::Module).returns(T.nilable(T::Array[::Tapioca::TypeVariableModule])) } + def lookup_type_variables(constant); end + + # This method is responsible for building the name of the instantiated concrete type + # and cloning the given constant so that we can return a type that is the same + # as the current type but is a different instance and has a different name method. + # + # We cache those cloned instances by their name in `@generic_instances`, so that + # we don't keep instantiating a new type every single time it is referenced. + # For example, `[Foo[Integer], Foo[Integer], Foo[Integer], Foo[String]]` will only + # result in 2 clones (1 for `Foo[Integer]` and another for `Foo[String]`) and + # 2 hash lookups (for the other two `Foo[Integer]`s). + # + # This method returns the created or cached clone of the constant. + # + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#65 + sig { params(constant: T.untyped, types: T.untyped).returns(::Module) } + def register_type(constant, types); end + + # This method is called from intercepted calls to `type_member` and `type_template`. + # We get passed all the arguments to those methods, as well as the `T::Types::TypeVariable` + # instance generated by the Sorbet defined `type_member`/`type_template` call on `T::Generic`. + # + # This method creates a `String` with that data and stores it in the + # `@type_variables` lookup table, keyed by the `constant` and `type_variable`. + # + # Finally, the original `type_variable` is returned from this method, so that the caller + # can return it from the original methods as well. + # + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#104 + sig { params(constant: T.untyped, type_variable: ::Tapioca::TypeVariableModule).void } + def register_type_variable(constant, type_variable); end + + private + + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#113 + sig { params(constant: ::Module, name: ::String).returns(::Module) } + def create_generic_type(constant, name); end + + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#155 + sig { params(constant: T::Class[T.anything]).returns(T::Class[T.anything]) } + def create_safe_subclass(constant); end + + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#182 + sig { params(constant: ::Module).returns(T::Array[::Tapioca::TypeVariableModule]) } + def lookup_or_initialize_type_variables(constant); end + end +end + +# source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#34 +class Tapioca::Runtime::GenericTypeRegistry::GenericType < ::T::Types::Simple + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#38 + sig { params(raw_type: ::Module, underlying_type: ::Module).void } + def initialize(raw_type, underlying_type); end + + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#45 + sig { params(obj: T.untyped).returns(T::Boolean) } + def valid?(obj); end +end + +module Tapioca::Runtime::Reflection + include ::Tapioca::Runtime::AttachedClassOf + extend ::Tapioca::Runtime::AttachedClassOf + extend ::Tapioca::Runtime::Reflection + + # source://tapioca//lib/tapioca/runtime/reflection.rb#196 + sig { params(constant: ::Module).returns(T.untyped) } + def abstract_type_of(constant); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#77 + sig { params(constant: ::Module).returns(T::Array[::Module]) } + def ancestors_of(constant); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#92 + sig { params(object: ::BasicObject, other: ::BasicObject).returns(T::Boolean) } + def are_equal?(object, other); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#56 + sig { params(object: ::BasicObject).returns(T::Class[T.anything]) } + def class_of(object); end + + # @param constant [BasicObject] + # @return [Boolean] + # + # source://tapioca//lib/tapioca/runtime/reflection.rb#38 + def constant_defined?(constant); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#49 + sig { params(symbol: ::String, inherit: T::Boolean, namespace: ::Module).returns(::BasicObject) } + def constantize(symbol, inherit: T.unsafe(nil), namespace: T.unsafe(nil)); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#61 + sig { params(constant: ::Module).returns(T::Array[::Symbol]) } + def constants_of(constant); end + + # Returns an array with all classes that are < than the supplied class. + # + # class C; end + # descendants_of(C) # => [] + # + # class B < C; end + # descendants_of(C) # => [B] + # + # class A < B; end + # descendants_of(C) # => [B, A] + # + # class D < C; end + # descendants_of(C) # => [B, A, D] + # + # source://tapioca//lib/tapioca/runtime/reflection.rb#167 + sig do + type_parameters(:U) + .params( + klass: T.all(T.type_parameter(:U), T::Class[T.anything]) + ).returns(T::Array[T.type_parameter(:U)]) + end + def descendants_of(klass); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#189 + sig { params(constant: ::Module).returns(T::Set[::String]) } + def file_candidates_for(constant); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#202 + sig { params(constant: ::Module).returns(T::Boolean) } + def final_module?(constant); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#112 + sig { params(constant: ::Module).returns(T::Array[::Module]) } + def inherited_ancestors_of(constant); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#145 + sig { params(constant: ::Module, method: ::Symbol).returns(::Method) } + def method_of(constant, method); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#66 + sig { params(constant: ::Module).returns(T.nilable(::String)) } + def name_of(constant); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#140 + sig { params(type: ::T::Types::Base).returns(::String) } + def name_of_type(type); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#87 + sig { params(object: ::BasicObject).returns(::Integer) } + def object_id_of(object); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#107 + sig { params(constant: ::Module).returns(T::Array[::Symbol]) } + def private_instance_methods_of(constant); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#102 + sig { params(constant: ::Module).returns(T::Array[::Symbol]) } + def protected_instance_methods_of(constant); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#97 + sig { params(constant: ::Module).returns(T::Array[::Symbol]) } + def public_instance_methods_of(constant); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#121 + sig { params(constant: ::Module).returns(T.nilable(::String)) } + def qualified_name_of(constant); end + + # Examines the call stack to identify the closest location where a "require" is performed + # by searching for the label "". If none is found, it returns the location + # labeled "
", which is the original call site. + # + # source://tapioca//lib/tapioca/runtime/reflection.rb#179 + sig { params(locations: T.nilable(T::Array[::Thread::Backtrace::Location])).returns(::String) } + def resolve_loc(locations); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#207 + sig { params(constant: ::Module).returns(T::Boolean) } + def sealed_module?(constant); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#133 + sig { params(method: T.any(::Method, ::UnboundMethod)).returns(T.untyped) } + def signature_of(method); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#72 + sig { params(constant: ::Module).returns(T::Class[T.anything]) } + def singleton_class_of(constant); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#82 + sig { params(constant: T::Class[T.anything]).returns(T.nilable(T::Class[T.anything])) } + def superclass_of(constant); end + + private + + # source://tapioca//lib/tapioca/runtime/reflection.rb#244 + sig { params(parent: ::Module, name: ::String).returns(T.nilable(::Module)) } + def child_module_for_parent_with_name(parent, name); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#260 + sig { params(name: ::String).returns(T::Boolean) } + def has_aliased_namespace?(name); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#255 + sig { params(method: ::UnboundMethod).returns(T::Boolean) } + def method_defined_by_forwardable_module?(method); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#230 + sig { params(constant: ::Module).returns(T::Array[::UnboundMethod]) } + def methods_for(constant); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#214 + sig { params(constant: ::Module).returns(T::Array[::UnboundMethod]) } + def relevant_methods_for(constant); end +end + +# source://tapioca//lib/tapioca/runtime/reflection.rb#25 +Tapioca::Runtime::Reflection::ANCESTORS_METHOD = T.let(T.unsafe(nil), UnboundMethod) + +# source://tapioca//lib/tapioca/runtime/reflection.rb#21 +Tapioca::Runtime::Reflection::CLASS_METHOD = T.let(T.unsafe(nil), UnboundMethod) + +# source://tapioca//lib/tapioca/runtime/reflection.rb#22 +Tapioca::Runtime::Reflection::CONSTANTS_METHOD = T.let(T.unsafe(nil), UnboundMethod) + +# source://tapioca//lib/tapioca/runtime/reflection.rb#28 +Tapioca::Runtime::Reflection::EQUAL_METHOD = T.let(T.unsafe(nil), UnboundMethod) + +# source://tapioca//lib/tapioca/runtime/reflection.rb#32 +Tapioca::Runtime::Reflection::METHOD_METHOD = T.let(T.unsafe(nil), UnboundMethod) + +# source://tapioca//lib/tapioca/runtime/reflection.rb#23 +Tapioca::Runtime::Reflection::NAME_METHOD = T.let(T.unsafe(nil), UnboundMethod) + +# source://tapioca//lib/tapioca/runtime/reflection.rb#27 +Tapioca::Runtime::Reflection::OBJECT_ID_METHOD = T.let(T.unsafe(nil), UnboundMethod) + +# source://tapioca//lib/tapioca/runtime/reflection.rb#31 +Tapioca::Runtime::Reflection::PRIVATE_INSTANCE_METHODS_METHOD = T.let(T.unsafe(nil), UnboundMethod) + +# source://tapioca//lib/tapioca/runtime/reflection.rb#30 +Tapioca::Runtime::Reflection::PROTECTED_INSTANCE_METHODS_METHOD = T.let(T.unsafe(nil), UnboundMethod) + +# source://tapioca//lib/tapioca/runtime/reflection.rb#29 +Tapioca::Runtime::Reflection::PUBLIC_INSTANCE_METHODS_METHOD = T.let(T.unsafe(nil), UnboundMethod) + +# source://tapioca//lib/tapioca/runtime/reflection.rb#35 +Tapioca::Runtime::Reflection::REQUIRED_FROM_LABELS = T.let(T.unsafe(nil), Array) + +# source://tapioca//lib/tapioca/runtime/reflection.rb#24 +Tapioca::Runtime::Reflection::SINGLETON_CLASS_METHOD = T.let(T.unsafe(nil), UnboundMethod) + +# source://tapioca//lib/tapioca/runtime/reflection.rb#26 +Tapioca::Runtime::Reflection::SUPERCLASS_METHOD = T.let(T.unsafe(nil), UnboundMethod) + +# source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#6 +module Tapioca::Runtime::Trackers + class << self + # source://tapioca//lib/tapioca/runtime/trackers.rb#34 + sig { void } + def disable_all!; end + + # source://tapioca//lib/tapioca/runtime/trackers.rb#39 + sig { params(tracker: ::Tapioca::Runtime::Trackers::Tracker).void } + def register_tracker(tracker); end + + # source://tapioca//lib/tapioca/runtime/trackers.rb#21 + sig do + type_parameters(:Return) + .params( + blk: T.proc.returns(T.type_parameter(:Return)) + ).returns(T.type_parameter(:Return)) + end + def with_trackers_enabled(&blk); end + end +end + +# source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#7 +module Tapioca::Runtime::Trackers::Autoload + extend ::Tapioca::Runtime::Trackers::Tracker + + class << self + # source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#19 + sig { void } + def eager_load_all!; end + + # source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#31 + sig { params(constant_name: ::String).void } + def register(constant_name); end + + # source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#42 + sig do + type_parameters(:Result) + .params( + block: T.proc.returns(T.type_parameter(:Result)) + ).returns(T.type_parameter(:Result)) + end + def with_disabled_exits(&block); end + end +end + +# source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#11 +Tapioca::Runtime::Trackers::Autoload::NOOP_METHOD = T.let(T.unsafe(nil), Proc) + +# Registers a TracePoint immediately upon load to track points at which +# classes and modules are opened for definition. This is used to track +# correspondence between classes/modules and files, as this information isn't +# available in the ruby runtime without extra accounting. +module Tapioca::Runtime::Trackers::ConstantDefinition + extend ::Tapioca::Runtime::Trackers::Tracker + extend ::Tapioca::Runtime::AttachedClassOf + extend ::Tapioca::Runtime::Reflection + + class << self + # source://tapioca//lib/tapioca/runtime/trackers/constant_definition.rb#61 + def build_constant_location(tp, locations); end + + # source://tapioca//lib/tapioca/runtime/trackers/constant_definition.rb#55 + def disable!; end + + # Returns the files in which this class or module was opened. Doesn't know + # about situations where the class was opened prior to +require+ing, + # or where metaprogramming was used via +eval+, etc. + # + # source://tapioca//lib/tapioca/runtime/trackers/constant_definition.rb#71 + def files_for(klass); end + + # source://tapioca//lib/tapioca/runtime/trackers/constant_definition.rb#75 + def locations_for(klass); end + end +end + +module Tapioca::Runtime::Trackers::Mixin + extend ::Tapioca::Runtime::Trackers::Tracker + + class << self + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#56 + sig do + params( + mixin: ::Module + ).returns(T::Hash[::Tapioca::Runtime::Trackers::Mixin::Type, T::Hash[::Module, ::String]]) + end + def constants_with_mixin(mixin); end + + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#61 + sig do + params( + mixin: ::Module, + mixin_type: ::Tapioca::Runtime::Trackers::Mixin::Type, + constant: ::Module + ).returns(T.nilable(::String)) + end + def mixin_location(mixin, mixin_type, constant); end + + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#35 + sig { params(constant: ::Module, mixin: ::Module, mixin_type: ::Tapioca::Runtime::Trackers::Mixin::Type).void } + def register(constant, mixin, mixin_type); end + + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#43 + def resolve_to_attached_class(constant, mixin, mixin_type); end + + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#30 + sig do + type_parameters(:Result) + .params( + block: T.proc.returns(T.type_parameter(:Result)) + ).returns(T.type_parameter(:Result)) + end + def with_disabled_registration(&block); end + + private + + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#76 + sig do + params( + mixin: ::Module + ).returns(T::Hash[::Tapioca::Runtime::Trackers::Mixin::Type, T::Hash[::Module, ::String]]) + end + def find_or_initialize_mixin_lookup(mixin); end + + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#68 + sig do + params( + constant: ::Module, + mixin: ::Module, + mixin_type: ::Tapioca::Runtime::Trackers::Mixin::Type, + location: ::String + ).void + end + def register_with_location(constant, mixin, mixin_type, location); end + end +end + +class Tapioca::Runtime::Trackers::Mixin::Type < ::T::Enum + enums do + Prepend = new + Include = new + Extend = new + end +end + +# source://tapioca//lib/tapioca/runtime/trackers/required_ancestor.rb#7 +module Tapioca::Runtime::Trackers::RequiredAncestor + extend ::Tapioca::Runtime::Trackers::Tracker + + class << self + # source://tapioca//lib/tapioca/runtime/trackers/required_ancestor.rb#15 + sig { params(requiring: ::T::Helpers, block: T.proc.void).void } + def register(requiring, block); end + + # source://tapioca//lib/tapioca/runtime/trackers/required_ancestor.rb#23 + sig { params(mod: ::Module).returns(T::Array[T.proc.void]) } + def required_ancestors_blocks_by(mod); end + + # source://tapioca//lib/tapioca/runtime/trackers/required_ancestor.rb#28 + sig { params(mod: ::Module).returns(T::Array[T.untyped]) } + def required_ancestors_by(mod); end + end +end + +# @abstract Subclasses must implement the `abstract` methods below. +module Tapioca::Runtime::Trackers::Tracker + abstract! + + # source://tapioca//lib/tapioca/runtime/trackers/tracker.rb#26 + sig { void } + def disable!; end + + # @return [Boolean] + # + # source://tapioca//lib/tapioca/runtime/trackers/tracker.rb#30 + def enabled?; end + + # source://tapioca//lib/tapioca/runtime/trackers/tracker.rb#34 + def with_disabled_tracker(&block); end + + class << self + # source://tapioca//lib/tapioca/runtime/trackers/tracker.rb#17 + sig { params(base: T.all(::Module, ::Tapioca::Runtime::Trackers::Tracker)).void } + def extended(base); end + end +end + +# source://tapioca//lib/tapioca.rb#34 +Tapioca::SORBET_CONFIG_FILE = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca.rb#33 +Tapioca::SORBET_DIR = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#5 +module Tapioca::SorbetHelper + # source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#32 + sig { params(sorbet_args: ::String).returns(::Spoom::ExecResult) } + def sorbet(*sorbet_args); end + + # source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#37 + sig { returns(::String) } + def sorbet_path; end + + # source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#44 + sig { params(feature: ::Symbol, version: T.nilable(::Gem::Version)).returns(T::Boolean) } + def sorbet_supports?(feature, version: T.unsafe(nil)); end +end + +# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#24 +Tapioca::SorbetHelper::FEATURE_REQUIREMENTS = T.let(T.unsafe(nil), Hash) + +# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#13 +Tapioca::SorbetHelper::SORBET_BIN = T.let(T.unsafe(nil), Pathname) + +# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#18 +Tapioca::SorbetHelper::SORBET_EXE_PATH_ENV_VAR = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#8 +Tapioca::SorbetHelper::SORBET_GEM_SPEC = T.let(T.unsafe(nil), Gem::Specification) + +# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#20 +Tapioca::SorbetHelper::SORBET_PAYLOAD_URL = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#22 +Tapioca::SorbetHelper::SPOOM_CONTEXT = T.let(T.unsafe(nil), Spoom::Context) + +# source://tapioca//lib/tapioca/static/symbol_table_parser.rb#5 +module Tapioca::Static; end + +# source://tapioca//lib/tapioca/static/requires_compiler.rb#6 +class Tapioca::Static::RequiresCompiler + # source://tapioca//lib/tapioca/static/requires_compiler.rb#10 + sig { params(sorbet_path: ::String).void } + def initialize(sorbet_path); end + + # source://tapioca//lib/tapioca/static/requires_compiler.rb#15 + sig { returns(::String) } + def compile; end + + private + + # source://tapioca//lib/tapioca/static/requires_compiler.rb#29 + sig { params(config: ::Spoom::Sorbet::Config).returns(T::Array[::String]) } + def collect_files(config); end + + # source://tapioca//lib/tapioca/static/requires_compiler.rb#44 + sig { params(file_path: ::String).returns(T::Enumerable[::String]) } + def collect_requires(file_path); end + + # source://tapioca//lib/tapioca/static/requires_compiler.rb#51 + sig { params(config: ::Spoom::Sorbet::Config, file_path: ::Pathname).returns(T::Boolean) } + def file_ignored_by_sorbet?(config, file_path); end + + # source://tapioca//lib/tapioca/static/requires_compiler.rb#80 + sig { params(path: ::Pathname).returns(T::Array[::String]) } + def path_parts(path); end +end + +# source://tapioca//lib/tapioca/static/symbol_loader.rb#6 +module Tapioca::Static::SymbolLoader + extend ::Tapioca::SorbetHelper + extend ::Tapioca::Runtime::AttachedClassOf + extend ::Tapioca::Runtime::Reflection + + class << self + # source://tapioca//lib/tapioca/static/symbol_loader.rb#23 + sig { params(gem: ::Tapioca::Gemfile::GemSpec).returns(T::Set[::String]) } + def engine_symbols(gem); end + + # source://tapioca//lib/tapioca/static/symbol_loader.rb#48 + sig { params(gem: ::Tapioca::Gemfile::GemSpec).returns(T::Set[::String]) } + def gem_symbols(gem); end + + # source://tapioca//lib/tapioca/static/symbol_loader.rb#13 + sig { returns(T::Set[::String]) } + def payload_symbols; end + + # source://tapioca//lib/tapioca/static/symbol_loader.rb#53 + sig { params(paths: T::Array[::Pathname]).returns(T::Set[::String]) } + def symbols_from_paths(paths); end + + private + + # @return [Array] + # + # source://sorbet-runtime/0.5.11609/lib/types/private/methods/_methods.rb#257 + def engines(*args, **_arg1, &blk); end + + # source://tapioca//lib/tapioca/static/symbol_loader.rb#82 + sig { params(input: ::String, table_type: ::String).returns(::String) } + def symbol_table_json_from(input, table_type: T.unsafe(nil)); end + end +end + +# source://tapioca//lib/tapioca/static/symbol_table_parser.rb#6 +class Tapioca::Static::SymbolTableParser + # source://tapioca//lib/tapioca/static/symbol_table_parser.rb#30 + sig { void } + def initialize; end + + # source://tapioca//lib/tapioca/static/symbol_table_parser.rb#65 + sig { params(name: ::String).returns(::String) } + def fully_qualified_name(name); end + + # source://tapioca//lib/tapioca/static/symbol_table_parser.rb#36 + sig { params(object: T::Hash[::String, T.untyped]).void } + def parse_object(object); end + + # source://tapioca//lib/tapioca/static/symbol_table_parser.rb#27 + sig { returns(T::Set[::String]) } + def symbols; end + + class << self + # source://tapioca//lib/tapioca/static/symbol_table_parser.rb#15 + sig { params(json_string: ::String).returns(T::Set[::String]) } + def parse_json(json_string); end + end +end + +# source://tapioca//lib/tapioca/static/symbol_table_parser.rb#9 +Tapioca::Static::SymbolTableParser::SKIP_PARSE_KINDS = T.let(T.unsafe(nil), Array) + +# source://tapioca//lib/tapioca.rb#36 +Tapioca::TAPIOCA_CONFIG_FILE = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca.rb#35 +Tapioca::TAPIOCA_DIR = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#108 +class Tapioca::TypeVariable < ::T::Types::TypeVariable + # @return [TypeVariable] a new instance of TypeVariable + # + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#109 + def initialize(name, variance); end + + # Returns the value of attribute name. + # + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#114 + def name; end +end + +# This is subclassing from `Module` so that instances of this type will be modules. +# The reason why we want that is because that means those instances will automatically +# get bound to the constant names they are assigned to by Ruby. As a result, we don't +# need to do any matching of constants to type variables to bind their names, Ruby will +# do that automatically for us and we get the `name` method for free from `Module`. +# +# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#122 +class Tapioca::TypeVariableModule < ::Module + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#146 + sig do + params( + context: ::Module, + type: ::Tapioca::TypeVariableModule::Type, + variance: ::Symbol, + bounds_proc: T.nilable(T.proc.returns(T::Hash[::Symbol, T.untyped])) + ).void + end + def initialize(context, type, variance, bounds_proc); end + + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#181 + sig { returns(::Tapioca::TypeVariable) } + def coerce_to_type_variable; end + + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#161 + sig { returns(T::Boolean) } + def fixed?; end + + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#155 + sig { returns(T.nilable(::String)) } + def name; end + + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#166 + sig { returns(::String) } + def serialize; end + + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#136 + sig { returns(::Tapioca::TypeVariableModule::Type) } + def type; end + + private + + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#188 + sig { returns(T::Hash[::Symbol, T.untyped]) } + def bounds; end +end + +# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#133 +Tapioca::TypeVariableModule::DEFAULT_BOUNDS_PROC = T.let(T.unsafe(nil), Proc) + +# source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#125 +class Tapioca::TypeVariableModule::Type < ::T::Enum + enums do + Member = new + Template = new + HasAttachedClass = new + end +end + +# source://tapioca//lib/tapioca/version.rb#5 +Tapioca::VERSION = T.let(T.unsafe(nil), String) + +# source://tapioca//lib/tapioca/helpers/source_uri.rb#7 +class URI::Source < ::URI::File + # source://tapioca//lib/tapioca/helpers/source_uri.rb#58 + sig { params(v: T.nilable(::String)).returns(T::Boolean) } + def check_host(v); end + + # source://uri/0.13.0/uri/generic.rb#243 + def gem_name; end + + # source://tapioca//lib/tapioca/helpers/source_uri.rb#25 + sig { returns(T.nilable(::String)) } + def gem_version; end + + # source://uri/0.13.0/uri/generic.rb#283 + def line_number; end + + # source://tapioca//lib/tapioca/helpers/source_uri.rb#51 + sig { params(v: T.nilable(::String)).void } + def set_path(v); end + + # source://tapioca//lib/tapioca/helpers/source_uri.rb#70 + sig { returns(::String) } + def to_s; end + + class << self + # source://tapioca//lib/tapioca/helpers/source_uri.rb#38 + sig do + params( + gem_name: ::String, + gem_version: T.nilable(::String), + path: ::String, + line_number: T.nilable(::String) + ).returns(::URI::Source) + end + def build(gem_name:, gem_version:, path:, line_number:); end + end +end + +# source://tapioca//lib/tapioca/helpers/source_uri.rb#10 +URI::Source::COMPONENT = T.let(T.unsafe(nil), Array) diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/thor@1.3.2.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/thor@1.3.2.rbi new file mode 100644 index 0000000..06a6a7c --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/thor@1.3.2.rbi @@ -0,0 +1,4345 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `thor` gem. +# Please instead update this file by running `bin/tapioca gem thor`. + + +# source://thor//lib/thor/shell/lcs_diff.rb#1 +module LCSDiff + protected + + # Overwrite show_diff to show diff with colors if Diff::LCS is + # available. + # + # source://thor//lib/thor/shell/lcs_diff.rb#6 + def show_diff(destination, content); end + + private + + # Check if Diff::LCS is loaded. If it is, use it to create pretty output + # for diff. + # + # @return [Boolean] + # + # source://thor//lib/thor/shell/lcs_diff.rb#37 + def diff_lcs_loaded?; end + + # source://thor//lib/thor/shell/lcs_diff.rb#21 + def output_diff_line(diff); end +end + +# source://thor//lib/thor/command.rb#1 +class Thor + include ::Thor::Base + include ::Thor::Invocation + include ::Thor::Shell + extend ::Thor::Base::ClassMethods + extend ::Thor::Invocation::ClassMethods + + # source://thor//lib/thor.rb#663 + def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + class << self + # Adds and declares option group for required at least one of options in the + # block of arguments. You can declare options as the outside of the block. + # + # If :for is given as option, it allows you to change the options from + # a previous defined command. + # + # ==== Parameters + # Array[Thor::Option.name] + # options:: :for is applied for previous defined command. + # + # ==== Examples + # + # at_least_one do + # option :one + # option :two + # end + # + # Or + # + # option :one + # option :two + # at_least_one :one, :two + # + # If you do not give "--one" and "--two" AtLeastOneRequiredArgumentError + # will be raised. + # + # You can use at_least_one and exclusive at the same time. + # + # exclusive do + # at_least_one do + # option :one + # option :two + # end + # end + # + # Then it is required either only one of "--one" or "--two". + # + # source://thor//lib/thor.rb#246 + def at_least_one(*args, &block); end + + # Extend check unknown options to accept a hash of conditions. + # + # === Parameters + # options: A hash containing :only and/or :except keys + # + # source://thor//lib/thor.rb#350 + def check_unknown_options!(options = T.unsafe(nil)); end + + # Overwrite check_unknown_options? to take subcommands and options into account. + # + # @return [Boolean] + # + # source://thor//lib/thor.rb#363 + def check_unknown_options?(config); end + + # Checks if a specified command exists. + # + # ==== Parameters + # command_name:: The name of the command to check for existence. + # + # ==== Returns + # Boolean:: +true+ if the command exists, +false+ otherwise. + # + # @return [Boolean] + # + # source://thor//lib/thor.rb#449 + def command_exists?(command_name); end + + # Prints help information for the given command. + # + # ==== Parameters + # shell + # command_name + # + # source://thor//lib/thor.rb#258 + def command_help(shell, command_name); end + + # Sets the default command when thor is executed without an explicit command to be called. + # + # ==== Parameters + # meth:: name of the default command + # + # source://thor//lib/thor.rb#21 + def default_command(meth = T.unsafe(nil)); end + + # Sets the default command when thor is executed without an explicit command to be called. + # + # ==== Parameters + # meth:: name of the default command + # + # source://thor//lib/thor.rb#21 + def default_task(meth = T.unsafe(nil)); end + + # source://thor//lib/thor/base.rb#26 + def deprecation_warning(message); end + + # Defines the usage and the description of the next command. + # + # ==== Parameters + # usage + # description + # options + # + # source://thor//lib/thor.rb#54 + def desc(usage, description, options = T.unsafe(nil)); end + + # Disable the check for required options for the given commands. + # This is useful if you have a command that does not need the required options + # to work, like help. + # + # ==== Parameters + # Symbol ...:: A list of commands that should be affected. + # + # source://thor//lib/thor.rb#434 + def disable_required_check!(*command_names); end + + # @return [Boolean] + # + # source://thor//lib/thor.rb#438 + def disable_required_check?(command); end + + # Adds and declares option group for exclusive options in the + # block and arguments. You can declare options as the outside of the block. + # + # If :for is given as option, it allows you to change the options from + # a previous defined command. + # + # ==== Parameters + # Array[Thor::Option.name] + # options:: :for is applied for previous defined command. + # + # ==== Examples + # + # exclusive do + # option :one + # option :two + # end + # + # Or + # + # option :one + # option :two + # exclusive :one, :two + # + # If you give "--one" and "--two" at the same time ExclusiveArgumentsError + # will be raised. + # + # source://thor//lib/thor.rb#203 + def exclusive(*args, &block); end + + # Prints help information for this class. + # + # ==== Parameters + # shell + # + # source://thor//lib/thor.rb#288 + def help(shell, subcommand = T.unsafe(nil)); end + + # Defines the long description of the next command. + # + # Long description is by default indented, line-wrapped and repeated whitespace merged. + # In order to print long description verbatim, with indentation and spacing exactly + # as found in the code, use the +wrap+ option + # + # long_desc 'your very long description', wrap: false + # + # ==== Parameters + # long description + # options + # + # source://thor//lib/thor.rb#78 + def long_desc(long_description, options = T.unsafe(nil)); end + + # Maps an input to a command. If you define: + # + # map "-T" => "list" + # + # Running: + # + # thor -T + # + # Will invoke the list command. + # + # ==== Parameters + # Hash[String|Array => Symbol]:: Maps the string or the strings in the array to the given command. + # + # source://thor//lib/thor.rb#101 + def map(mappings = T.unsafe(nil), **kw); end + + # Adds and declares option group for required at least one of options in the + # block of arguments. You can declare options as the outside of the block. + # + # If :for is given as option, it allows you to change the options from + # a previous defined command. + # + # ==== Parameters + # Array[Thor::Option.name] + # options:: :for is applied for previous defined command. + # + # ==== Examples + # + # at_least_one do + # option :one + # option :two + # end + # + # Or + # + # option :one + # option :two + # at_least_one :one, :two + # + # If you do not give "--one" and "--two" AtLeastOneRequiredArgumentError + # will be raised. + # + # You can use at_least_one and exclusive at the same time. + # + # exclusive do + # at_least_one do + # option :one + # option :two + # end + # end + # + # Then it is required either only one of "--one" or "--two". + # + # source://thor//lib/thor.rb#246 + def method_at_least_one(*args, &block); end + + # Adds and declares option group for exclusive options in the + # block and arguments. You can declare options as the outside of the block. + # + # If :for is given as option, it allows you to change the options from + # a previous defined command. + # + # ==== Parameters + # Array[Thor::Option.name] + # options:: :for is applied for previous defined command. + # + # ==== Examples + # + # exclusive do + # option :one + # option :two + # end + # + # Or + # + # option :one + # option :two + # exclusive :one, :two + # + # If you give "--one" and "--two" at the same time ExclusiveArgumentsError + # will be raised. + # + # source://thor//lib/thor.rb#203 + def method_exclusive(*args, &block); end + + # Adds an option to the set of method options. If :for is given as option, + # it allows you to change the options from a previous defined command. + # + # def previous_command + # # magic + # end + # + # method_option :foo, :for => :previous_command + # + # def next_command + # # magic + # end + # + # ==== Parameters + # name:: The name of the argument. + # options:: Described below. + # + # ==== Options + # :desc - Description for the argument. + # :required - If the argument is required or not. + # :default - Default value for this argument. It cannot be required and have default values. + # :aliases - Aliases for this option. + # :type - The type of the argument, can be :string, :hash, :array, :numeric or :boolean. + # :banner - String to show on usage notes. + # :hide - If you want to hide this option from the help. + # + # source://thor//lib/thor.rb#163 + def method_option(name, options = T.unsafe(nil)); end + + # Declares the options for the next command to be declared. + # + # ==== Parameters + # Hash[Symbol => Object]:: The hash key is the name of the option and the value + # is the type of the option. Can be :string, :array, :hash, :boolean, :numeric + # or :required (string). If you give a value, the type of the value is used. + # + # source://thor//lib/thor.rb#129 + def method_options(options = T.unsafe(nil)); end + + # Adds an option to the set of method options. If :for is given as option, + # it allows you to change the options from a previous defined command. + # + # def previous_command + # # magic + # end + # + # method_option :foo, :for => :previous_command + # + # def next_command + # # magic + # end + # + # ==== Parameters + # name:: The name of the argument. + # options:: Described below. + # + # ==== Options + # :desc - Description for the argument. + # :required - If the argument is required or not. + # :default - Default value for this argument. It cannot be required and have default values. + # :aliases - Aliases for this option. + # :type - The type of the argument, can be :string, :hash, :array, :numeric or :boolean. + # :banner - String to show on usage notes. + # :hide - If you want to hide this option from the help. + # + # source://thor//lib/thor.rb#163 + def option(name, options = T.unsafe(nil)); end + + # Declares the options for the next command to be declared. + # + # ==== Parameters + # Hash[Symbol => Object]:: The hash key is the name of the option and the value + # is the type of the option. Can be :string, :array, :hash, :boolean, :numeric + # or :required (string). If you give a value, the type of the value is used. + # + # source://thor//lib/thor.rb#129 + def options(options = T.unsafe(nil)); end + + # Allows for custom "Command" package naming. + # + # === Parameters + # name + # options + # + # source://thor//lib/thor.rb#12 + def package_name(name, _ = T.unsafe(nil)); end + + # Returns commands ready to be printed. + # + # source://thor//lib/thor.rb#309 + def printable_commands(all = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # Returns commands ready to be printed. + # + # source://thor//lib/thor.rb#309 + def printable_tasks(all = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # Registers another Thor subclass as a command. + # + # ==== Parameters + # klass:: Thor subclass to register + # command:: Subcommand name to use + # usage:: Short usage for the subcommand + # description:: Description for the subcommand + # + # source://thor//lib/thor.rb#37 + def register(klass, subcommand_name, usage, description, options = T.unsafe(nil)); end + + # Stop parsing of options as soon as an unknown option or a regular + # argument is encountered. All remaining arguments are passed to the command. + # This is useful if you have a command that can receive arbitrary additional + # options, and where those additional options should not be handled by + # Thor. + # + # ==== Example + # + # To better understand how this is useful, let's consider a command that calls + # an external command. A user may want to pass arbitrary options and + # arguments to that command. The command itself also accepts some options, + # which should be handled by Thor. + # + # class_option "verbose", :type => :boolean + # stop_on_unknown_option! :exec + # check_unknown_options! :except => :exec + # + # desc "exec", "Run a shell command" + # def exec(*args) + # puts "diagnostic output" if options[:verbose] + # Kernel.exec(*args) + # end + # + # Here +exec+ can be called with +--verbose+ to get diagnostic output, + # e.g.: + # + # $ thor exec --verbose echo foo + # diagnostic output + # foo + # + # But if +--verbose+ is given after +echo+, it is passed to +echo+ instead: + # + # $ thor exec echo --verbose foo + # --verbose foo + # + # ==== Parameters + # Symbol ...:: A list of commands that should be affected. + # + # source://thor//lib/thor.rb#420 + def stop_on_unknown_option!(*command_names); end + + # @return [Boolean] + # + # source://thor//lib/thor.rb#424 + def stop_on_unknown_option?(command); end + + # source://thor//lib/thor.rb#329 + def subcommand(subcommand, subcommand_class); end + + # source://thor//lib/thor.rb#325 + def subcommand_classes; end + + # source://thor//lib/thor.rb#320 + def subcommands; end + + # source://thor//lib/thor.rb#329 + def subtask(subcommand, subcommand_class); end + + # source://thor//lib/thor.rb#320 + def subtasks; end + + # Prints help information for the given command. + # + # ==== Parameters + # shell + # command_name + # + # source://thor//lib/thor.rb#258 + def task_help(shell, command_name); end + + protected + + # The banner for this class. You can customize it if you are invoking the + # thor class by another ways which is not the Thor::Runner. It receives + # the command that is going to be invoked and a boolean which indicates if + # the namespace should be displayed as arguments. + # + # source://thor//lib/thor.rb#546 + def banner(command, namespace = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # source://thor//lib/thor.rb#552 + def baseclass; end + + # source://thor//lib/thor.rb#560 + def create_command(meth); end + + # source://thor//lib/thor.rb#560 + def create_task(meth); end + + # help command has the required check disabled by default. + # + # source://thor//lib/thor.rb#478 + def disable_required_check; end + + # The method responsible for dispatching given the args. + # + # @yield [instance] + # + # source://thor//lib/thor.rb#505 + def dispatch(meth, given_args, given_opts, config); end + + # source://thor//lib/thor.rb#556 + def dynamic_command_class; end + + # this is the logic that takes the command name passed in by the user + # and determines whether it is an unambiguous substrings of a command or + # alias name. + # + # source://thor//lib/thor.rb#626 + def find_command_possibilities(meth); end + + # this is the logic that takes the command name passed in by the user + # and determines whether it is an unambiguous substrings of a command or + # alias name. + # + # source://thor//lib/thor.rb#626 + def find_task_possibilities(meth); end + + # source://thor//lib/thor.rb#586 + def initialize_added; end + + # Returns this class at least one of required options array set. + # + # ==== Returns + # Array[Array[Thor::Option.name]] + # + # source://thor//lib/thor.rb#469 + def method_at_least_one_option_names; end + + # Returns this class exclusive options array set. + # + # ==== Returns + # Array[Array[Thor::Option.name]] + # + # source://thor//lib/thor.rb#460 + def method_exclusive_option_names; end + + # receives a (possibly nil) command name and returns a name that is in + # the commands hash. In addition to normalizing aliases, this logic + # will determine if a shortened command is an unambiguous substring of + # a command or alias. + # + # +normalize_command_name+ also converts names like +animal-prison+ + # into +animal_prison+. + # + # @raise [AmbiguousTaskError] + # + # source://thor//lib/thor.rb#605 + def normalize_command_name(meth); end + + # receives a (possibly nil) command name and returns a name that is in + # the commands hash. In addition to normalizing aliases, this logic + # will determine if a shortened command is an unambiguous substring of + # a command or alias. + # + # +normalize_command_name+ also converts names like +animal-prison+ + # into +animal_prison+. + # + # @raise [AmbiguousTaskError] + # + # source://thor//lib/thor.rb#605 + def normalize_task_name(meth); end + + # source://thor//lib/thor.rb#493 + def print_at_least_one_required_options(shell, command = T.unsafe(nil)); end + + # source://thor//lib/thor.rb#482 + def print_exclusive_options(shell, command = T.unsafe(nil)); end + + # Retrieve the command name from given args. + # + # source://thor//lib/thor.rb#592 + def retrieve_command_name(args); end + + # Retrieve the command name from given args. + # + # source://thor//lib/thor.rb#592 + def retrieve_task_name(args); end + + # Sort the commands, lexicographically by default. + # + # Can be overridden in the subclass to change the display order of the + # commands. + # + # source://thor//lib/thor.rb#653 + def sort_commands!(list); end + + # source://thor//lib/thor.rb#473 + def stop_on_unknown_option; end + + # source://thor//lib/thor.rb#641 + def subcommand_help(cmd); end + + # source://thor//lib/thor.rb#641 + def subtask_help(cmd); end + end +end + +# source://thor//lib/thor/actions/empty_directory.rb#2 +module Thor::Actions + mixes_in_class_methods ::Thor::Actions::ClassMethods + + # Extends initializer to add more configuration options. + # + # ==== Configuration + # behavior:: The actions default behavior. Can be :invoke or :revoke. + # It also accepts :force, :skip and :pretend to set the behavior + # and the respective option. + # + # destination_root:: The root directory needed for some actions. + # + # source://thor//lib/thor/actions.rb#72 + def initialize(args = T.unsafe(nil), options = T.unsafe(nil), config = T.unsafe(nil)); end + + # Wraps an action object and call it accordingly to the thor class behavior. + # + # source://thor//lib/thor/actions.rb#89 + def action(instance); end + + # Create a new file relative to the destination root with the given data, + # which is the return value of a block or a data string. + # + # ==== Parameters + # destination:: the relative path to the destination root. + # data:: the data to append to the file. + # config:: give :verbose => false to not log the status. + # + # ==== Examples + # + # create_file "lib/fun_party.rb" do + # hostname = ask("What is the virtual hostname I should use?") + # "vhost.name = #{hostname}" + # end + # + # create_file "config/apache.conf", "your apache config" + # + # source://thor//lib/thor/actions/create_file.rb#22 + def add_file(destination, *args, &block); end + + # Create a new file relative to the destination root from the given source. + # + # ==== Parameters + # destination:: the relative path to the destination root. + # source:: the relative path to the source root. + # config:: give :verbose => false to not log the status. + # :: give :symbolic => false for hard link. + # + # ==== Examples + # + # create_link "config/apache.conf", "/etc/apache.conf" + # + # source://thor//lib/thor/actions/create_link.rb#17 + def add_link(destination, *args); end + + # Append text to a file. Since it depends on insert_into_file, it's reversible. + # + # ==== Parameters + # path:: path of the file to be changed + # data:: the data to append to the file, can be also given as a block. + # config:: give :verbose => false to not log the status. + # + # ==== Example + # + # append_to_file 'config/environments/test.rb', 'config.gem "rspec"' + # + # append_to_file 'config/environments/test.rb' do + # 'config.gem "rspec"' + # end + # + # source://thor//lib/thor/actions/file_manipulation.rb#192 + def append_file(path, *args, &block); end + + # Append text to a file. Since it depends on insert_into_file, it's reversible. + # + # ==== Parameters + # path:: path of the file to be changed + # data:: the data to append to the file, can be also given as a block. + # config:: give :verbose => false to not log the status. + # + # ==== Example + # + # append_to_file 'config/environments/test.rb', 'config.gem "rspec"' + # + # append_to_file 'config/environments/test.rb' do + # 'config.gem "rspec"' + # end + # + # source://thor//lib/thor/actions/file_manipulation.rb#192 + def append_to_file(path, *args, &block); end + + # Loads an external file and execute it in the instance binding. + # + # ==== Parameters + # path:: The path to the file to execute. Can be a web address or + # a relative path from the source root. + # + # ==== Examples + # + # apply "http://gist.github.com/103208" + # + # apply "recipes/jquery.rb" + # + # source://thor//lib/thor/actions.rb#216 + def apply(path, config = T.unsafe(nil)); end + + # Returns the value of attribute behavior. + # + # source://thor//lib/thor/actions.rb#10 + def behavior; end + + # Sets the attribute behavior + # + # @param value the value to set the attribute behavior to. + # + # source://thor//lib/thor/actions.rb#10 + def behavior=(_arg0); end + + # Changes the mode of the given file or directory. + # + # ==== Parameters + # mode:: the file mode + # path:: the name of the file to change mode + # config:: give :verbose => false to not log the status. + # + # ==== Example + # + # chmod "script/server", 0755 + # + # source://thor//lib/thor/actions/file_manipulation.rb#145 + def chmod(path, mode, config = T.unsafe(nil)); end + + # Comment all lines matching a given regex. It will leave the space + # which existed before the beginning of the line in tact and will insert + # a single space after the comment hash. + # + # ==== Parameters + # path:: path of the file to be changed + # flag:: the regexp or string used to decide which lines to comment + # config:: give :verbose => false to not log the status. + # + # ==== Example + # + # comment_lines 'config/initializers/session_store.rb', /cookie_store/ + # + # source://thor//lib/thor/actions/file_manipulation.rb#308 + def comment_lines(path, flag, *args); end + + # Copies the file from the relative source to the relative destination. If + # the destination is not given it's assumed to be equal to the source. + # + # ==== Parameters + # source:: the relative path to the source root. + # destination:: the relative path to the destination root. + # config:: give :verbose => false to not log the status, and + # :mode => :preserve, to preserve the file mode from the source. + # + # ==== Examples + # + # copy_file "README", "doc/README" + # + # copy_file "doc/README" + # + # source://thor//lib/thor/actions/file_manipulation.rb#20 + def copy_file(source, *args, &block); end + + # Create a new file relative to the destination root with the given data, + # which is the return value of a block or a data string. + # + # ==== Parameters + # destination:: the relative path to the destination root. + # data:: the data to append to the file. + # config:: give :verbose => false to not log the status. + # + # ==== Examples + # + # create_file "lib/fun_party.rb" do + # hostname = ask("What is the virtual hostname I should use?") + # "vhost.name = #{hostname}" + # end + # + # create_file "config/apache.conf", "your apache config" + # + # source://thor//lib/thor/actions/create_file.rb#22 + def create_file(destination, *args, &block); end + + # Create a new file relative to the destination root from the given source. + # + # ==== Parameters + # destination:: the relative path to the destination root. + # source:: the relative path to the source root. + # config:: give :verbose => false to not log the status. + # :: give :symbolic => false for hard link. + # + # ==== Examples + # + # create_link "config/apache.conf", "/etc/apache.conf" + # + # source://thor//lib/thor/actions/create_link.rb#17 + def create_link(destination, *args); end + + # Returns the root for this thor class (also aliased as destination root). + # + # source://thor//lib/thor/actions.rb#99 + def destination_root; end + + # Sets the root for this thor class. Relatives path are added to the + # directory where the script was invoked and expanded. + # + # source://thor//lib/thor/actions.rb#106 + def destination_root=(root); end + + # Copies recursively the files from source directory to root directory. + # If any of the files finishes with .tt, it's considered to be a template + # and is placed in the destination without the extension .tt. If any + # empty directory is found, it's copied and all .empty_directory files are + # ignored. If any file name is wrapped within % signs, the text within + # the % signs will be executed as a method and replaced with the returned + # value. Let's suppose a doc directory with the following files: + # + # doc/ + # components/.empty_directory + # README + # rdoc.rb.tt + # %app_name%.rb + # + # When invoked as: + # + # directory "doc" + # + # It will create a doc directory in the destination with the following + # files (assuming that the `app_name` method returns the value "blog"): + # + # doc/ + # components/ + # README + # rdoc.rb + # blog.rb + # + # Encoded path note: Since Thor internals use Object#respond_to? to check if it can + # expand %something%, this `something` should be a public method in the class calling + # #directory. If a method is private, Thor stack raises PrivateMethodEncodedError. + # + # ==== Parameters + # source:: the relative path to the source root. + # destination:: the relative path to the destination root. + # config:: give :verbose => false to not log the status. + # If :recursive => false, does not look for paths recursively. + # If :mode => :preserve, preserve the file mode from the source. + # If :exclude_pattern => /regexp/, prevents copying files that match that regexp. + # + # ==== Examples + # + # directory "doc" + # directory "doc", "docs", :recursive => false + # + # source://thor//lib/thor/actions/directory.rb#49 + def directory(source, *args, &block); end + + # Creates an empty directory. + # + # ==== Parameters + # destination:: the relative path to the destination root. + # config:: give :verbose => false to not log the status. + # + # ==== Examples + # + # empty_directory "doc" + # + # source://thor//lib/thor/actions/empty_directory.rb#13 + def empty_directory(destination, config = T.unsafe(nil)); end + + # Receives a file or directory and search for it in the source paths. + # + # @raise [Error] + # + # source://thor//lib/thor/actions.rb#133 + def find_in_source_paths(file); end + + # Gets the content at the given address and places it at the given relative + # destination. If a block is given instead of destination, the content of + # the url is yielded and used as location. + # + # +get+ relies on open-uri, so passing application user input would provide + # a command injection attack vector. + # + # ==== Parameters + # source:: the address of the given content. + # destination:: the relative path to the destination root. + # config:: give :verbose => false to not log the status, and + # :http_headers => to add headers to an http request. + # + # ==== Examples + # + # get "http://gist.github.com/103208", "doc/README" + # + # get "http://gist.github.com/103208", "doc/README", :http_headers => {"Content-Type" => "application/json"} + # + # get "http://gist.github.com/103208" do |content| + # content.split("\n").first + # end + # + # source://thor//lib/thor/actions/file_manipulation.rb#81 + def get(source, *args, &block); end + + # Run a regular expression replacement on a file. + # + # ==== Parameters + # path:: path of the file to be changed + # flag:: the regexp or string to be replaced + # replacement:: the replacement, can be also given as a block + # config:: give :verbose => false to not log the status, and + # :force => true, to force the replacement regardless of runner behavior. + # + # ==== Example + # + # gsub_file 'app/controllers/application_controller.rb', /#\s*(filter_parameter_logging :password)/, '\1' + # + # gsub_file 'README', /rake/, :green do |match| + # match << " no more. Use thor!" + # end + # + # source://thor//lib/thor/actions/file_manipulation.rb#262 + def gsub_file(path, flag, *args, &block); end + + # Goes to the root and execute the given block. + # + # source://thor//lib/thor/actions.rb#200 + def in_root; end + + # Injects text right after the class definition. Since it depends on + # insert_into_file, it's reversible. + # + # ==== Parameters + # path:: path of the file to be changed + # klass:: the class to be manipulated + # data:: the data to append to the class, can be also given as a block. + # config:: give :verbose => false to not log the status. + # + # ==== Examples + # + # inject_into_class "app/controllers/application_controller.rb", "ApplicationController", " filter_parameter :password\n" + # + # inject_into_class "app/controllers/application_controller.rb", "ApplicationController" do + # " filter_parameter :password\n" + # end + # + # source://thor//lib/thor/actions/file_manipulation.rb#216 + def inject_into_class(path, klass, *args, &block); end + + # source://thor//lib/thor/actions/inject_into_file.rb#26 + def inject_into_file(destination, *args, &block); end + + # Injects text right after the module definition. Since it depends on + # insert_into_file, it's reversible. + # + # ==== Parameters + # path:: path of the file to be changed + # module_name:: the module to be manipulated + # data:: the data to append to the class, can be also given as a block. + # config:: give :verbose => false to not log the status. + # + # ==== Examples + # + # inject_into_module "app/helpers/application_helper.rb", "ApplicationHelper", " def help; 'help'; end\n" + # + # inject_into_module "app/helpers/application_helper.rb", "ApplicationHelper" do + # " def help; 'help'; end\n" + # end + # + # source://thor//lib/thor/actions/file_manipulation.rb#239 + def inject_into_module(path, module_name, *args, &block); end + + # source://thor//lib/thor/actions/inject_into_file.rb#26 + def insert_into_file(destination, *args, &block); end + + # Do something in the root or on a provided subfolder. If a relative path + # is given it's referenced from the current root. The full path is yielded + # to the block you provide. The path is set back to the previous path when + # the method exits. + # + # Returns the value yielded by the block. + # + # ==== Parameters + # dir:: the directory to move to. + # config:: give :verbose => true to log and use padding. + # + # source://thor//lib/thor/actions.rb#170 + def inside(dir = T.unsafe(nil), config = T.unsafe(nil), &block); end + + # Links the file from the relative source to the relative destination. If + # the destination is not given it's assumed to be equal to the source. + # + # ==== Parameters + # source:: the relative path to the source root. + # destination:: the relative path to the destination root. + # config:: give :verbose => false to not log the status. + # + # ==== Examples + # + # link_file "README", "doc/README" + # + # link_file "doc/README" + # + # source://thor//lib/thor/actions/file_manipulation.rb#50 + def link_file(source, *args); end + + # Prepend text to a file. Since it depends on insert_into_file, it's reversible. + # + # ==== Parameters + # path:: path of the file to be changed + # data:: the data to prepend to the file, can be also given as a block. + # config:: give :verbose => false to not log the status. + # + # ==== Example + # + # prepend_to_file 'config/environments/test.rb', 'config.gem "rspec"' + # + # prepend_to_file 'config/environments/test.rb' do + # 'config.gem "rspec"' + # end + # + # source://thor//lib/thor/actions/file_manipulation.rb#170 + def prepend_file(path, *args, &block); end + + # Prepend text to a file. Since it depends on insert_into_file, it's reversible. + # + # ==== Parameters + # path:: path of the file to be changed + # data:: the data to prepend to the file, can be also given as a block. + # config:: give :verbose => false to not log the status. + # + # ==== Example + # + # prepend_to_file 'config/environments/test.rb', 'config.gem "rspec"' + # + # prepend_to_file 'config/environments/test.rb' do + # 'config.gem "rspec"' + # end + # + # source://thor//lib/thor/actions/file_manipulation.rb#170 + def prepend_to_file(path, *args, &block); end + + # Returns the given path relative to the absolute root (ie, root where + # the script started). + # + # source://thor//lib/thor/actions.rb#114 + def relative_to_original_destination_root(path, remove_dot = T.unsafe(nil)); end + + # Removes a file at the given location. + # + # ==== Parameters + # path:: path of the file to be changed + # config:: give :verbose => false to not log the status. + # + # ==== Example + # + # remove_file 'README' + # remove_file 'app/controllers/application_controller.rb' + # + # source://thor//lib/thor/actions/file_manipulation.rb#325 + def remove_dir(path, config = T.unsafe(nil)); end + + # Removes a file at the given location. + # + # ==== Parameters + # path:: path of the file to be changed + # config:: give :verbose => false to not log the status. + # + # ==== Example + # + # remove_file 'README' + # remove_file 'app/controllers/application_controller.rb' + # + # source://thor//lib/thor/actions/file_manipulation.rb#325 + def remove_file(path, config = T.unsafe(nil)); end + + # Executes a command returning the contents of the command. + # + # ==== Parameters + # command:: the command to be executed. + # config:: give :verbose => false to not log the status, :capture => true to hide to output. Specify :with + # to append an executable to command execution. + # + # ==== Example + # + # inside('vendor') do + # run('ln -s ~/edge rails') + # end + # + # source://thor//lib/thor/actions.rb#248 + def run(command, config = T.unsafe(nil)); end + + # Executes a ruby script (taking into account WIN32 platform quirks). + # + # ==== Parameters + # command:: the command to be executed. + # config:: give :verbose => false to not log the status. + # + # source://thor//lib/thor/actions.rb#285 + def run_ruby_script(command, config = T.unsafe(nil)); end + + # Holds source paths in instance so they can be manipulated. + # + # source://thor//lib/thor/actions.rb#127 + def source_paths; end + + # Gets an ERB template at the relative source, executes it and makes a copy + # at the relative destination. If the destination is not given it's assumed + # to be equal to the source removing .tt from the filename. + # + # ==== Parameters + # source:: the relative path to the source root. + # destination:: the relative path to the destination root. + # config:: give :verbose => false to not log the status. + # + # ==== Examples + # + # template "README", "doc/README" + # + # template "doc/README" + # + # source://thor//lib/thor/actions/file_manipulation.rb#117 + def template(source, *args, &block); end + + # Run a thor command. A hash of options can be given and it's converted to + # switches. + # + # ==== Parameters + # command:: the command to be invoked + # args:: arguments to the command + # config:: give :verbose => false to not log the status, :capture => true to hide to output. + # Other options are given as parameter to Thor. + # + # + # ==== Examples + # + # thor :install, "http://gist.github.com/103208" + # #=> thor install http://gist.github.com/103208 + # + # thor :list, :all => true, :substring => 'rails' + # #=> thor list --all --substring=rails + # + # source://thor//lib/thor/actions.rb#308 + def thor(command, *args); end + + # Uncomment all lines matching a given regex. Preserves indentation before + # the comment hash and removes the hash and any immediate following space. + # + # ==== Parameters + # path:: path of the file to be changed + # flag:: the regexp or string used to decide which lines to uncomment + # config:: give :verbose => false to not log the status. + # + # ==== Example + # + # uncomment_lines 'config/initializers/session_store.rb', /active_record/ + # + # source://thor//lib/thor/actions/file_manipulation.rb#289 + def uncomment_lines(path, flag, *args); end + + protected + + # source://thor//lib/thor/actions.rb#329 + def _cleanup_options_and_set(options, key); end + + # Allow current root to be shared between invocations. + # + # source://thor//lib/thor/actions.rb#325 + def _shared_configuration; end + + private + + # source://thor//lib/thor/actions/file_manipulation.rb#346 + def capture(*args); end + + # source://thor//lib/thor/actions/file_manipulation.rb#342 + def concat(string); end + + # Returns the value of attribute output_buffer. + # + # source://thor//lib/thor/actions/file_manipulation.rb#337 + def output_buffer; end + + # Sets the attribute output_buffer + # + # @param value the value to set the attribute output_buffer to. + # + # source://thor//lib/thor/actions/file_manipulation.rb#337 + def output_buffer=(_arg0); end + + # source://thor//lib/thor/actions/file_manipulation.rb#350 + def with_output_buffer(buf = T.unsafe(nil)); end + + class << self + # source://thor//lib/thor/actions.rb#12 + def included(base); end + end +end + +# Thor::Actions#capture depends on what kind of buffer is used in ERB. +# Thus CapturableERB fixes ERB to use String buffer. +# +# source://thor//lib/thor/actions/file_manipulation.rb#362 +class Thor::Actions::CapturableERB < ::ERB + # source://thor//lib/thor/actions/file_manipulation.rb#363 + def set_eoutvar(compiler, eoutvar = T.unsafe(nil)); end +end + +# source://thor//lib/thor/actions.rb#17 +module Thor::Actions::ClassMethods + # Add runtime options that help actions execution. + # + # source://thor//lib/thor/actions.rb#48 + def add_runtime_options!; end + + # Hold source paths for one Thor instance. source_paths_for_search is the + # method responsible to gather source_paths from this current class, + # inherited paths and the source root. + # + # source://thor//lib/thor/actions.rb#22 + def source_paths; end + + # Returns the source paths in the following order: + # + # 1) This class source paths + # 2) Source root + # 3) Parents source paths + # + # source://thor//lib/thor/actions.rb#38 + def source_paths_for_search; end + + # Stores and return the source root for this class + # + # source://thor//lib/thor/actions.rb#27 + def source_root(path = T.unsafe(nil)); end +end + +# CreateFile is a subset of Template, which instead of rendering a file with +# ERB, it gets the content from the user. +# +# source://thor//lib/thor/actions/create_file.rb#32 +class Thor::Actions::CreateFile < ::Thor::Actions::EmptyDirectory + # @return [CreateFile] a new instance of CreateFile + # + # source://thor//lib/thor/actions/create_file.rb#35 + def initialize(base, destination, data, config = T.unsafe(nil)); end + + # source://thor//lib/thor/actions/create_file.rb#33 + def data; end + + # Checks if the content of the file at the destination is identical to the rendered result. + # + # ==== Returns + # Boolean:: true if it is identical, false otherwise. + # + # @return [Boolean] + # + # source://thor//lib/thor/actions/create_file.rb#45 + def identical?; end + + # source://thor//lib/thor/actions/create_file.rb#60 + def invoke!; end + + # Holds the content to be added to the file. + # + # source://thor//lib/thor/actions/create_file.rb#52 + def render; end + + protected + + # Shows the file collision menu to the user and gets the result. + # + # @return [Boolean] + # + # source://thor//lib/thor/actions/create_file.rb#100 + def force_on_collision?; end + + # If force is true, run the action, otherwise check if it's not being + # skipped. If both are false, show the file_collision menu, if the menu + # returns true, force it, otherwise skip. + # + # source://thor//lib/thor/actions/create_file.rb#86 + def force_or_skip_or_conflict(force, skip, &block); end + + # Now on conflict we check if the file is identical or not. + # + # source://thor//lib/thor/actions/create_file.rb#73 + def on_conflict_behavior(&block); end +end + +# CreateLink is a subset of CreateFile, which instead of taking a block of +# data, just takes a source string from the user. +# +# source://thor//lib/thor/actions/create_link.rb#27 +class Thor::Actions::CreateLink < ::Thor::Actions::CreateFile + # source://thor//lib/thor/actions/create_link.rb#28 + def data; end + + # @return [Boolean] + # + # source://thor//lib/thor/actions/create_link.rb#56 + def exists?; end + + # Checks if the content of the file at the destination is identical to the rendered result. + # + # ==== Returns + # Boolean:: true if it is identical, false otherwise. + # + # @return [Boolean] + # + # source://thor//lib/thor/actions/create_link.rb#35 + def identical?; end + + # source://thor//lib/thor/actions/create_link.rb#40 + def invoke!; end +end + +# source://thor//lib/thor/actions/directory.rb#55 +class Thor::Actions::Directory < ::Thor::Actions::EmptyDirectory + # @return [Directory] a new instance of Directory + # + # source://thor//lib/thor/actions/directory.rb#58 + def initialize(base, source, destination = T.unsafe(nil), config = T.unsafe(nil), &block); end + + # source://thor//lib/thor/actions/directory.rb#64 + def invoke!; end + + # source://thor//lib/thor/actions/directory.rb#69 + def revoke!; end + + # Returns the value of attribute source. + # + # source://thor//lib/thor/actions/directory.rb#56 + def source; end + + protected + + # source://thor//lib/thor/actions/directory.rb#75 + def execute!; end + + # source://thor//lib/thor/actions/directory.rb#99 + def file_level_lookup(previous_lookup); end + + # source://thor//lib/thor/actions/directory.rb#103 + def files(lookup); end +end + +# source://thor//lib/thor/actions/empty_directory.rb#23 +class Thor::Actions::EmptyDirectory + # Initializes given the source and destination. + # + # ==== Parameters + # base:: A Thor::Base instance + # source:: Relative path to the source of this file + # destination:: Relative path to the destination of this file + # config:: give :verbose => false to not log the status. + # + # @return [EmptyDirectory] a new instance of EmptyDirectory + # + # source://thor//lib/thor/actions/empty_directory.rb#34 + def initialize(base, destination, config = T.unsafe(nil)); end + + # source://thor//lib/thor/actions/empty_directory.rb#24 + def base; end + + # source://thor//lib/thor/actions/empty_directory.rb#24 + def config; end + + # source://thor//lib/thor/actions/empty_directory.rb#24 + def destination; end + + # Checks if the destination file already exists. + # + # ==== Returns + # Boolean:: true if the file exists, false otherwise. + # + # @return [Boolean] + # + # source://thor//lib/thor/actions/empty_directory.rb#45 + def exists?; end + + # source://thor//lib/thor/actions/empty_directory.rb#24 + def given_destination; end + + # source://thor//lib/thor/actions/empty_directory.rb#49 + def invoke!; end + + # source://thor//lib/thor/actions/empty_directory.rb#24 + def relative_destination; end + + # source://thor//lib/thor/actions/empty_directory.rb#56 + def revoke!; end + + protected + + # Filenames in the encoded form are converted. If you have a file: + # + # %file_name%.rb + # + # It calls #file_name from the base and replaces %-string with the + # return value (should be String) of #file_name: + # + # user.rb + # + # The method referenced can be either public or private. + # + # source://thor//lib/thor/actions/empty_directory.rb#103 + def convert_encoded_instructions(filename); end + + # Sets the absolute destination value from a relative destination value. + # It also stores the given and relative destination. Let's suppose our + # script is being executed on "dest", it sets the destination root to + # "dest". The destination, given_destination and relative_destination + # are related in the following way: + # + # inside "bar" do + # empty_directory "baz" + # end + # + # destination #=> dest/bar/baz + # relative_destination #=> bar/baz + # given_destination #=> baz + # + # source://thor//lib/thor/actions/empty_directory.rb#85 + def destination=(destination); end + + # Receives a hash of options and just execute the block if some + # conditions are met. + # + # source://thor//lib/thor/actions/empty_directory.rb#113 + def invoke_with_conflict_check(&block); end + + # What to do when the destination file already exists. + # + # source://thor//lib/thor/actions/empty_directory.rb#132 + def on_conflict_behavior; end + + # source://thor//lib/thor/actions/empty_directory.rb#126 + def on_file_clash_behavior; end + + # Shortcut for pretend. + # + # @return [Boolean] + # + # source://thor//lib/thor/actions/empty_directory.rb#67 + def pretend?; end + + # Shortcut to say_status shell method. + # + # source://thor//lib/thor/actions/empty_directory.rb#138 + def say_status(status, color); end +end + +# source://thor//lib/thor/actions/inject_into_file.rb#36 +class Thor::Actions::InjectIntoFile < ::Thor::Actions::EmptyDirectory + # @return [InjectIntoFile] a new instance of InjectIntoFile + # + # source://thor//lib/thor/actions/inject_into_file.rb#39 + def initialize(base, destination, data, config); end + + # Returns the value of attribute behavior. + # + # source://thor//lib/thor/actions/inject_into_file.rb#37 + def behavior; end + + # Returns the value of attribute flag. + # + # source://thor//lib/thor/actions/inject_into_file.rb#37 + def flag; end + + # source://thor//lib/thor/actions/inject_into_file.rb#52 + def invoke!; end + + # Returns the value of attribute replacement. + # + # source://thor//lib/thor/actions/inject_into_file.rb#37 + def replacement; end + + # source://thor//lib/thor/actions/inject_into_file.rb#74 + def revoke!; end + + protected + + # source://thor//lib/thor/actions/inject_into_file.rb#110 + def content; end + + # Adds the content to the file. + # + # source://thor//lib/thor/actions/inject_into_file.rb#120 + def replace!(regexp, string, force); end + + # @return [Boolean] + # + # source://thor//lib/thor/actions/inject_into_file.rb#114 + def replacement_present?; end + + # source://thor//lib/thor/actions/inject_into_file.rb#90 + def say_status(behavior, warning: T.unsafe(nil), color: T.unsafe(nil)); end +end + +# Injects the given content into a file. Different from gsub_file, this +# method is reversible. +# +# ==== Parameters +# destination:: Relative path to the destination root +# data:: Data to add to the file. Can be given as a block. +# config:: give :verbose => false to not log the status and the flag +# for injection (:after or :before) or :force => true for +# insert two or more times the same content. +# +# ==== Examples +# +# insert_into_file "config/environment.rb", "config.gem :thor", :after => "Rails::Initializer.run do |config|\n" +# +# insert_into_file "config/environment.rb", :after => "Rails::Initializer.run do |config|\n" do +# gems = ask "Which gems would you like to add?" +# gems.split(" ").map{ |gem| " config.gem :#{gem}" }.join("\n") +# end +# +# source://thor//lib/thor/actions/inject_into_file.rb#24 +Thor::Actions::WARNINGS = T.let(T.unsafe(nil), Hash) + +# source://thor//lib/thor/error.rb#57 +class Thor::AmbiguousCommandError < ::Thor::Error; end + +# source://thor//lib/thor/error.rb#59 +Thor::AmbiguousTaskError = Thor::AmbiguousCommandError + +# source://thor//lib/thor/parser/argument.rb#2 +class Thor::Argument + # @raise [ArgumentError] + # @return [Argument] a new instance of Argument + # + # source://thor//lib/thor/parser/argument.rb#8 + def initialize(name, options = T.unsafe(nil)); end + + # Returns the value of attribute banner. + # + # source://thor//lib/thor/parser/argument.rb#5 + def banner; end + + # Returns the value of attribute default. + # + # source://thor//lib/thor/parser/argument.rb#5 + def default; end + + # Returns the value of attribute description. + # + # source://thor//lib/thor/parser/argument.rb#5 + def description; end + + # Returns the value of attribute enum. + # + # source://thor//lib/thor/parser/argument.rb#5 + def enum; end + + # source://thor//lib/thor/parser/argument.rb#52 + def enum_to_s; end + + # Returns the value of attribute name. + # + # source://thor//lib/thor/parser/argument.rb#5 + def human_name; end + + # Returns the value of attribute name. + # + # source://thor//lib/thor/parser/argument.rb#5 + def name; end + + # source://thor//lib/thor/parser/argument.rb#27 + def print_default; end + + # Returns the value of attribute required. + # + # source://thor//lib/thor/parser/argument.rb#5 + def required; end + + # @return [Boolean] + # + # source://thor//lib/thor/parser/argument.rb#39 + def required?; end + + # @return [Boolean] + # + # source://thor//lib/thor/parser/argument.rb#43 + def show_default?; end + + # Returns the value of attribute type. + # + # source://thor//lib/thor/parser/argument.rb#5 + def type; end + + # source://thor//lib/thor/parser/argument.rb#35 + def usage; end + + protected + + # source://thor//lib/thor/parser/argument.rb#71 + def default_banner; end + + # @return [Boolean] + # + # source://thor//lib/thor/parser/argument.rb#67 + def valid_type?(type); end + + # @raise [ArgumentError] + # + # source://thor//lib/thor/parser/argument.rb#62 + def validate!; end +end + +# source://thor//lib/thor/parser/argument.rb#3 +Thor::Argument::VALID_TYPES = T.let(T.unsafe(nil), Array) + +# source://thor//lib/thor/parser/arguments.rb#2 +class Thor::Arguments + # Takes an array of Thor::Argument objects. + # + # @return [Arguments] a new instance of Arguments + # + # source://thor//lib/thor/parser/arguments.rb#26 + def initialize(arguments = T.unsafe(nil)); end + + # source://thor//lib/thor/parser/arguments.rb#40 + def parse(args); end + + # source://thor//lib/thor/parser/arguments.rb#53 + def remaining; end + + private + + # Raises an error if @non_assigned_required array is not empty. + # + # @raise [RequiredArgumentMissingError] + # + # source://thor//lib/thor/parser/arguments.rb#186 + def check_requirement!; end + + # @return [Boolean] + # + # source://thor//lib/thor/parser/arguments.rb#84 + def current_is_value?; end + + # @return [Boolean] + # + # source://thor//lib/thor/parser/arguments.rb#64 + def last?; end + + # @return [Boolean] + # + # source://thor//lib/thor/parser/arguments.rb#59 + def no_or_skip?(arg); end + + # Runs through the argument array getting all strings until no string is + # found or a switch is found. + # + # ["a", "b", "c"] + # + # And returns it as an array: + # + # ["a", "b", "c"] + # + # source://thor//lib/thor/parser/arguments.rb#118 + def parse_array(name); end + + # Runs through the argument array getting strings that contains ":" and + # mark it as a hash: + # + # [ "name:string", "age:integer" ] + # + # Becomes: + # + # { "name" => "string", "age" => "integer" } + # + # source://thor//lib/thor/parser/arguments.rb#97 + def parse_hash(name); end + + # Check if the peek is numeric format and return a Float or Integer. + # Check if the peek is included in enum if enum is provided. + # Otherwise raises an error. + # + # source://thor//lib/thor/parser/arguments.rb#139 + def parse_numeric(name); end + + # Parse string: + # for --string-arg, just return the current value in the pile + # for --no-string-arg, nil + # Check if the peek is included in enum if enum is provided. Otherwise raises an error. + # + # source://thor//lib/thor/parser/arguments.rb#158 + def parse_string(name); end + + # source://thor//lib/thor/parser/arguments.rb#68 + def peek; end + + # source://thor//lib/thor/parser/arguments.rb#72 + def shift; end + + # source://thor//lib/thor/parser/arguments.rb#76 + def unshift(arg); end + + # Raises an error if the switch is an enum and the values aren't included on it. + # + # source://thor//lib/thor/parser/arguments.rb#172 + def validate_enum_value!(name, value, message); end + + class << self + # source://thor//lib/thor/parser/arguments.rb#19 + def parse(*args); end + + # Receives an array of args and returns two arrays, one with arguments + # and one with switches. + # + # source://thor//lib/thor/parser/arguments.rb#8 + def split(args); end + end +end + +# source://thor//lib/thor/parser/arguments.rb#3 +Thor::Arguments::NUMERIC = T.let(T.unsafe(nil), Regexp) + +# source://thor//lib/thor/error.rb#104 +class Thor::AtLeastOneRequiredArgumentError < ::Thor::InvocationError; end + +# source://thor//lib/thor/shell.rb#4 +module Thor::Base + include ::Thor::Invocation + include ::Thor::Shell + + mixes_in_class_methods ::Thor::Base::ClassMethods + mixes_in_class_methods ::Thor::Invocation::ClassMethods + + # It receives arguments in an Array and two hashes, one for options and + # other for configuration. + # + # Notice that it does not check if all required arguments were supplied. + # It should be done by the parser. + # + # ==== Parameters + # args:: An array of objects. The objects are applied to their + # respective accessors declared with argument. + # + # options:: An options hash that will be available as self.options. + # The hash given is converted to a hash with indifferent + # access, magic predicates (options.skip?) and then frozen. + # + # config:: Configuration for this Thor class. + # + # source://thor//lib/thor/base.rb#53 + def initialize(args = T.unsafe(nil), local_options = T.unsafe(nil), config = T.unsafe(nil)); end + + # Returns the value of attribute args. + # + # source://thor//lib/thor/base.rb#35 + def args; end + + # Sets the attribute args + # + # @param value the value to set the attribute args to. + # + # source://thor//lib/thor/base.rb#35 + def args=(_arg0); end + + # Returns the value of attribute options. + # + # source://thor//lib/thor/base.rb#35 + def options; end + + # Sets the attribute options + # + # @param value the value to set the attribute options to. + # + # source://thor//lib/thor/base.rb#35 + def options=(_arg0); end + + # Returns the value of attribute parent_options. + # + # source://thor//lib/thor/base.rb#35 + def parent_options; end + + # Sets the attribute parent_options + # + # @param value the value to set the attribute parent_options to. + # + # source://thor//lib/thor/base.rb#35 + def parent_options=(_arg0); end + + class << self + # source://thor//lib/thor/base.rb#116 + def included(base); end + + # Whenever a class inherits from Thor or Thor::Group, we should track the + # class and the file on Thor::Base. This is the method responsible for it. + # + # source://thor//lib/thor/base.rb#144 + def register_klass_file(klass); end + + # Returns the shell used in all Thor classes. If you are in a Unix platform + # it will use a colored log, otherwise it will use a basic one without color. + # + # source://thor//lib/thor/shell.rb#11 + def shell; end + + # Sets the attribute shell + # + # @param value the value to set the attribute shell to. + # + # source://thor//lib/thor/shell.rb#6 + def shell=(_arg0); end + + # Returns the files where the subclasses are kept. + # + # ==== Returns + # Hash[path => Class] + # + # source://thor//lib/thor/base.rb#137 + def subclass_files; end + + # Returns the classes that inherits from Thor or Thor::Group. + # + # ==== Returns + # Array[Class] + # + # source://thor//lib/thor/base.rb#128 + def subclasses; end + end +end + +# source://thor//lib/thor/base.rb#153 +module Thor::Base::ClassMethods + # Returns the commands for this Thor class and all subclasses. + # + # ==== Returns + # Hash:: An ordered hash with commands names as keys and Thor::Command + # objects as values. + # + # source://thor//lib/thor/base.rb#482 + def all_commands; end + + # Returns the commands for this Thor class and all subclasses. + # + # ==== Returns + # Hash:: An ordered hash with commands names as keys and Thor::Command + # objects as values. + # + # source://thor//lib/thor/base.rb#482 + def all_tasks; end + + # If you want to use defaults that don't match the type of an option, + # either specify `check_default_type: false` or call `allow_incompatible_default_type!` + # + # source://thor//lib/thor/base.rb#189 + def allow_incompatible_default_type!; end + + # Adds an argument to the class and creates an attr_accessor for it. + # + # Arguments are different from options in several aspects. The first one + # is how they are parsed from the command line, arguments are retrieved + # from position: + # + # thor command NAME + # + # Instead of: + # + # thor command --name=NAME + # + # Besides, arguments are used inside your code as an accessor (self.argument), + # while options are all kept in a hash (self.options). + # + # Finally, arguments cannot have type :default or :boolean but can be + # optional (supplying :optional => :true or :required => false), although + # you cannot have a required argument after a non-required argument. If you + # try it, an error is raised. + # + # ==== Parameters + # name:: The name of the argument. + # options:: Described below. + # + # ==== Options + # :desc - Description for the argument. + # :required - If the argument is required or not. + # :optional - If the argument is optional or not. + # :type - The type of the argument, can be :string, :hash, :array, :numeric. + # :default - Default value for this argument. It cannot be required and have default values. + # :banner - String to show on usage notes. + # + # ==== Errors + # ArgumentError:: Raised if you supply a required argument after a non required one. + # + # source://thor//lib/thor/base.rb#261 + def argument(name, options = T.unsafe(nil)); end + + # Returns this class arguments, looking up in the ancestors chain. + # + # ==== Returns + # Array[Thor::Argument] + # + # source://thor//lib/thor/base.rb#293 + def arguments; end + + # source://thor//lib/thor/base.rb#162 + def attr_accessor(*_arg0); end + + # source://thor//lib/thor/base.rb#154 + def attr_reader(*_arg0); end + + # source://thor//lib/thor/base.rb#158 + def attr_writer(*_arg0); end + + # source://thor//lib/thor/base.rb#193 + def check_default_type; end + + # If you want to raise an error when the default value of an option does not match + # the type call check_default_type! + # This will be the default; for compatibility a deprecation warning is issued if necessary. + # + # source://thor//lib/thor/base.rb#183 + def check_default_type!; end + + # source://thor//lib/thor/base.rb#172 + def check_unknown_options; end + + # If you want to raise an error for unknown options, call check_unknown_options! + # This is disabled by default to allow dynamic invocations. + # + # source://thor//lib/thor/base.rb#168 + def check_unknown_options!; end + + # @return [Boolean] + # + # source://thor//lib/thor/base.rb#176 + def check_unknown_options?(config); end + + # Adds and declares option group for required at least one of options in the + # block and arguments. You can declare options as the outside of the block. + # + # ==== Examples + # + # class_at_least_one do + # class_option :one + # class_option :two + # end + # + # Or + # + # class_option :one + # class_option :two + # class_at_least_one :one, :two + # + # If you do not give "--one" and "--two" AtLeastOneRequiredArgumentError + # will be raised. + # + # You can use class_at_least_one and class_exclusive at the same time. + # + # class_exclusive do + # class_at_least_one do + # class_option :one + # class_option :two + # end + # end + # + # Then it is required either only one of "--one" or "--two". + # + # source://thor//lib/thor/base.rb#392 + def class_at_least_one(*args, &block); end + + # Returns this class at least one of required options array set, looking up in the ancestors chain. + # + # ==== Returns + # Array[Array[Thor::Option.name]] + # + # source://thor//lib/thor/base.rb#411 + def class_at_least_one_option_names; end + + # Adds and declares option group for exclusive options in the + # block and arguments. You can declare options as the outside of the block. + # + # ==== Parameters + # Array[Thor::Option.name] + # + # ==== Examples + # + # class_exclusive do + # class_option :one + # class_option :two + # end + # + # Or + # + # class_option :one + # class_option :two + # class_exclusive :one, :two + # + # If you give "--one" and "--two" at the same time ExclusiveArgumentsError + # will be raised. + # + # source://thor//lib/thor/base.rb#357 + def class_exclusive(*args, &block); end + + # Returns this class exclusive options array set, looking up in the ancestors chain. + # + # ==== Returns + # Array[Array[Thor::Option.name]] + # + # source://thor//lib/thor/base.rb#402 + def class_exclusive_option_names; end + + # Adds an option to the set of class options + # + # ==== Parameters + # name:: The name of the argument. + # options:: Described below. + # + # ==== Options + # :desc:: -- Description for the argument. + # :required:: -- If the argument is required or not. + # :default:: -- Default value for this argument. + # :group:: -- The group for this options. Use by class options to output options in different levels. + # :aliases:: -- Aliases for this option. Note: Thor follows a convention of one-dash-one-letter options. Thus aliases like "-something" wouldn't be parsed; use either "\--something" or "-s" instead. + # :type:: -- The type of the argument, can be :string, :hash, :array, :numeric or :boolean. + # :banner:: -- String to show on usage notes. + # :hide:: -- If you want to hide this option from the help. + # + # source://thor//lib/thor/base.rb#328 + def class_option(name, options = T.unsafe(nil)); end + + # Adds a bunch of options to the set of class options. + # + # class_options :foo => false, :bar => :required, :baz => :string + # + # If you prefer more detailed declaration, check class_option. + # + # ==== Parameters + # Hash[Symbol => Object] + # + # source://thor//lib/thor/base.rb#306 + def class_options(options = T.unsafe(nil)); end + + # Returns the commands for this Thor class. + # + # ==== Returns + # Hash:: An ordered hash with commands names as keys and Thor::Command + # objects as values. + # + # source://thor//lib/thor/base.rb#471 + def commands; end + + # If true, option set will not suspend the execution of the command when + # a required option is not provided. + # + # @return [Boolean] + # + # source://thor//lib/thor/base.rb#207 + def disable_required_check?(command_name); end + + # A flag that makes the process exit with status 1 if any error happens. + # + # @return [Boolean] + # + # source://thor//lib/thor/base.rb#628 + def exit_on_failure?; end + + # Defines the group. This is used when thor list is invoked so you can specify + # that only commands from a pre-defined group will be shown. Defaults to standard. + # + # ==== Parameters + # name + # + # source://thor//lib/thor/base.rb#457 + def group(name = T.unsafe(nil)); end + + # @raise [InvocationError] + # + # source://thor//lib/thor/base.rb#618 + def handle_argument_error(command, error, args, arity); end + + # @raise [UndefinedCommandError] + # + # source://thor//lib/thor/base.rb#613 + def handle_no_command_error(command, has_namespace = T.unsafe(nil)); end + + # @raise [UndefinedCommandError] + # + # source://thor//lib/thor/base.rb#613 + def handle_no_task_error(command, has_namespace = T.unsafe(nil)); end + + # Sets the namespace for the Thor or Thor::Group class. By default the + # namespace is retrieved from the class name. If your Thor class is named + # Scripts::MyScript, the help method, for example, will be called as: + # + # thor scripts:my_script -h + # + # If you change the namespace: + # + # namespace :my_scripts + # + # You change how your commands are invoked: + # + # thor my_scripts -h + # + # Finally, if you change your namespace to default: + # + # namespace :default + # + # Your commands can be invoked with a shortcut. Instead of: + # + # thor :my_command + # + # source://thor//lib/thor/base.rb#566 + def namespace(name = T.unsafe(nil)); end + + # All methods defined inside the given block are not added as commands. + # + # So you can do: + # + # class MyScript < Thor + # no_commands do + # def this_is_not_a_command + # end + # end + # end + # + # You can also add the method and remove it from the command list: + # + # class MyScript < Thor + # def this_is_not_a_command + # end + # remove_command :this_is_not_a_command + # end + # + # source://thor//lib/thor/base.rb#530 + def no_commands(&block); end + + # @return [Boolean] + # + # source://thor//lib/thor/base.rb#540 + def no_commands?; end + + # source://thor//lib/thor/base.rb#536 + def no_commands_context; end + + # All methods defined inside the given block are not added as commands. + # + # So you can do: + # + # class MyScript < Thor + # no_commands do + # def this_is_not_a_command + # end + # end + # end + # + # You can also add the method and remove it from the command list: + # + # class MyScript < Thor + # def this_is_not_a_command + # end + # remove_command :this_is_not_a_command + # end + # + # source://thor//lib/thor/base.rb#530 + def no_tasks(&block); end + + # Allows to use private methods from parent in child classes as commands. + # + # ==== Parameters + # names:: Method names to be used as commands + # + # ==== Examples + # + # public_command :foo + # public_command :foo, :bar, :baz + # + # source://thor//lib/thor/base.rb#606 + def public_command(*names); end + + # Allows to use private methods from parent in child classes as commands. + # + # ==== Parameters + # names:: Method names to be used as commands + # + # ==== Examples + # + # public_command :foo + # public_command :foo, :bar, :baz + # + # source://thor//lib/thor/base.rb#606 + def public_task(*names); end + + # Removes a previous defined argument. If :undefine is given, undefine + # accessors as well. + # + # ==== Parameters + # names:: Arguments to be removed + # + # ==== Examples + # + # remove_argument :foo + # remove_argument :foo, :bar, :baz, :undefine => true + # + # source://thor//lib/thor/base.rb#426 + def remove_argument(*names); end + + # Removes a previous defined class option. + # + # ==== Parameters + # names:: Class options to be removed + # + # ==== Examples + # + # remove_class_option :foo + # remove_class_option :foo, :bar, :baz + # + # source://thor//lib/thor/base.rb#445 + def remove_class_option(*names); end + + # Removes a given command from this Thor class. This is usually done if you + # are inheriting from another class and don't want it to be available + # anymore. + # + # By default it only remove the mapping to the command. But you can supply + # :undefine => true to undefine the method from the class as well. + # + # ==== Parameters + # name:: The name of the command to be removed + # options:: You can give :undefine => true if you want commands the method + # to be undefined from the class as well. + # + # source://thor//lib/thor/base.rb#500 + def remove_command(*names); end + + # Removes a given command from this Thor class. This is usually done if you + # are inheriting from another class and don't want it to be available + # anymore. + # + # By default it only remove the mapping to the command. But you can supply + # :undefine => true to undefine the method from the class as well. + # + # ==== Parameters + # name:: The name of the command to be removed + # options:: You can give :undefine => true if you want commands the method + # to be undefined from the class as well. + # + # source://thor//lib/thor/base.rb#500 + def remove_task(*names); end + + # Parses the command and options from the given args, instantiate the class + # and invoke the command. This method is used when the arguments must be parsed + # from an array. If you are inside Ruby and want to use a Thor class, you + # can simply initialize it: + # + # script = MyScript.new(args, options, config) + # script.invoke(:command, first_arg, second_arg, third_arg) + # + # source://thor//lib/thor/base.rb#582 + def start(given_args = T.unsafe(nil), config = T.unsafe(nil)); end + + # If true, option parsing is suspended as soon as an unknown option or a + # regular argument is encountered. All remaining arguments are passed to + # the command as regular arguments. + # + # @return [Boolean] + # + # source://thor//lib/thor/base.rb#201 + def stop_on_unknown_option?(command_name); end + + # source://thor//lib/thor/base.rb#218 + def strict_args_position; end + + # If you want only strict string args (useful when cascading thor classes), + # call strict_args_position! This is disabled by default to allow dynamic + # invocations. + # + # source://thor//lib/thor/base.rb#214 + def strict_args_position!; end + + # @return [Boolean] + # + # source://thor//lib/thor/base.rb#222 + def strict_args_position?(config); end + + # Returns the commands for this Thor class. + # + # ==== Returns + # Hash:: An ordered hash with commands names as keys and Thor::Command + # objects as values. + # + # source://thor//lib/thor/base.rb#471 + def tasks; end + + protected + + # SIGNATURE: Sets the baseclass. This is where the superclass lookup + # finishes. + # + # source://thor//lib/thor/base.rb#777 + def baseclass; end + + # The basename of the program invoking the thor class. + # + # source://thor//lib/thor/base.rb#771 + def basename; end + + # Build an option and adds it to the given scope. + # + # ==== Parameters + # name:: The name of the argument. + # options:: Described in both class_option and method_option. + # scope:: Options hash that is being built up + # + # source://thor//lib/thor/base.rb#688 + def build_option(name, options, scope); end + + # Receives a hash of options, parse them and add to the scope. This is a + # fast way to set a bunch of options: + # + # build_options :foo => true, :bar => :required, :baz => :string + # + # ==== Parameters + # Hash[Symbol => Object] + # + # source://thor//lib/thor/base.rb#699 + def build_options(options, scope); end + + # Get target(method_options or class_options) options + # of before and after by block evaluation. + # + # source://thor//lib/thor/base.rb#808 + def built_option_names(target, opt = T.unsafe(nil), &block); end + + # Prints the class options per group. If an option does not belong to + # any group, it's printed as Class option. + # + # source://thor//lib/thor/base.rb#638 + def class_options_help(shell, groups = T.unsafe(nil)); end + + # Get command scope member by name. + # + # source://thor//lib/thor/base.rb#816 + def command_scope_member(name, options = T.unsafe(nil)); end + + # SIGNATURE: Creates a new command if valid_command? is true. This method is + # called when a new method is added to the class. + # + # source://thor//lib/thor/base.rb#782 + def create_command(meth); end + + # SIGNATURE: Creates a new command if valid_command? is true. This method is + # called when a new method is added to the class. + # + # source://thor//lib/thor/base.rb#782 + def create_task(meth); end + + # SIGNATURE: The hook invoked by start. + # + # @raise [NotImplementedError] + # + # source://thor//lib/thor/base.rb#792 + def dispatch(command, given_args, given_opts, config); end + + # Finds a command with the given name. If the command belongs to the current + # class, just return it, otherwise dup it and add the fresh copy to the + # current command hash. + # + # source://thor//lib/thor/base.rb#708 + def find_and_refresh_command(name); end + + # Finds a command with the given name. If the command belongs to the current + # class, just return it, otherwise dup it and add the fresh copy to the + # current command hash. + # + # source://thor//lib/thor/base.rb#708 + def find_and_refresh_task(name); end + + # Retrieves a value from superclass. If it reaches the baseclass, + # returns default. + # + # source://thor//lib/thor/base.rb#749 + def from_superclass(method, default = T.unsafe(nil)); end + + # Every time someone inherits from a Thor class, register the klass + # and file into baseclass. + # + # source://thor//lib/thor/base.rb#721 + def inherited(klass); end + + # SIGNATURE: Defines behavior when the initialize method is added to the + # class. + # + # source://thor//lib/thor/base.rb#788 + def initialize_added; end + + # Raises an error if the word given is a Thor reserved word. + # + # @return [Boolean] + # + # source://thor//lib/thor/base.rb#677 + def is_thor_reserved_word?(word, type); end + + # Fire this callback whenever a method is added. Added methods are + # tracked as commands by invoking the create_command method. + # + # source://thor//lib/thor/base.rb#729 + def method_added(meth); end + + # Receives a set of options and print them. + # + # source://thor//lib/thor/base.rb#656 + def print_options(shell, options, group_name = T.unsafe(nil)); end + + # Register a relation of options for target(method_option/class_option) + # by args and block. + # + # source://thor//lib/thor/base.rb#798 + def register_options_relation_for(target, relation, *args, &block); end +end + +# source://thor//lib/thor/command.rb#2 +class Thor::Command < ::Struct + # @return [Command] a new instance of Command + # + # source://thor//lib/thor/command.rb#5 + def initialize(name, description, long_description, wrap_long_description, usage, options = T.unsafe(nil), options_relation = T.unsafe(nil)); end + + # Returns the formatted usage by injecting given required arguments + # and required options into the given usage. + # + # source://thor//lib/thor/command.rb#42 + def formatted_usage(klass, namespace = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://thor//lib/thor/command.rb#15 + def hidden?; end + + # source://thor//lib/thor/command.rb#70 + def method_at_least_one_option_names; end + + # source://thor//lib/thor/command.rb#66 + def method_exclusive_option_names; end + + # By default, a command invokes a method in the thor class. You can change this + # implementation to create custom commands. + # + # source://thor//lib/thor/command.rb#21 + def run(instance, args = T.unsafe(nil)); end + + protected + + # @return [Boolean] + # + # source://thor//lib/thor/command.rb#114 + def handle_argument_error?(instance, error, caller); end + + # @return [Boolean] + # + # source://thor//lib/thor/command.rb#121 + def handle_no_method_error?(instance, error, caller); end + + # @return [Boolean] + # + # source://thor//lib/thor/command.rb#104 + def local_method?(instance, name); end + + # @return [Boolean] + # + # source://thor//lib/thor/command.rb#87 + def not_debugging?(instance); end + + # @return [Boolean] + # + # source://thor//lib/thor/command.rb#100 + def private_method?(instance); end + + # Given a target, checks if this class name is a public method. + # + # @return [Boolean] + # + # source://thor//lib/thor/command.rb#96 + def public_method?(instance); end + + # Add usage with required arguments + # + # source://thor//lib/thor/command.rb#77 + def required_arguments_for(klass, usage); end + + # source://thor//lib/thor/command.rb#91 + def required_options; end + + # source://thor//lib/thor/command.rb#109 + def sans_backtrace(backtrace, caller); end + + private + + # source://thor//lib/thor/command.rb#9 + def initialize_copy(other); end +end + +# source://thor//lib/thor/command.rb#3 +Thor::Command::FILE_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#2 +module Thor::CoreExt; end + +# A hash with indifferent access and magic predicates. +# +# hash = Thor::CoreExt::HashWithIndifferentAccess.new 'foo' => 'bar', 'baz' => 'bee', 'force' => true +# +# hash[:foo] #=> 'bar' +# hash['foo'] #=> 'bar' +# hash.foo? #=> true +# +# source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#11 +class Thor::CoreExt::HashWithIndifferentAccess < ::Hash + # @return [HashWithIndifferentAccess] a new instance of HashWithIndifferentAccess + # + # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#12 + def initialize(hash = T.unsafe(nil)); end + + # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#19 + def [](key); end + + # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#23 + def []=(key, value); end + + # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#27 + def delete(key); end + + # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#31 + def except(*keys); end + + # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#37 + def fetch(key, *args); end + + # @return [Boolean] + # + # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#45 + def key?(key); end + + # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#53 + def merge(other); end + + # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#57 + def merge!(other); end + + # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#72 + def replace(other_hash); end + + # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#64 + def reverse_merge(other); end + + # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#68 + def reverse_merge!(other_hash); end + + # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#41 + def slice(*keys); end + + # Convert to a Hash with String keys. + # + # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#77 + def to_hash; end + + # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#49 + def values_at(*indices); end + + protected + + # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#83 + def convert_key(key); end + + # Magic predicates. For instance: + # + # options.force? # => !!options['force'] + # options.shebang # => "/usr/lib/local/ruby" + # options.test_framework?(:rspec) # => options[:test_framework] == :rspec + # + # source://thor//lib/thor/core_ext/hash_with_indifferent_access.rb#93 + def method_missing(method, *args); end +end + +# source://thor//lib/thor/error.rb#3 +module Thor::Correctable + # source://thor//lib/thor/error.rb#8 + def corrections; end + + # source://thor//lib/thor/error.rb#4 + def to_s; end +end + +# A dynamic command that handles method missing scenarios. +# +# source://thor//lib/thor/command.rb#137 +class Thor::DynamicCommand < ::Thor::Command + # @return [DynamicCommand] a new instance of DynamicCommand + # + # source://thor//lib/thor/command.rb#138 + def initialize(name, options = T.unsafe(nil)); end + + # source://thor//lib/thor/command.rb#142 + def run(instance, args = T.unsafe(nil)); end +end + +# source://thor//lib/thor/command.rb#150 +Thor::DynamicTask = Thor::DynamicCommand + +# Thor::Error is raised when it's caused by wrong usage of thor classes. Those +# errors have their backtrace suppressed and are nicely shown to the user. +# +# Errors that are caused by the developer, like declaring a method which +# overwrites a thor keyword, SHOULD NOT raise a Thor::Error. This way, we +# ensure that developer errors are shown with full backtrace. +# +# source://thor//lib/thor/error.rb#20 +class Thor::Error < ::StandardError; end + +# source://thor//lib/thor/error.rb#101 +class Thor::ExclusiveArgumentError < ::Thor::InvocationError; end + +# Thor has a special class called Thor::Group. The main difference to Thor class +# is that it invokes all commands at once. It also include some methods that allows +# invocations to be done at the class method, which are not available to Thor +# commands. +# +# source://thor//lib/thor/group.rb#7 +class Thor::Group + include ::Thor::Base + include ::Thor::Invocation + include ::Thor::Shell + extend ::Thor::Base::ClassMethods + extend ::Thor::Invocation::ClassMethods + + protected + + # Shortcut to invoke with padding and block handling. Use internally by + # invoke and invoke_from_option class methods. + # + # source://thor//lib/thor/group.rb#276 + def _invoke_for_class_method(klass, command = T.unsafe(nil), *args, &block); end + + class << self + # Overwrite class options help to allow invoked generators options to be + # shown recursively when invoking a generator. + # + # source://thor//lib/thor/group.rb#161 + def class_options_help(shell, groups = T.unsafe(nil)); end + + # Checks if a specified command exists. + # + # ==== Parameters + # command_name:: The name of the command to check for existence. + # + # ==== Returns + # Boolean:: +true+ if the command exists, +false+ otherwise. + # + # @return [Boolean] + # + # source://thor//lib/thor/group.rb#221 + def command_exists?(command_name); end + + # The description for this Thor::Group. If none is provided, but a source root + # exists, tries to find the USAGE one folder above it, otherwise searches + # in the superclass. + # + # ==== Parameters + # description:: The description for this Thor::Group. + # + # source://thor//lib/thor/group.rb#16 + def desc(description = T.unsafe(nil)); end + + # Get invocations array and merge options from invocations. Those + # options are added to group_options hash. Options that already exists + # in base_options are not added twice. + # + # source://thor//lib/thor/group.rb#172 + def get_options_from_invocations(group_options, base_options); end + + # @raise [error] + # + # source://thor//lib/thor/group.rb#207 + def handle_argument_error(command, error, _args, arity); end + + # Prints help information. + # + # ==== Options + # short:: When true, shows only usage. + # + # source://thor//lib/thor/group.rb#29 + def help(shell); end + + # Stores invocation blocks used on invoke_from_option. + # + # source://thor//lib/thor/group.rb#45 + def invocation_blocks; end + + # Stores invocations for this class merging with superclass values. + # + # source://thor//lib/thor/group.rb#39 + def invocations; end + + # Invoke the given namespace or class given. It adds an instance + # method that will invoke the klass and command. You can give a block to + # configure how it will be invoked. + # + # The namespace/class given will have its options showed on the help + # usage. Check invoke_from_option for more information. + # + # source://thor//lib/thor/group.rb#56 + def invoke(*names, &block); end + + # Invoke a thor class based on the value supplied by the user to the + # given option named "name". A class option must be created before this + # method is invoked for each name given. + # + # ==== Examples + # + # class GemGenerator < Thor::Group + # class_option :test_framework, :type => :string + # invoke_from_option :test_framework + # end + # + # ==== Boolean options + # + # In some cases, you want to invoke a thor class if some option is true or + # false. This is automatically handled by invoke_from_option. Then the + # option name is used to invoke the generator. + # + # ==== Preparing for invocation + # + # In some cases you want to customize how a specified hook is going to be + # invoked. You can do that by overwriting the class method + # prepare_for_invocation. The class method must necessarily return a klass + # and an optional command. + # + # ==== Custom invocations + # + # You can also supply a block to customize how the option is going to be + # invoked. The block receives two parameters, an instance of the current + # class and the klass to be invoked. + # + # source://thor//lib/thor/group.rb#110 + def invoke_from_option(*names, &block); end + + # Returns commands ready to be printed. + # + # source://thor//lib/thor/group.rb#199 + def printable_commands(*_arg0); end + + # Returns commands ready to be printed. + # + # source://thor//lib/thor/group.rb#199 + def printable_tasks(*_arg0); end + + # Remove a previously added invocation. + # + # ==== Examples + # + # remove_invocation :test_framework + # + # source://thor//lib/thor/group.rb#149 + def remove_invocation(*names); end + + protected + + # The banner for this class. You can customize it if you are invoking the + # thor class by another ways which is not the Thor::Runner. + # + # source://thor//lib/thor/group.rb#249 + def banner; end + + # source://thor//lib/thor/group.rb#259 + def baseclass; end + + # source://thor//lib/thor/group.rb#263 + def create_command(meth); end + + # source://thor//lib/thor/group.rb#263 + def create_task(meth); end + + # The method responsible for dispatching given the args. + # + # @yield [instance] + # + # source://thor//lib/thor/group.rb#228 + def dispatch(command, given_args, given_opts, config); end + + # Represents the whole class as a command. + # + # source://thor//lib/thor/group.rb#254 + def self_command; end + + # Represents the whole class as a command. + # + # source://thor//lib/thor/group.rb#254 + def self_task; end + end +end + +# Shortcuts for help. +# +# source://thor//lib/thor/base.rb#17 +Thor::HELP_MAPPINGS = T.let(T.unsafe(nil), Array) + +# A command that is hidden in help messages but still invocable. +# +# source://thor//lib/thor/command.rb#129 +class Thor::HiddenCommand < ::Thor::Command + # @return [Boolean] + # + # source://thor//lib/thor/command.rb#130 + def hidden?; end +end + +# source://thor//lib/thor/command.rb#134 +Thor::HiddenTask = Thor::HiddenCommand + +# source://thor//lib/thor/invocation.rb#2 +module Thor::Invocation + mixes_in_class_methods ::Thor::Invocation::ClassMethods + + # Make initializer aware of invocations and the initialization args. + # + # source://thor//lib/thor/invocation.rb#23 + def initialize(args = T.unsafe(nil), options = T.unsafe(nil), config = T.unsafe(nil), &block); end + + # Make the current command chain accessible with in a Thor-(sub)command + # + # source://thor//lib/thor/invocation.rb#30 + def current_command_chain; end + + # Receives a name and invokes it. The name can be a string (either "command" or + # "namespace:command"), a Thor::Command, a Class or a Thor instance. If the + # command cannot be guessed by name, it can also be supplied as second argument. + # + # You can also supply the arguments, options and configuration values for + # the command to be invoked, if none is given, the same values used to + # initialize the invoker are used to initialize the invoked. + # + # When no name is given, it will invoke the default command of the current class. + # + # ==== Examples + # + # class A < Thor + # def foo + # invoke :bar + # invoke "b:hello", ["Erik"] + # end + # + # def bar + # invoke "b:hello", ["Erik"] + # end + # end + # + # class B < Thor + # def hello(name) + # puts "hello #{name}" + # end + # end + # + # You can notice that the method "foo" above invokes two commands: "bar", + # which belongs to the same class and "hello" which belongs to the class B. + # + # By using an invocation system you ensure that a command is invoked only once. + # In the example above, invoking "foo" will invoke "b:hello" just once, even + # if it's invoked later by "bar" method. + # + # When class A invokes class B, all arguments used on A initialization are + # supplied to B. This allows lazy parse of options. Let's suppose you have + # some rspec commands: + # + # class Rspec < Thor::Group + # class_option :mock_framework, :type => :string, :default => :rr + # + # def invoke_mock_framework + # invoke "rspec:#{options[:mock_framework]}" + # end + # end + # + # As you noticed, it invokes the given mock framework, which might have its + # own options: + # + # class Rspec::RR < Thor::Group + # class_option :style, :type => :string, :default => :mock + # end + # + # Since it's not rspec concern to parse mock framework options, when RR + # is invoked all options are parsed again, so RR can extract only the options + # that it's going to use. + # + # If you want Rspec::RR to be initialized with its own set of options, you + # have to do that explicitly: + # + # invoke "rspec:rr", [], :style => :foo + # + # Besides giving an instance, you can also give a class to invoke: + # + # invoke Rspec::RR, [], :style => :foo + # + # source://thor//lib/thor/invocation.rb#102 + def invoke(name = T.unsafe(nil), *args); end + + # Invoke all commands for the current instance. + # + # source://thor//lib/thor/invocation.rb#133 + def invoke_all; end + + # Invoke the given command if the given args. + # + # source://thor//lib/thor/invocation.rb#122 + def invoke_command(command, *args); end + + # Invoke the given command if the given args. + # + # source://thor//lib/thor/invocation.rb#122 + def invoke_task(command, *args); end + + # Invokes using shell padding. + # + # source://thor//lib/thor/invocation.rb#138 + def invoke_with_padding(*args); end + + protected + + # Initialize klass using values stored in the @_initializer. + # + # source://thor//lib/thor/invocation.rb#166 + def _parse_initialization_options(args, opts, config); end + + # This method simply retrieves the class and command to be invoked. + # If the name is nil or the given name is a command in the current class, + # use the given name and return self as class. Otherwise, call + # prepare_for_invocation in the current class. + # + # source://thor//lib/thor/invocation.rb#153 + def _retrieve_class_and_command(name, sent_command = T.unsafe(nil)); end + + # This method simply retrieves the class and command to be invoked. + # If the name is nil or the given name is a command in the current class, + # use the given name and return self as class. Otherwise, call + # prepare_for_invocation in the current class. + # + # source://thor//lib/thor/invocation.rb#153 + def _retrieve_class_and_task(name, sent_command = T.unsafe(nil)); end + + # Configuration values that are shared between invocations. + # + # source://thor//lib/thor/invocation.rb#145 + def _shared_configuration; end + + class << self + # source://thor//lib/thor/invocation.rb#3 + def included(base); end + end +end + +# source://thor//lib/thor/invocation.rb#8 +module Thor::Invocation::ClassMethods + # This method is responsible for receiving a name and find the proper + # class and command for it. The key is an optional parameter which is + # available only in class methods invocations (i.e. in Thor::Group). + # + # source://thor//lib/thor/invocation.rb#12 + def prepare_for_invocation(key, name); end +end + +# Raised when a command was found, but not invoked properly. +# +# source://thor//lib/thor/error.rb#62 +class Thor::InvocationError < ::Thor::Error; end + +# source://thor//lib/thor/line_editor/basic.rb#2 +module Thor::LineEditor + class << self + # source://thor//lib/thor/line_editor.rb#10 + def best_available; end + + # source://thor//lib/thor/line_editor.rb#6 + def readline(prompt, options = T.unsafe(nil)); end + end +end + +# source://thor//lib/thor/line_editor/basic.rb#3 +class Thor::LineEditor::Basic + # @return [Basic] a new instance of Basic + # + # source://thor//lib/thor/line_editor/basic.rb#10 + def initialize(prompt, options); end + + # Returns the value of attribute options. + # + # source://thor//lib/thor/line_editor/basic.rb#4 + def options; end + + # Returns the value of attribute prompt. + # + # source://thor//lib/thor/line_editor/basic.rb#4 + def prompt; end + + # source://thor//lib/thor/line_editor/basic.rb#15 + def readline; end + + private + + # @return [Boolean] + # + # source://thor//lib/thor/line_editor/basic.rb#32 + def echo?; end + + # source://thor//lib/thor/line_editor/basic.rb#22 + def get_input; end + + class << self + # @return [Boolean] + # + # source://thor//lib/thor/line_editor/basic.rb#6 + def available?; end + end +end + +# source://thor//lib/thor/line_editor/readline.rb#3 +class Thor::LineEditor::Readline < ::Thor::LineEditor::Basic + # source://thor//lib/thor/line_editor/readline.rb#13 + def readline; end + + private + + # @return [Boolean] + # + # source://thor//lib/thor/line_editor/readline.rb#28 + def add_to_history?; end + + # source://thor//lib/thor/line_editor/readline.rb#42 + def completion_options; end + + # source://thor//lib/thor/line_editor/readline.rb#32 + def completion_proc; end + + # @return [Boolean] + # + # source://thor//lib/thor/line_editor/readline.rb#46 + def use_path_completion?; end + + class << self + # @return [Boolean] + # + # source://thor//lib/thor/line_editor/readline.rb#4 + def available?; end + end +end + +# source://thor//lib/thor/line_editor/readline.rb#50 +class Thor::LineEditor::Readline::PathCompletion + # @return [PathCompletion] a new instance of PathCompletion + # + # source://thor//lib/thor/line_editor/readline.rb#54 + def initialize(text); end + + # source://thor//lib/thor/line_editor/readline.rb#58 + def matches; end + + private + + # source://thor//lib/thor/line_editor/readline.rb#68 + def absolute_matches; end + + # source://thor//lib/thor/line_editor/readline.rb#82 + def base_path; end + + # source://thor//lib/thor/line_editor/readline.rb#78 + def glob_pattern; end + + # source://thor//lib/thor/line_editor/readline.rb#64 + def relative_matches; end + + # Returns the value of attribute text. + # + # source://thor//lib/thor/line_editor/readline.rb#51 + def text; end +end + +# source://thor//lib/thor/error.rb#98 +class Thor::MalformattedArgumentError < ::Thor::InvocationError; end + +# source://thor//lib/thor/nested_context.rb#2 +class Thor::NestedContext + # @return [NestedContext] a new instance of NestedContext + # + # source://thor//lib/thor/nested_context.rb#3 + def initialize; end + + # source://thor//lib/thor/nested_context.rb#7 + def enter; end + + # @return [Boolean] + # + # source://thor//lib/thor/nested_context.rb#15 + def entered?; end + + private + + # source://thor//lib/thor/nested_context.rb#25 + def pop; end + + # source://thor//lib/thor/nested_context.rb#21 + def push; end +end + +# source://thor//lib/thor/parser/option.rb#2 +class Thor::Option < ::Thor::Argument + # @return [Option] a new instance of Option + # + # source://thor//lib/thor/parser/option.rb#7 + def initialize(name, options = T.unsafe(nil)); end + + # Returns the value of attribute aliases. + # + # source://thor//lib/thor/parser/option.rb#3 + def aliases; end + + # source://thor//lib/thor/parser/option.rb#99 + def aliases_for_usage; end + + # source://thor//lib/thor/parser/option.rb#118 + def array?; end + + # source://thor//lib/thor/parser/option.rb#118 + def boolean?; end + + # Returns the value of attribute group. + # + # source://thor//lib/thor/parser/option.rb#3 + def group; end + + # source://thor//lib/thor/parser/option.rb#118 + def hash?; end + + # Returns the value of attribute hide. + # + # source://thor//lib/thor/parser/option.rb#3 + def hide; end + + # source://thor//lib/thor/parser/option.rb#79 + def human_name; end + + # Returns the value of attribute lazy_default. + # + # source://thor//lib/thor/parser/option.rb#3 + def lazy_default; end + + # source://thor//lib/thor/parser/option.rb#118 + def numeric?; end + + # Returns the value of attribute repeatable. + # + # source://thor//lib/thor/parser/option.rb#3 + def repeatable; end + + # @return [Boolean] + # + # source://thor//lib/thor/parser/option.rb#107 + def show_default?; end + + # source://thor//lib/thor/parser/option.rb#118 + def string?; end + + # source://thor//lib/thor/parser/option.rb#75 + def switch_name; end + + # source://thor//lib/thor/parser/option.rb#83 + def usage(padding = T.unsafe(nil)); end + + protected + + # source://thor//lib/thor/parser/option.rb#168 + def dasherize(str); end + + # @return [Boolean] + # + # source://thor//lib/thor/parser/option.rb#160 + def dasherized?; end + + # source://thor//lib/thor/parser/option.rb#164 + def undasherize(str); end + + # @raise [ArgumentError] + # + # source://thor//lib/thor/parser/option.rb#126 + def validate!; end + + # source://thor//lib/thor/parser/option.rb#131 + def validate_default_type!; end + + private + + # source://thor//lib/thor/parser/option.rb#174 + def normalize_aliases(aliases); end + + class << self + # This parse quick options given as method_options. It makes several + # assumptions, but you can be more specific using the option method. + # + # parse :foo => "bar" + # #=> Option foo with default value bar + # + # parse [:foo, :baz] => "bar" + # #=> Option foo with default value bar and alias :baz + # + # parse :foo => :required + # #=> Required option foo without default value + # + # parse :foo => 2 + # #=> Option foo with default value 2 and type numeric + # + # parse :foo => :numeric + # #=> Option foo without default value and type numeric + # + # parse :foo => true + # #=> Option foo with default value true and type boolean + # + # The valid types are :boolean, :numeric, :hash, :array and :string. If none + # is given a default type is assumed. This default type accepts arguments as + # string (--foo=value) or booleans (just --foo). + # + # By default all options are optional, unless :required is given. + # + # source://thor//lib/thor/parser/option.rb#45 + def parse(key, value); end + end +end + +# source://thor//lib/thor/parser/option.rb#5 +Thor::Option::VALID_TYPES = T.let(T.unsafe(nil), Array) + +# source://thor//lib/thor/parser/options.rb#2 +class Thor::Options < ::Thor::Arguments + # Takes a hash of Thor::Option and a hash with defaults. + # + # If +stop_on_unknown+ is true, #parse will stop as soon as it encounters + # an unknown option or a regular argument. + # + # @return [Options] a new instance of Options + # + # source://thor//lib/thor/parser/options.rb#32 + def initialize(hash_options = T.unsafe(nil), defaults = T.unsafe(nil), stop_on_unknown = T.unsafe(nil), disable_required_check = T.unsafe(nil), relations = T.unsafe(nil)); end + + # source://thor//lib/thor/parser/options.rb#156 + def check_at_least_one!; end + + # source://thor//lib/thor/parser/options.rb#144 + def check_exclusive!; end + + # @raise [UnknownArgumentError] + # + # source://thor//lib/thor/parser/options.rb#168 + def check_unknown!; end + + # source://thor//lib/thor/parser/options.rb#89 + def parse(args); end + + # source://thor//lib/thor/parser/options.rb#65 + def peek; end + + # source://thor//lib/thor/parser/options.rb#61 + def remaining; end + + # source://thor//lib/thor/parser/options.rb#79 + def shift; end + + # source://thor//lib/thor/parser/options.rb#84 + def unshift(arg, is_value: T.unsafe(nil)); end + + protected + + # source://thor//lib/thor/parser/options.rb#189 + def assign_result!(option, result); end + + # Check if the current value in peek is a registered switch. + # + # Two booleans are returned. The first is true if the current value + # starts with a hyphen; the second is true if it is a registered switch. + # + # @return [Boolean] + # + # source://thor//lib/thor/parser/options.rb#203 + def current_is_switch?; end + + # @return [Boolean] + # + # source://thor//lib/thor/parser/options.rb#215 + def current_is_switch_formatted?; end + + # @return [Boolean] + # + # source://thor//lib/thor/parser/options.rb#225 + def current_is_value?; end + + # Option names changes to swith name or human name + # + # source://thor//lib/thor/parser/options.rb#179 + def names_to_switch_names(names = T.unsafe(nil)); end + + # Check if the given argument is actually a shortcut. + # + # source://thor//lib/thor/parser/options.rb#244 + def normalize_switch(arg); end + + # Parse boolean values which can be given as --foo=true or --foo for true values, or + # --foo=false, --no-foo or --skip-foo for false values. + # + # source://thor//lib/thor/parser/options.rb#256 + def parse_boolean(switch); end + + # Parse the value at the peek analyzing if it requires an input or not. + # + # source://thor//lib/thor/parser/options.rb#274 + def parse_peek(switch, option); end + + # @return [Boolean] + # + # source://thor//lib/thor/parser/options.rb#248 + def parsing_options?; end + + # @return [Boolean] + # + # source://thor//lib/thor/parser/options.rb#230 + def switch?(arg); end + + # source://thor//lib/thor/parser/options.rb#234 + def switch_option(arg); end + + class << self + # Receives a hash and makes it switches. + # + # source://thor//lib/thor/parser/options.rb#11 + def to_switches(options); end + end +end + +# source://thor//lib/thor/parser/options.rb#5 +Thor::Options::EQ_RE = T.let(T.unsafe(nil), Regexp) + +# source://thor//lib/thor/parser/options.rb#3 +Thor::Options::LONG_RE = T.let(T.unsafe(nil), Regexp) + +# source://thor//lib/thor/parser/options.rb#8 +Thor::Options::OPTS_END = T.let(T.unsafe(nil), String) + +# source://thor//lib/thor/parser/options.rb#7 +Thor::Options::SHORT_NUM = T.let(T.unsafe(nil), Regexp) + +# source://thor//lib/thor/parser/options.rb#4 +Thor::Options::SHORT_RE = T.let(T.unsafe(nil), Regexp) + +# Allow either -x -v or -xv style for single char args +# +# source://thor//lib/thor/parser/options.rb#6 +Thor::Options::SHORT_SQ_RE = T.let(T.unsafe(nil), Regexp) + +# source://thor//lib/thor/error.rb#95 +class Thor::RequiredArgumentMissingError < ::Thor::InvocationError; end + +# source://thor//lib/thor/util.rb#4 +module Thor::Sandbox; end + +# source://thor//lib/thor/shell.rb#23 +module Thor::Shell + # Add shell to initialize config values. + # + # ==== Configuration + # shell:: An instance of the shell to be used. + # + # ==== Examples + # + # class MyScript < Thor + # argument :first, :type => :numeric + # end + # + # MyScript.new [1.0], { :foo => :bar }, :shell => Thor::Shell::Basic.new + # + # source://thor//lib/thor/shell.rb#44 + def initialize(args = T.unsafe(nil), options = T.unsafe(nil), config = T.unsafe(nil)); end + + # source://thor//lib/thor/shell.rb#59 + def ask(*args, &block); end + + # source://thor//lib/thor/shell.rb#59 + def error(*args, &block); end + + # source://thor//lib/thor/shell.rb#59 + def file_collision(*args, &block); end + + # source://thor//lib/thor/shell.rb#59 + def no?(*args, &block); end + + # source://thor//lib/thor/shell.rb#59 + def print_in_columns(*args, &block); end + + # source://thor//lib/thor/shell.rb#59 + def print_table(*args, &block); end + + # source://thor//lib/thor/shell.rb#59 + def print_wrapped(*args, &block); end + + # source://thor//lib/thor/shell.rb#59 + def say(*args, &block); end + + # source://thor//lib/thor/shell.rb#59 + def say_error(*args, &block); end + + # source://thor//lib/thor/shell.rb#59 + def say_status(*args, &block); end + + # source://thor//lib/thor/shell.rb#59 + def set_color(*args, &block); end + + # Holds the shell for the given Thor instance. If no shell is given, + # it gets a default shell from Thor::Base.shell. + # + # source://thor//lib/thor/shell.rb#52 + def shell; end + + # Sets the attribute shell + # + # @param value the value to set the attribute shell to. + # + # source://thor//lib/thor/shell.rb#25 + def shell=(_arg0); end + + # source://thor//lib/thor/shell.rb#59 + def terminal_width(*args, &block); end + + # Yields the given block with padding. + # + # source://thor//lib/thor/shell.rb#66 + def with_padding; end + + # source://thor//lib/thor/shell.rb#59 + def yes?(*args, &block); end + + protected + + # Allow shell to be shared between invocations. + # + # source://thor//lib/thor/shell.rb#77 + def _shared_configuration; end +end + +# source://thor//lib/thor/shell/basic.rb#7 +class Thor::Shell::Basic + # Initialize base, mute and padding to nil. + # + # @return [Basic] a new instance of Basic + # + # source://thor//lib/thor/shell/basic.rb#13 + def initialize; end + + # Asks something to the user and receives a response. + # + # If a default value is specified it will be presented to the user + # and allows them to select that value with an empty response. This + # option is ignored when limited answers are supplied. + # + # If asked to limit the correct responses, you can pass in an + # array of acceptable answers. If one of those is not supplied, + # they will be shown a message stating that one of those answers + # must be given and re-asked the question. + # + # If asking for sensitive information, the :echo option can be set + # to false to mask user input from $stdin. + # + # If the required input is a path, then set the path option to + # true. This will enable tab completion for file paths relative + # to the current working directory on systems that support + # Readline. + # + # ==== Example + # ask("What is your name?") + # + # ask("What is the planet furthest from the sun?", :default => "Neptune") + # + # ask("What is your favorite Neopolitan flavor?", :limited_to => ["strawberry", "chocolate", "vanilla"]) + # + # ask("What is your password?", :echo => false) + # + # ask("Where should the file be saved?", :path => true) + # + # source://thor//lib/thor/shell/basic.rb#80 + def ask(statement, *args); end + + # Returns the value of attribute base. + # + # source://thor//lib/thor/shell/basic.rb#8 + def base; end + + # Sets the attribute base + # + # @param value the value to set the attribute base to. + # + # source://thor//lib/thor/shell/basic.rb#8 + def base=(_arg0); end + + # Called if something goes wrong during the execution. This is used by Thor + # internally and should not be used inside your scripts. If something went + # wrong, you can always raise an exception. If you raise a Thor::Error, it + # will be rescued and wrapped in the method below. + # + # source://thor//lib/thor/shell/basic.rb#251 + def error(statement); end + + # Deals with file collision and returns true if the file should be + # overwritten and false otherwise. If a block is given, it uses the block + # response as the content for the diff. + # + # ==== Parameters + # destination:: the destination file to solve conflicts + # block:: an optional block that returns the value to be used in diff and merge + # + # source://thor//lib/thor/shell/basic.rb#207 + def file_collision(destination); end + + # Sets the output padding while executing a block and resets it. + # + # source://thor//lib/thor/shell/basic.rb#43 + def indent(count = T.unsafe(nil)); end + + # Mute everything that's inside given block + # + # source://thor//lib/thor/shell/basic.rb#22 + def mute; end + + # Check if base is muted + # + # @return [Boolean] + # + # source://thor//lib/thor/shell/basic.rb#31 + def mute?; end + + # Asks the user a question and returns true if the user replies "n" or + # "no". + # + # @return [Boolean] + # + # source://thor//lib/thor/shell/basic.rb#156 + def no?(statement, color = T.unsafe(nil)); end + + # Returns the value of attribute padding. + # + # source://thor//lib/thor/shell/basic.rb#9 + def padding; end + + # Sets the output padding, not allowing less than zero values. + # + # source://thor//lib/thor/shell/basic.rb#37 + def padding=(value); end + + # Prints values in columns + # + # ==== Parameters + # Array[String, String, ...] + # + # source://thor//lib/thor/shell/basic.rb#165 + def print_in_columns(array); end + + # Prints a table. + # + # ==== Parameters + # Array[Array[String, String, ...]] + # + # ==== Options + # indent:: Indent the first column by indent value. + # colwidth:: Force the first column to colwidth spaces wide. + # borders:: Adds ascii borders. + # + # source://thor//lib/thor/shell/basic.rb#180 + def print_table(array, options = T.unsafe(nil)); end + + # Prints a long string, word-wrapping the text to the current width of the + # terminal display. Ideal for printing heredocs. + # + # ==== Parameters + # String + # + # ==== Options + # indent:: Indent each line of the printed paragraph by indent value. + # + # source://thor//lib/thor/shell/basic.rb#194 + def print_wrapped(message, options = T.unsafe(nil)); end + + # Say (print) something to the user. If the sentence ends with a whitespace + # or tab character, a new line is not appended (print + flush). Otherwise + # are passed straight to puts (behavior got from Highline). + # + # ==== Example + # say("I know you knew that.") + # + # source://thor//lib/thor/shell/basic.rb#98 + def say(message = T.unsafe(nil), color = T.unsafe(nil), force_new_line = T.unsafe(nil)); end + + # Say (print) an error to the user. If the sentence ends with a whitespace + # or tab character, a new line is not appended (print + flush). Otherwise + # are passed straight to puts (behavior got from Highline). + # + # ==== Example + # say_error("error: something went wrong") + # + # source://thor//lib/thor/shell/basic.rb#115 + def say_error(message = T.unsafe(nil), color = T.unsafe(nil), force_new_line = T.unsafe(nil)); end + + # Say a status with the given color and appends the message. Since this + # method is used frequently by actions, it allows nil or false to be given + # in log_status, avoiding the message from being shown. If a Symbol is + # given in log_status, it's used as the color. + # + # source://thor//lib/thor/shell/basic.rb#130 + def say_status(status, message, log_status = T.unsafe(nil)); end + + # Apply color to the given string with optional bold. Disabled in the + # Thor::Shell::Basic class. + # + # source://thor//lib/thor/shell/basic.rb#258 + def set_color(string, *_arg1); end + + # Asks the user a question and returns true if the user replies "y" or + # "yes". + # + # @return [Boolean] + # + # source://thor//lib/thor/shell/basic.rb#149 + def yes?(statement, color = T.unsafe(nil)); end + + protected + + # source://thor//lib/thor/shell/basic.rb#362 + def answer_match(possibilities, answer, case_insensitive); end + + # source://thor//lib/thor/shell/basic.rb#349 + def ask_filtered(statement, color, options); end + + # source://thor//lib/thor/shell/basic.rb#332 + def ask_simply(statement, color, options); end + + # @return [Boolean] + # + # source://thor//lib/thor/shell/basic.rb#269 + def can_display_colors?; end + + # source://thor//lib/thor/shell/basic.rb#296 + def file_collision_help(block_given); end + + # source://thor//lib/thor/shell/basic.rb#383 + def git_merge_tool; end + + # @return [Boolean] + # + # source://thor//lib/thor/shell/basic.rb#286 + def is?(value); end + + # source://thor//lib/thor/shell/basic.rb#273 + def lookup_color(color); end + + # source://thor//lib/thor/shell/basic.rb#370 + def merge(destination, content); end + + # source://thor//lib/thor/shell/basic.rb#379 + def merge_tool; end + + # source://thor//lib/thor/shell/basic.rb#264 + def prepare_message(message, *color); end + + # @return [Boolean] + # + # source://thor//lib/thor/shell/basic.rb#324 + def quiet?; end + + # source://thor//lib/thor/shell/basic.rb#313 + def show_diff(destination, content); end + + # source://thor//lib/thor/shell/basic.rb#282 + def stderr; end + + # source://thor//lib/thor/shell/basic.rb#278 + def stdout; end + + # @return [Boolean] + # + # source://thor//lib/thor/shell/basic.rb#328 + def unix?; end +end + +# Inherit from Thor::Shell::Basic and add set_color behavior. Check +# Thor::Shell::Basic to see all available methods. +# +# source://thor//lib/thor/shell/color.rb#9 +class Thor::Shell::Color < ::Thor::Shell::Basic + include ::LCSDiff + + # Set color by using a string or one of the defined constants. If a third + # option is set to true, it also adds bold to the string. This is based + # on Highline implementation and it automatically appends CLEAR to the end + # of the returned String. + # + # Pass foreground, background and bold options to this method as + # symbols. + # + # Example: + # + # set_color "Hi!", :red, :on_white, :bold + # + # The available colors are: + # + # :bold + # :black + # :red + # :green + # :yellow + # :blue + # :magenta + # :cyan + # :white + # :on_black + # :on_red + # :on_green + # :on_yellow + # :on_blue + # :on_magenta + # :on_cyan + # :on_white + # + # source://thor//lib/thor/shell/color.rb#82 + def set_color(string, *colors); end + + protected + + # @return [Boolean] + # + # source://thor//lib/thor/shell/color.rb#110 + def are_colors_disabled?; end + + # @return [Boolean] + # + # source://thor//lib/thor/shell/color.rb#106 + def are_colors_supported?; end + + # @return [Boolean] + # + # source://thor//lib/thor/shell/color.rb#102 + def can_display_colors?; end +end + +# Set the terminal's foreground ANSI color to black. +# +# source://thor//lib/thor/shell/color.rb#18 +Thor::Shell::Color::BLACK = T.let(T.unsafe(nil), String) + +# Set the terminal's foreground ANSI color to blue. +# +# source://thor//lib/thor/shell/color.rb#26 +Thor::Shell::Color::BLUE = T.let(T.unsafe(nil), String) + +# The start of an ANSI bold sequence. +# +# source://thor//lib/thor/shell/color.rb#15 +Thor::Shell::Color::BOLD = T.let(T.unsafe(nil), String) + +# Embed in a String to clear all previous ANSI sequences. +# +# source://thor//lib/thor/shell/color.rb#13 +Thor::Shell::Color::CLEAR = T.let(T.unsafe(nil), String) + +# Set the terminal's foreground ANSI color to cyan. +# +# source://thor//lib/thor/shell/color.rb#30 +Thor::Shell::Color::CYAN = T.let(T.unsafe(nil), String) + +# Set the terminal's foreground ANSI color to green. +# +# source://thor//lib/thor/shell/color.rb#22 +Thor::Shell::Color::GREEN = T.let(T.unsafe(nil), String) + +# Set the terminal's foreground ANSI color to magenta. +# +# source://thor//lib/thor/shell/color.rb#28 +Thor::Shell::Color::MAGENTA = T.let(T.unsafe(nil), String) + +# Set the terminal's background ANSI color to black. +# +# source://thor//lib/thor/shell/color.rb#35 +Thor::Shell::Color::ON_BLACK = T.let(T.unsafe(nil), String) + +# Set the terminal's background ANSI color to blue. +# +# source://thor//lib/thor/shell/color.rb#43 +Thor::Shell::Color::ON_BLUE = T.let(T.unsafe(nil), String) + +# Set the terminal's background ANSI color to cyan. +# +# source://thor//lib/thor/shell/color.rb#47 +Thor::Shell::Color::ON_CYAN = T.let(T.unsafe(nil), String) + +# Set the terminal's background ANSI color to green. +# +# source://thor//lib/thor/shell/color.rb#39 +Thor::Shell::Color::ON_GREEN = T.let(T.unsafe(nil), String) + +# Set the terminal's background ANSI color to magenta. +# +# source://thor//lib/thor/shell/color.rb#45 +Thor::Shell::Color::ON_MAGENTA = T.let(T.unsafe(nil), String) + +# Set the terminal's background ANSI color to red. +# +# source://thor//lib/thor/shell/color.rb#37 +Thor::Shell::Color::ON_RED = T.let(T.unsafe(nil), String) + +# Set the terminal's background ANSI color to white. +# +# source://thor//lib/thor/shell/color.rb#49 +Thor::Shell::Color::ON_WHITE = T.let(T.unsafe(nil), String) + +# Set the terminal's background ANSI color to yellow. +# +# source://thor//lib/thor/shell/color.rb#41 +Thor::Shell::Color::ON_YELLOW = T.let(T.unsafe(nil), String) + +# Set the terminal's foreground ANSI color to red. +# +# source://thor//lib/thor/shell/color.rb#20 +Thor::Shell::Color::RED = T.let(T.unsafe(nil), String) + +# Set the terminal's foreground ANSI color to white. +# +# source://thor//lib/thor/shell/color.rb#32 +Thor::Shell::Color::WHITE = T.let(T.unsafe(nil), String) + +# Set the terminal's foreground ANSI color to yellow. +# +# source://thor//lib/thor/shell/color.rb#24 +Thor::Shell::Color::YELLOW = T.let(T.unsafe(nil), String) + +# source://thor//lib/thor/shell/column_printer.rb#5 +class Thor::Shell::ColumnPrinter + # @return [ColumnPrinter] a new instance of ColumnPrinter + # + # source://thor//lib/thor/shell/column_printer.rb#8 + def initialize(stdout, options = T.unsafe(nil)); end + + # Returns the value of attribute options. + # + # source://thor//lib/thor/shell/column_printer.rb#6 + def options; end + + # source://thor//lib/thor/shell/column_printer.rb#14 + def print(array); end + + # Returns the value of attribute stdout. + # + # source://thor//lib/thor/shell/column_printer.rb#6 + def stdout; end +end + +# Inherit from Thor::Shell::Basic and add set_color behavior. Check +# Thor::Shell::Basic to see all available methods. +# +# source://thor//lib/thor/shell/html.rb#9 +class Thor::Shell::HTML < ::Thor::Shell::Basic + include ::LCSDiff + + # Ask something to the user and receives a response. + # + # ==== Example + # ask("What is your name?") + # + # TODO: Implement #ask for Thor::Shell::HTML + # + # @raise [NotImplementedError] + # + # source://thor//lib/thor/shell/html.rb#73 + def ask(statement, color = T.unsafe(nil)); end + + # Set color by using a string or one of the defined constants. If a third + # option is set to true, it also adds bold to the string. This is based + # on Highline implementation and it automatically appends CLEAR to the end + # of the returned String. + # + # source://thor//lib/thor/shell/html.rb#54 + def set_color(string, *colors); end + + protected + + # @return [Boolean] + # + # source://thor//lib/thor/shell/html.rb#79 + def can_display_colors?; end +end + +# Set the terminal's foreground HTML color to black. +# +# source://thor//lib/thor/shell/html.rb#16 +Thor::Shell::HTML::BLACK = T.let(T.unsafe(nil), String) + +# Set the terminal's foreground HTML color to blue. +# +# source://thor//lib/thor/shell/html.rb#24 +Thor::Shell::HTML::BLUE = T.let(T.unsafe(nil), String) + +# The start of an HTML bold sequence. +# +# source://thor//lib/thor/shell/html.rb#13 +Thor::Shell::HTML::BOLD = T.let(T.unsafe(nil), String) + +# Set the terminal's foreground HTML color to cyan. +# +# source://thor//lib/thor/shell/html.rb#28 +Thor::Shell::HTML::CYAN = T.let(T.unsafe(nil), String) + +# Set the terminal's foreground HTML color to green. +# +# source://thor//lib/thor/shell/html.rb#20 +Thor::Shell::HTML::GREEN = T.let(T.unsafe(nil), String) + +# Set the terminal's foreground HTML color to magenta. +# +# source://thor//lib/thor/shell/html.rb#26 +Thor::Shell::HTML::MAGENTA = T.let(T.unsafe(nil), String) + +# Set the terminal's background HTML color to black. +# +# source://thor//lib/thor/shell/html.rb#33 +Thor::Shell::HTML::ON_BLACK = T.let(T.unsafe(nil), String) + +# Set the terminal's background HTML color to blue. +# +# source://thor//lib/thor/shell/html.rb#41 +Thor::Shell::HTML::ON_BLUE = T.let(T.unsafe(nil), String) + +# Set the terminal's background HTML color to cyan. +# +# source://thor//lib/thor/shell/html.rb#45 +Thor::Shell::HTML::ON_CYAN = T.let(T.unsafe(nil), String) + +# Set the terminal's background HTML color to green. +# +# source://thor//lib/thor/shell/html.rb#37 +Thor::Shell::HTML::ON_GREEN = T.let(T.unsafe(nil), String) + +# Set the terminal's background HTML color to magenta. +# +# source://thor//lib/thor/shell/html.rb#43 +Thor::Shell::HTML::ON_MAGENTA = T.let(T.unsafe(nil), String) + +# Set the terminal's background HTML color to red. +# +# source://thor//lib/thor/shell/html.rb#35 +Thor::Shell::HTML::ON_RED = T.let(T.unsafe(nil), String) + +# Set the terminal's background HTML color to white. +# +# source://thor//lib/thor/shell/html.rb#47 +Thor::Shell::HTML::ON_WHITE = T.let(T.unsafe(nil), String) + +# Set the terminal's background HTML color to yellow. +# +# source://thor//lib/thor/shell/html.rb#39 +Thor::Shell::HTML::ON_YELLOW = T.let(T.unsafe(nil), String) + +# Set the terminal's foreground HTML color to red. +# +# source://thor//lib/thor/shell/html.rb#18 +Thor::Shell::HTML::RED = T.let(T.unsafe(nil), String) + +# Set the terminal's foreground HTML color to white. +# +# source://thor//lib/thor/shell/html.rb#30 +Thor::Shell::HTML::WHITE = T.let(T.unsafe(nil), String) + +# Set the terminal's foreground HTML color to yellow. +# +# source://thor//lib/thor/shell/html.rb#22 +Thor::Shell::HTML::YELLOW = T.let(T.unsafe(nil), String) + +# source://thor//lib/thor/shell.rb#24 +Thor::Shell::SHELL_DELEGATED_METHODS = T.let(T.unsafe(nil), Array) + +# source://thor//lib/thor/shell/table_printer.rb#6 +class Thor::Shell::TablePrinter < ::Thor::Shell::ColumnPrinter + # @return [TablePrinter] a new instance of TablePrinter + # + # source://thor//lib/thor/shell/table_printer.rb#9 + def initialize(stdout, options = T.unsafe(nil)); end + + # source://thor//lib/thor/shell/table_printer.rb#18 + def print(array); end + + private + + # source://thor//lib/thor/shell/table_printer.rb#72 + def format_cell(column, row_size, index); end + + # source://thor//lib/thor/shell/table_printer.rb#113 + def indentation; end + + # source://thor//lib/thor/shell/table_printer.rb#47 + def prepare(array); end + + # source://thor//lib/thor/shell/table_printer.rb#96 + def print_border_separator; end + + # source://thor//lib/thor/shell/table_printer.rb#103 + def truncate(string); end +end + +# source://thor//lib/thor/shell/table_printer.rb#7 +Thor::Shell::TablePrinter::BORDER_SEPARATOR = T.let(T.unsafe(nil), Symbol) + +# source://thor//lib/thor/shell/terminal.rb#3 +module Thor::Shell::Terminal + class << self + # source://thor//lib/thor/shell/terminal.rb#9 + def terminal_width; end + + # @return [Boolean] + # + # source://thor//lib/thor/shell/terminal.rb#20 + def unix?; end + + private + + # Calculate the dynamic width of the terminal + # + # source://thor//lib/thor/shell/terminal.rb#27 + def dynamic_width; end + + # source://thor//lib/thor/shell/terminal.rb#31 + def dynamic_width_stty; end + + # source://thor//lib/thor/shell/terminal.rb#35 + def dynamic_width_tput; end + end +end + +# source://thor//lib/thor/shell/terminal.rb#4 +Thor::Shell::Terminal::DEFAULT_TERMINAL_WIDTH = T.let(T.unsafe(nil), Integer) + +# source://thor//lib/thor/shell/wrapped_printer.rb#6 +class Thor::Shell::WrappedPrinter < ::Thor::Shell::ColumnPrinter + # source://thor//lib/thor/shell/wrapped_printer.rb#7 + def print(message); end +end + +# source://thor//lib/thor/base.rb#23 +Thor::TEMPLATE_EXTNAME = T.let(T.unsafe(nil), String) + +# Thor methods that should not be overwritten by the user. +# +# source://thor//lib/thor/base.rb#20 +Thor::THOR_RESERVED_WORDS = T.let(T.unsafe(nil), Array) + +# source://thor//lib/thor/command.rb#126 +Thor::Task = Thor::Command + +# Raised when a command was not found. +# +# source://thor//lib/thor/error.rb#24 +class Thor::UndefinedCommandError < ::Thor::Error + include ::Thor::Correctable + + # @return [UndefinedCommandError] a new instance of UndefinedCommandError + # + # source://thor//lib/thor/error.rb#43 + def initialize(command, all_commands, namespace); end + + # Returns the value of attribute all_commands. + # + # source://thor//lib/thor/error.rb#41 + def all_commands; end + + # Returns the value of attribute command. + # + # source://thor//lib/thor/error.rb#41 + def command; end +end + +# source://thor//lib/thor/error.rb#25 +class Thor::UndefinedCommandError::SpellChecker + # @return [SpellChecker] a new instance of SpellChecker + # + # source://thor//lib/thor/error.rb#28 + def initialize(error); end + + # source://thor//lib/thor/error.rb#32 + def corrections; end + + # Returns the value of attribute error. + # + # source://thor//lib/thor/error.rb#26 + def error; end + + # source://thor//lib/thor/error.rb#36 + def spell_checker; end +end + +# source://thor//lib/thor/error.rb#55 +Thor::UndefinedTaskError = Thor::UndefinedCommandError + +# source://thor//lib/thor/error.rb#65 +class Thor::UnknownArgumentError < ::Thor::Error + include ::Thor::Correctable + + # @return [UnknownArgumentError] a new instance of UnknownArgumentError + # + # source://thor//lib/thor/error.rb#85 + def initialize(switches, unknown); end + + # Returns the value of attribute switches. + # + # source://thor//lib/thor/error.rb#83 + def switches; end + + # Returns the value of attribute unknown. + # + # source://thor//lib/thor/error.rb#83 + def unknown; end +end + +# source://thor//lib/thor/error.rb#66 +class Thor::UnknownArgumentError::SpellChecker + # @return [SpellChecker] a new instance of SpellChecker + # + # source://thor//lib/thor/error.rb#69 + def initialize(error); end + + # source://thor//lib/thor/error.rb#73 + def corrections; end + + # Returns the value of attribute error. + # + # source://thor//lib/thor/error.rb#67 + def error; end + + # source://thor//lib/thor/error.rb#78 + def spell_checker; end +end + +# This module holds several utilities: +# +# 1) Methods to convert thor namespaces to constants and vice-versa. +# +# Thor::Util.namespace_from_thor_class(Foo::Bar::Baz) #=> "foo:bar:baz" +# +# 2) Loading thor files and sandboxing: +# +# Thor::Util.load_thorfile("~/.thor/foo") +# +# source://thor//lib/thor/util.rb#17 +module Thor::Util + class << self + # Receives a string and convert it to camel case. camel_case returns CamelCase. + # + # ==== Parameters + # String + # + # ==== Returns + # String + # + # source://thor//lib/thor/util.rb#104 + def camel_case(str); end + + # Returns a string that has had any glob characters escaped. + # The glob characters are `* ? { } [ ]`. + # + # ==== Examples + # + # Thor::Util.escape_globs('[apps]') # => '\[apps\]' + # + # ==== Parameters + # String + # + # ==== Returns + # String + # + # source://thor//lib/thor/util.rb#264 + def escape_globs(path); end + + # Returns a string that has had any HTML characters escaped. + # + # ==== Examples + # + # Thor::Util.escape_html('
') # => "<div>" + # + # ==== Parameters + # String + # + # ==== Returns + # String + # + # source://thor//lib/thor/util.rb#280 + def escape_html(string); end + + # Receives a namespace and search for it in the Thor::Base subclasses. + # + # ==== Parameters + # namespace:: The namespace to search for. + # + # source://thor//lib/thor/util.rb#24 + def find_by_namespace(namespace); end + + # Receives a namespace and tries to retrieve a Thor or Thor::Group class + # from it. It first searches for a class using the all the given namespace, + # if it's not found, removes the highest entry and searches for the class + # again. If found, returns the highest entry as the class name. + # + # ==== Examples + # + # class Foo::Bar < Thor + # def baz + # end + # end + # + # class Baz::Foo < Thor::Group + # end + # + # Thor::Util.namespace_to_thor_class("foo:bar") #=> Foo::Bar, nil # will invoke default command + # Thor::Util.namespace_to_thor_class("baz:foo") #=> Baz::Foo, nil + # Thor::Util.namespace_to_thor_class("foo:bar:baz") #=> Foo::Bar, "baz" + # + # ==== Parameters + # namespace + # + # source://thor//lib/thor/util.rb#131 + def find_class_and_command_by_namespace(namespace, fallback = T.unsafe(nil)); end + + # Receives a namespace and tries to retrieve a Thor or Thor::Group class + # from it. It first searches for a class using the all the given namespace, + # if it's not found, removes the highest entry and searches for the class + # again. If found, returns the highest entry as the class name. + # + # ==== Examples + # + # class Foo::Bar < Thor + # def baz + # end + # end + # + # class Baz::Foo < Thor::Group + # end + # + # Thor::Util.namespace_to_thor_class("foo:bar") #=> Foo::Bar, nil # will invoke default command + # Thor::Util.namespace_to_thor_class("baz:foo") #=> Baz::Foo, nil + # Thor::Util.namespace_to_thor_class("foo:bar:baz") #=> Foo::Bar, "baz" + # + # ==== Parameters + # namespace + # + # source://thor//lib/thor/util.rb#131 + def find_class_and_task_by_namespace(namespace, fallback = T.unsafe(nil)); end + + # Where to look for Thor files. + # + # source://thor//lib/thor/util.rb#213 + def globs_for(path); end + + # Receives a path and load the thor file in the path. The file is evaluated + # inside the sandbox to avoid namespacing conflicts. + # + # source://thor//lib/thor/util.rb#153 + def load_thorfile(path, content = T.unsafe(nil), debug = T.unsafe(nil)); end + + # Receives a constant and converts it to a Thor namespace. Since Thor + # commands can be added to a sandbox, this method is also responsible for + # removing the sandbox namespace. + # + # This method should not be used in general because it's used to deal with + # older versions of Thor. On current versions, if you need to get the + # namespace from a class, just call namespace on it. + # + # ==== Parameters + # constant:: The constant to be converted to the thor path. + # + # ==== Returns + # String:: If we receive Foo::Bar::Baz it returns "foo:bar:baz" + # + # source://thor//lib/thor/util.rb#43 + def namespace_from_thor_class(constant); end + + # Given the contents, evaluate it inside the sandbox and returns the + # namespaces defined in the sandbox. + # + # ==== Parameters + # contents + # + # ==== Returns + # Array[Object] + # + # source://thor//lib/thor/util.rb#58 + def namespaces_in_content(contents, file = T.unsafe(nil)); end + + # Return the path to the ruby interpreter taking into account multiple + # installations and windows extensions. + # + # source://thor//lib/thor/util.rb#221 + def ruby_command; end + + # Receives a string and convert it to snake case. SnakeCase returns snake_case. + # + # ==== Parameters + # String + # + # ==== Returns + # String + # + # source://thor//lib/thor/util.rb#90 + def snake_case(str); end + + # Returns the thor classes declared inside the given class. + # + # source://thor//lib/thor/util.rb#74 + def thor_classes_in(klass); end + + # Returns the root where thor files are located, depending on the OS. + # + # source://thor//lib/thor/util.rb#192 + def thor_root; end + + # Returns the files in the thor root. On Windows thor_root will be something + # like this: + # + # C:\Documents and Settings\james\.thor + # + # If we don't #gsub the \ character, Dir.glob will fail. + # + # source://thor//lib/thor/util.rb#203 + def thor_root_glob; end + + # source://thor//lib/thor/util.rb#168 + def user_home; end + end +end diff --git a/examples/sinatra-pet-shelter/sorbet/rbi/gems/tilt@2.4.0.rbi b/examples/sinatra-pet-shelter/sorbet/rbi/gems/tilt@2.4.0.rbi new file mode 100644 index 0000000..443e92a --- /dev/null +++ b/examples/sinatra-pet-shelter/sorbet/rbi/gems/tilt@2.4.0.rbi @@ -0,0 +1,880 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `tilt` gem. +# Please instead update this file by running `bin/tapioca gem tilt`. + + +# Namespace for Tilt. This module is not intended to be included anywhere. +# +# source://tilt//lib/tilt/template.rb#2 +module Tilt + class << self + # @see Tilt::Mapping#[] + # + # source://tilt//lib/tilt.rb#71 + def [](file); end + + # @return [Tilt::Mapping] the main mapping object + # + # source://tilt//lib/tilt.rb#87 + def default_mapping; end + + # Replace the default mapping with a finalized version of the default + # mapping. This can be done to improve performance after the template + # libraries you desire to use have already been loaded. Once this is + # is called, all attempts to modify the default mapping will fail. + # This also freezes Tilt itself. + # + # source://tilt//lib/tilt.rb#20 + def finalize!; end + + # @private + # + # source://tilt//lib/tilt.rb#41 + def lazy_map; end + + # @see Tilt::Mapping#new + # + # source://tilt//lib/tilt.rb#66 + def new(file, line = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Alias register as prefer for Tilt 1.x compatibility. + # + # @see Tilt::Mapping#register + # + # source://tilt//lib/tilt.rb#46 + def prefer(template_class, *extensions); end + + # @see Tilt::Mapping#register + # + # source://tilt//lib/tilt.rb#46 + def register(template_class, *extensions); end + + # @see Tilt::Mapping#register_lazy + # + # source://tilt//lib/tilt.rb#51 + def register_lazy(class_name, file, *extensions); end + + # @see Tilt::Mapping#register_pipeline + # + # source://tilt//lib/tilt.rb#56 + def register_pipeline(ext, options = T.unsafe(nil)); end + + # @return [Boolean] + # @see Tilt::Mapping#registered? + # + # source://tilt//lib/tilt.rb#61 + def registered?(ext); end + + # @see Tilt::Mapping#template_for + # + # source://tilt//lib/tilt.rb#76 + def template_for(file); end + + # @see Tilt::Mapping#templates_for + # + # source://tilt//lib/tilt.rb#81 + def templates_for(file); end + end +end + +# Private internal base class for both Mapping and FinalizedMapping, for the shared methods. +# +# source://tilt//lib/tilt/mapping.rb#6 +class Tilt::BaseMapping + # Looks up a template class based on file name and/or extension. + # + # @example + # mapping['views/hello.erb'] # => Tilt::ERBTemplate + # mapping['hello.erb'] # => Tilt::ERBTemplate + # mapping['erb'] # => Tilt::ERBTemplate + # @return [template class] + # + # source://tilt//lib/tilt/mapping.rb#32 + def [](file); end + + # Instantiates a new template class based on the file. + # + # @example + # mapping.new('index.mt') # => instance of MyEngine::Template + # @raise [RuntimeError] if there is no template class registered for the + # file name. + # @see Tilt::Template.new + # + # source://tilt//lib/tilt/mapping.rb#16 + def new(file, line = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Looks up a template class based on file name and/or extension. + # + # @example + # mapping['views/hello.erb'] # => Tilt::ERBTemplate + # mapping['hello.erb'] # => Tilt::ERBTemplate + # mapping['erb'] # => Tilt::ERBTemplate + # @return [template class] + # + # source://tilt//lib/tilt/mapping.rb#32 + def template_for(file); end + + # Looks up a list of template classes based on file name. If the file name + # has multiple extensions, it will return all template classes matching the + # extensions from the end. + # + # @example + # mapping.templates_for('views/index.haml.erb') + # # => [Tilt::ERBTemplate, Tilt::HamlTemplate] + # @return [Array