Merge pull request #16677 from Homebrew/dependabot/bundler/Library/Homebrew/rbi-0.1.9

This commit is contained in:
Patrick Linnane 2024-02-15 22:54:18 -08:00 committed by GitHub
commit 4b197b9648
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6041 additions and 6505 deletions

View File

@ -45,15 +45,15 @@ GEM
elftools (>= 1.2)
plist (3.7.1)
prettier_print (1.2.1)
prism (0.21.0)
prism (0.24.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.4)
racc (1.7.3)
rainbow (3.1.1)
rbi (0.1.8)
prism (>= 0.18.0, < 0.22)
rbi (0.1.9)
prism (>= 0.18.0, < 0.25)
sorbet-runtime (>= 0.5.9204)
rdiscount (2.2.7.3)
regexp_parser (2.9.0)

View File

@ -1157,6 +1157,10 @@ class RBI::Node
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#162
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
@ -1192,6 +1196,10 @@ class RBI::NodeWithComments < ::RBI::Node
# source://rbi//lib/rbi/printer.rb#188
sig { override.returns(T::Boolean) }
def oneline?; 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#601
@ -1736,6 +1744,78 @@ class RBI::Rewriters::Deannotate < ::RBI::Visitor
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#6
class RBI::Rewriters::GroupNodes < ::RBI::Visitor
# source://rbi//lib/rbi/rewriters/group_nodes.rb#10
@ -1820,7 +1900,7 @@ class RBI::Rewriters::Merge::Conflict < ::T::Struct
def to_s; end
class << self
# source://sorbet-runtime/0.5.11247/lib/types/struct.rb#13
# source://sorbet-runtime/0.5.11258/lib/types/struct.rb#13
def inherited(s); end
end
end
@ -2037,7 +2117,7 @@ class RBI::Rewriters::RemoveKnownDefinitions::Operation < ::T::Struct
def to_s; end
class << self
# source://sorbet-runtime/0.5.11247/lib/types/struct.rb#13
# source://sorbet-runtime/0.5.11258/lib/types/struct.rb#13
def inherited(s); end
end
end
@ -2738,6 +2818,10 @@ class RBI::Tree < ::RBI::NodeWithComments
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#38
sig { void }
def group_nodes!; end

View File

@ -71,10 +71,10 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/patchelf-1.4.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/plist-3.7.1/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/prettier_print-1.2.1/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/prism-0.21.0")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/prism-0.21.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/prism-0.24.0")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/prism-0.24.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/pry-0.14.2/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rbi-0.1.8/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rbi-0.1.9/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/rdiscount-2.2.7.3")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rdiscount-2.2.7.3/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rexml-3.2.6/lib")