diff --git a/Gemfile b/Gemfile index 07b11c9ac..db9be3a40 100644 --- a/Gemfile +++ b/Gemfile @@ -23,7 +23,4 @@ group :development do gem "tapioca", "~> 0.11", require: false, platforms: NON_WINDOWS_PLATFORMS gem "rdoc", require: false gem "psych", "~> 5.1", require: false - - # The Rails documentation link only activates when railties is detected. - gem "railties", "~> 7.0", require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 8760ef1dc..17b537490 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,56 +1,29 @@ PATH remote: . specs: - ruby-lsp (0.8.1) + ruby-lsp (0.9.1) language_server-protocol (~> 3.17.0) sorbet-runtime syntax_tree (>= 6.1.1, < 7) - yarp (>= 0.8, < 0.10) - + yarp (>= 0.9, < 0.10) +d GEM remote: https://rubygems.org/ specs: - actionpack (7.0.6) - actionview (= 7.0.6) - activesupport (= 7.0.6) - rack (~> 2.0, >= 2.2.4) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actionview (7.0.6) - activesupport (= 7.0.6) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activesupport (7.0.6) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) ansi (1.5.0) ast (2.4.2) base64 (0.1.1) builder (3.2.4) - concurrent-ruby (1.2.2) - crass (1.0.6) debug (1.8.0) irb (>= 1.5.0) reline (>= 0.3.1) diff-lcs (1.5.0) erubi (1.12.0) - i18n (1.14.1) - concurrent-ruby (~> 1.0) io-console (0.6.0) irb (1.7.0) reline (>= 0.3.0) json (2.6.3) language_server-protocol (3.17.0.3) - loofah (2.21.3) - crass (~> 1.0.2) - nokogiri (>= 1.12.0) - method_source (1.0.0) - mini_portile2 (2.8.2) minitest (5.19.0) minitest-reporters (1.6.1) ansi @@ -60,9 +33,6 @@ GEM mocha (2.1.0) ruby2_keywords (>= 0.0.5) netrc (0.11.0) - nokogiri (1.15.2) - mini_portile2 (~> 2.8.2) - racc (~> 1.4) parallel (1.23.0) parser (3.2.2.3) ast (~> 2.4.1) @@ -71,23 +41,6 @@ GEM psych (5.1.0) stringio racc (1.7.1) - rack (2.2.7) - rack-test (2.1.0) - rack (>= 1.3) - rails-dom-testing (2.1.1) - activesupport (>= 5.0.0) - minitest - nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) - loofah (~> 2.21) - nokogiri (~> 1.14) - railties (7.0.6) - actionpack (= 7.0.6) - activesupport (= 7.0.6) - method_source - rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) rbi (0.0.17) @@ -101,7 +54,7 @@ GEM reline (0.3.5) io-console (~> 0.5) rexml (3.2.6) - rubocop (1.56.0) + rubocop (1.56.1) base64 (~> 0.1.1) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -125,22 +78,22 @@ GEM rubocop (>= 0.90.0) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - sorbet (0.5.10978) - sorbet-static (= 0.5.10978) - sorbet-runtime (0.5.10978) - sorbet-static (0.5.10978-universal-darwin-14) - sorbet-static (0.5.10978-universal-darwin-15) - sorbet-static (0.5.10978-universal-darwin-16) - sorbet-static (0.5.10978-universal-darwin-17) - sorbet-static (0.5.10978-universal-darwin-18) - sorbet-static (0.5.10978-universal-darwin-19) - sorbet-static (0.5.10978-universal-darwin-20) - sorbet-static (0.5.10978-universal-darwin-21) - sorbet-static (0.5.10978-universal-darwin-22) - sorbet-static (0.5.10978-x86_64-linux) - sorbet-static-and-runtime (0.5.10978) - sorbet (= 0.5.10978) - sorbet-runtime (= 0.5.10978) + sorbet (0.5.10987) + sorbet-static (= 0.5.10987) + sorbet-runtime (0.5.10987) + sorbet-static (0.5.10987-universal-darwin-14) + sorbet-static (0.5.10987-universal-darwin-15) + sorbet-static (0.5.10987-universal-darwin-16) + sorbet-static (0.5.10987-universal-darwin-17) + sorbet-static (0.5.10987-universal-darwin-18) + sorbet-static (0.5.10987-universal-darwin-19) + sorbet-static (0.5.10987-universal-darwin-20) + sorbet-static (0.5.10987-universal-darwin-21) + sorbet-static (0.5.10987-universal-darwin-22) + sorbet-static (0.5.10987-x86_64-linux) + sorbet-static-and-runtime (0.5.10987) + sorbet (= 0.5.10987) + sorbet-runtime (= 0.5.10987) spoom (1.2.2) erubi (>= 1.10.0) sorbet (>= 0.5.10187) @@ -160,8 +113,6 @@ GEM thor (>= 1.2.0) yard-sorbet thor (1.2.2) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) unicode-display_width (2.4.2) unparser (0.6.8) diff-lcs (~> 1.3) @@ -171,7 +122,6 @@ GEM sorbet-runtime (>= 0.5) yard (>= 0.9) yarp (0.9.0) - zeitwerk (2.6.11) PLATFORMS arm64-darwin @@ -187,7 +137,6 @@ DEPENDENCIES minitest-reporters (~> 1.6) mocha (~> 2.1) psych (~> 5.1) - railties (~> 7.0) rake (~> 13.0) rdoc rubocop (~> 1.56) diff --git a/VERSION b/VERSION index 6f4eebdf6..f374f6662 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.1 +0.9.1 diff --git a/bin/benchmark b/bin/benchmark index 9ebda309a..736cb531d 100755 --- a/bin/benchmark +++ b/bin/benchmark @@ -24,9 +24,6 @@ require "benchmark" # Run signature blocks ahead of time T::Utils.run_all_sig_blocks -# Fetch Rails documents ahead of time -RubyLsp::Requests::Support::RailsDocumentClient.send(:search_index) - # Build gem file paths ahead of time RubyLsp::Requests::DocumentLink.gem_paths diff --git a/lib/core_ext/uri.rb b/lib/core_ext/uri.rb index 319199b1e..2f3d02386 100644 --- a/lib/core_ext/uri.rb +++ b/lib/core_ext/uri.rb @@ -6,8 +6,8 @@ class Generic class << self extend T::Sig - sig { params(path: String, scheme: String).returns(URI::Generic) } - def from_path(path:, scheme: "file") + sig { params(path: String, fragment: T.nilable(String), scheme: String).returns(URI::Generic) } + def from_path(path:, fragment: nil, scheme: "file") # On Windows, if the path begins with the disk name, we need to add a leading slash to make it a valid URI escaped_path = if /^[A-Z]:/i.match?(path) DEFAULT_PARSER.escape("/#{path}") @@ -15,7 +15,7 @@ def from_path(path:, scheme: "file") DEFAULT_PARSER.escape(path) end - build(scheme: scheme, path: escaped_path) + build(scheme: scheme, path: escaped_path, fragment: fragment) end end @@ -26,7 +26,7 @@ def to_standardized_path parsed_path = path return unless parsed_path - unescaped_path = CGI.unescape(parsed_path) + unescaped_path = DEFAULT_PARSER.unescape(parsed_path) # On Windows, when we're getting the file system path back from the URI, we need to remove the leading forward # slash diff --git a/lib/ruby_indexer/lib/ruby_indexer/configuration.rb b/lib/ruby_indexer/lib/ruby_indexer/configuration.rb index 866dc0e5e..7e102e3ca 100644 --- a/lib/ruby_indexer/lib/ruby_indexer/configuration.rb +++ b/lib/ruby_indexer/lib/ruby_indexer/configuration.rb @@ -111,17 +111,17 @@ def files_to_index end # Add the locked gems to the list of files to be indexed - locked_gems&.each do |spec| - next if excluded_gems.include?(spec.name) + locked_gems&.each do |lazy_spec| + next if excluded_gems.include?(lazy_spec.name) - full_gem_path = Gem::Specification.find_by_name(spec.name).full_gem_path + spec = Gem::Specification.find_by_name(lazy_spec.name) # When working on a gem, it will be included in the locked_gems list. Since these are the project's own files, # we have already included and handled exclude patterns for it and should not re-include or it'll lead to # duplicates or accidentally ignoring exclude patterns - next if full_gem_path == Dir.pwd + next if spec.full_gem_path == Dir.pwd - files_to_index.concat(Dir.glob("#{full_gem_path}/**/*.rb")) + files_to_index.concat(Dir.glob("#{spec.full_gem_path}/{#{spec.require_paths.join(",")}}/**/*.rb")) rescue Gem::MissingSpecError # If a gem is scoped only to some specific platform, then its dependencies may not be installed either, but they # are still listed in locked_gems. We can't index them because they are not installed for the platform, so we diff --git a/lib/ruby_indexer/lib/ruby_indexer/index.rb b/lib/ruby_indexer/lib/ruby_indexer/index.rb index e4cc3edf4..a61fecff3 100644 --- a/lib/ruby_indexer/lib/ruby_indexer/index.rb +++ b/lib/ruby_indexer/lib/ruby_indexer/index.rb @@ -95,6 +95,8 @@ def index_single(path, source = nil) content = source || File.read(path) visitor = IndexVisitor.new(self, YARP.parse(content), path) visitor.run + rescue Errno::EISDIR + # If `path` is a directory, just ignore it and continue indexing end class Entry @@ -120,6 +122,11 @@ def initialize(name, file_path, location, comments) @comments = comments end + sig { returns(String) } + def file_name + File.basename(@file_path) + end + class Namespace < Entry sig { returns(String) } def short_name diff --git a/lib/ruby_indexer/test/configuration_test.rb b/lib/ruby_indexer/test/configuration_test.rb index 2406fcc5f..1aba2dd70 100644 --- a/lib/ruby_indexer/test/configuration_test.rb +++ b/lib/ruby_indexer/test/configuration_test.rb @@ -18,6 +18,20 @@ def test_load_configuration_executes_configure_block assert(files_to_index.none? { |path| path == __FILE__ }) end + def test_files_to_index_only_includes_gem_require_paths + @config.load_config + files_to_index = @config.files_to_index + + Bundler.locked_gems.specs.each do |lazy_spec| + next if lazy_spec.name == "ruby-lsp" + + spec = Gem::Specification.find_by_name(lazy_spec.name) + assert(files_to_index.none? { |path| path.start_with?("#{spec.full_gem_path}/test/") }) + rescue Gem::MissingSpecError + # Transitive dependencies might be missing when running tests on Windows + end + end + def test_files_to_index_does_not_include_default_gem_path_when_in_bundle @config.load_config files_to_index = @config.files_to_index diff --git a/lib/ruby_indexer/test/index_test.rb b/lib/ruby_indexer/test/index_test.rb index 484690d73..bcc3c067c 100644 --- a/lib/ruby_indexer/test/index_test.rb +++ b/lib/ruby_indexer/test/index_test.rb @@ -118,5 +118,12 @@ class Something assert_equal(4, result.length) assert_equal(["Foo::Baz", "Foo::Bar", "Foo", "Foo::Baz::Something"], result.map(&:name)) end + + def test_index_single_ignores_directories + FileUtils.mkdir("lib/this_is_a_dir.rb") + @index.index_single("lib/this_is_a_dir.rb") + ensure + FileUtils.rm_r("lib/this_is_a_dir.rb") + end end end diff --git a/lib/ruby_lsp/event_emitter.rb b/lib/ruby_lsp/event_emitter.rb index 72554d82f..4d09f7888 100644 --- a/lib/ruby_lsp/event_emitter.rb +++ b/lib/ruby_lsp/event_emitter.rb @@ -43,6 +43,12 @@ def emit_for_target(node) @listeners[:on_constant_path]&.each { |l| T.unsafe(l).on_constant_path(node) } when YARP::StringNode @listeners[:on_string]&.each { |l| T.unsafe(l).on_string(node) } + when YARP::ClassNode + @listeners[:on_class]&.each { |l| T.unsafe(l).on_class(node) } + when YARP::ModuleNode + @listeners[:on_module]&.each { |l| T.unsafe(l).on_module(node) } + when YARP::ConstantWriteNode + @listeners[:on_constant_write]&.each { |l| T.unsafe(l).on_constant_write(node) } end end diff --git a/lib/ruby_lsp/executor.rb b/lib/ruby_lsp/executor.rb index 5831d7135..b5eecb371 100644 --- a/lib/ruby_lsp/executor.rb +++ b/lib/ruby_lsp/executor.rb @@ -58,14 +58,7 @@ def run(request) warn(errored_extensions.map(&:backtraces).join("\n\n")) end - if @store.experimental_features - # The begin progress invocation happens during `initialize`, so that the notification is sent before we are - # stuck indexing files - RubyIndexer.configuration.load_config - @index.index_all - end_progress("indexing-progress") - end - + perform_initial_indexing check_formatter_is_available warn("Ruby LSP is ready") @@ -209,6 +202,31 @@ def did_change_watched_files(changes) VOID end + sig { void } + def perform_initial_indexing + return unless @store.experimental_features + + # The begin progress invocation happens during `initialize`, so that the notification is sent before we are + # stuck indexing files + RubyIndexer.configuration.load_config + + begin + @index.index_all + rescue StandardError => error + @message_queue << Notification.new( + message: "window/showMessage", + params: Interface::ShowMessageParams.new( + type: Constant::MessageType::ERROR, + message: "Error while indexing: #{error.message}", + ), + ) + end + + # Always end the progress notification even if indexing failed or else it never goes away and the user has no way + # of dismissing it + end_progress("indexing-progress") + end + sig { params(query: T.nilable(String)).returns(T::Array[Interface::WorkspaceSymbol]) } def workspace_symbol(query) Requests::WorkspaceSymbol.new(query, @index).run @@ -259,16 +277,20 @@ def hover(uri, position) document = @store.get(uri) return if document.syntax_error? - target, parent = document.locate_node(position) + target, parent, nesting = document.locate_node( + position, + node_types: Requests::Hover::ALLOWED_TARGETS, + ) - if !Requests::Hover::ALLOWED_TARGETS.include?(target.class) && - Requests::Hover::ALLOWED_TARGETS.include?(parent.class) + if (Requests::Hover::ALLOWED_TARGETS.include?(parent.class) && + !Requests::Hover::ALLOWED_TARGETS.include?(target.class)) || + (parent.is_a?(SyntaxTree::ConstPathRef) && target.is_a?(SyntaxTree::Const)) target = parent end # Instantiate all listeners emitter = EventEmitter.new - hover = Requests::Hover.new(emitter, @message_queue) + hover = Requests::Hover.new(@index, nesting, emitter, @message_queue) # Emit events for all listeners emitter.emit_for_target(target) diff --git a/lib/ruby_lsp/requests.rb b/lib/ruby_lsp/requests.rb index 77e726aa8..b46fa0752 100644 --- a/lib/ruby_lsp/requests.rb +++ b/lib/ruby_lsp/requests.rb @@ -21,6 +21,7 @@ module RubyLsp # - [CodeLens](rdoc-ref:RubyLsp::Requests::CodeLens) # - [Definition](rdoc-ref:RubyLsp::Requests::Definition) # - [ShowSyntaxTree](rdoc-ref:RubyLsp::Requests::ShowSyntaxTree) + # - [WorkspaceSymbol](rdoc-ref:RubyLsp::Requests::WorkspaceSymbol) module Requests autoload :BaseRequest, "ruby_lsp/requests/base_request" diff --git a/lib/ruby_lsp/requests/definition.rb b/lib/ruby_lsp/requests/definition.rb index 4c8a16d45..e7a0af6a5 100644 --- a/lib/ruby_lsp/requests/definition.rb +++ b/lib/ruby_lsp/requests/definition.rb @@ -111,10 +111,15 @@ def find_in_index(value) # If the project has Sorbet, then we only want to handle go to definition for constants defined in gems, as an # additional behavior on top of jumping to RBIs. Sorbet can already handle go to definition for all constants # in the project, even if the files are typed false - next if DependencyDetector::HAS_TYPECHECKER && bundle_path && !entry.file_path.start_with?(bundle_path) + file_path = entry.file_path + if DependencyDetector::HAS_TYPECHECKER && bundle_path && !file_path.start_with?(bundle_path) && + !file_path.start_with?(RbConfig::CONFIG["rubylibdir"]) + + next + end Interface::Location.new( - uri: URI::Generic.from_path(path: entry.file_path).to_s, + uri: URI::Generic.from_path(path: file_path).to_s, range: Interface::Range.new( start: Interface::Position.new(line: location.start_line - 1, character: location.start_column), end: Interface::Position.new(line: location.end_line - 1, character: location.end_column), diff --git a/lib/ruby_lsp/requests/hover.rb b/lib/ruby_lsp/requests/hover.rb index 2fc49f729..04565be0d 100644 --- a/lib/ruby_lsp/requests/hover.rb +++ b/lib/ruby_lsp/requests/hover.rb @@ -3,19 +3,15 @@ module RubyLsp module Requests - # ![Hover demo](../../rails_document_link_hover.gif) + # ![Hover demo](../../hover.gif) # # The [hover request](https://microsoft.github.io/language-server-protocol/specification#textDocument_hover) - # renders a clickable link to the code's official documentation. - # It currently only supports Rails' documentation: when hovering over Rails DSLs/constants under certain paths, - # like `before_save :callback` in `models/post.rb`, it generates a link to `before_save`'s API documentation. + # displays the documentation for the symbol currently under the cursor. # # # Example # # ```ruby - # class Post < ApplicationRecord - # before_save :do_something # when hovering on before_save, the link will be rendered - # end + # String # -> Hovering over the class reference will show all declaration locations and the documentation # ``` class Hover < Listener extend T::Sig @@ -25,8 +21,9 @@ class Hover < Listener ALLOWED_TARGETS = T.let( [ - YARP::CallNode, - YARP::ConstantPathNode, + YARP::ClassNode, + YARP::ModuleNode, + YARP::ConstantWriteNode, ], T::Array[T.class_of(YARP::Node)], ) @@ -34,15 +31,24 @@ class Hover < Listener sig { override.returns(ResponseType) } attr_reader :response - sig { params(emitter: EventEmitter, message_queue: Thread::Queue).void } - def initialize(emitter, message_queue) - super + sig do + params( + index: RubyIndexer::Index, + nesting: T::Array[String], + emitter: EventEmitter, + message_queue: Thread::Queue, + ).void + end + def initialize(index, nesting, emitter, message_queue) + super(emitter, message_queue) + @nesting = nesting + @index = index @external_listeners.concat( Extension.extensions.filter_map { |ext| ext.create_hover_listener(emitter, message_queue) }, ) @response = T.let(nil, ResponseType) - emitter.register(self, :on_constant_path, :on_call) + emitter.register(self, :on_class, :on_module, :on_constant_write) end # Merges responses from other hover listeners @@ -54,34 +60,63 @@ def merge_response!(other) if @response.nil? @response = other.response else - @response.contents.value << other_response.contents.value << "\n\n" + @response.contents.value << "\n\n" << other_response.contents.value end self end - sig { params(node: YARP::ConstantPathNode).void } - def on_constant_path(node) - @response = generate_rails_document_link_hover(node.location.slice, node.location) + sig { params(node: YARP::ClassNode).void } + def on_class(node) + return if DependencyDetector::HAS_TYPECHECKER + + generate_hover(node.name, node.constant_path.location) + end + + sig { params(node: YARP::ModuleNode).void } + def on_module(node) + return if DependencyDetector::HAS_TYPECHECKER + + generate_hover(node.name, node.constant_path.location) end - sig { params(node: YARP::CallNode).void } - def on_call(node) - message = node.message - return if message.is_a?(Symbol) + sig { params(node: YARP::ConstantWriteNode).void } + def on_constant_write(node) + return if DependencyDetector::HAS_TYPECHECKER - @response = generate_rails_document_link_hover(message, node.message_loc) + generate_hover(node.name, node.name_loc) end private - sig { params(name: String, location: YARP::Location).returns(T.nilable(Interface::Hover)) } - def generate_rails_document_link_hover(name, location) - urls = Support::RailsDocumentClient.generate_rails_document_urls(name) - return if urls.empty? + sig { params(name: String, location: YARP::Location).void } + def generate_hover(name, location) + entries = @index.resolve(name, @nesting) + return unless entries - contents = Interface::MarkupContent.new(kind: "markdown", value: urls.join("\n\n")) - Interface::Hover.new(range: range_from_location(location), contents: contents) + title = +"```ruby\n#{name}\n```" + definitions = [] + content = +"" + entries.each do |entry| + loc = entry.location + + # We always handle locations as zero based. However, for file links in Markdown we need them to be one based, + # which is why instead of the usual subtraction of 1 to line numbers, we are actually adding 1 to columns. The + # format for VS Code file URIs is `file:///path/to/file.rb#Lstart_line,start_column-end_line,end_column` + uri = URI::Generic.from_path( + path: entry.file_path, + fragment: "L#{loc.start_line},#{loc.start_column + 1}-#{loc.end_line},#{loc.end_column + 1}", + ) + + definitions << "[#{entry.file_name}](#{uri})" + content << "\n\n#{entry.comments.join("\n")}" unless entry.comments.empty? + end + + contents = Interface::MarkupContent.new( + kind: "markdown", + value: "#{title}\n\n**Definitions**: #{definitions.join(" | ")}\n\n#{content}", + ) + @response = Interface::Hover.new(range: range_from_location(location), contents: contents) end end end diff --git a/lib/ruby_lsp/requests/support/rails_document_client.rb b/lib/ruby_lsp/requests/support/rails_document_client.rb deleted file mode 100644 index 5598218aa..000000000 --- a/lib/ruby_lsp/requests/support/rails_document_client.rb +++ /dev/null @@ -1,122 +0,0 @@ -# typed: strict -# frozen_string_literal: true - -require "net/http" - -module RubyLsp - module Requests - module Support - class RailsDocumentClient - RAILS_DOC_HOST = "https://api.rubyonrails.org" - SUPPORTED_RAILS_DOC_NAMESPACES = T.let( - Regexp.union( - /ActionDispatch/, - /ActionController/, - /AbstractController/, - /ActiveRecord/, - /ActiveModel/, - /ActiveStorage/, - /ActionText/, - /ActiveJob/, - ).freeze, - Regexp, - ) - - RAILTIES_VERSION = T.let( - [*::Gem::Specification.default_stubs, *::Gem::Specification.stubs].find do |s| - s.name == "railties" - end&.version&.to_s, - T.nilable(String), - ) - - class << self - extend T::Sig - sig do - params(name: String).returns(T::Array[String]) - end - def generate_rails_document_urls(name) - docs = search_index&.fetch(name, nil) - - return [] unless docs - - docs.map do |doc| - owner = doc[:owner] - - link_name = - # class/module name - if owner == name - name - else - "#{owner}##{name}" - end - - "[Rails Document: `#{link_name}`](#{doc[:url]})" - end - end - - sig { returns(T.nilable(T::Hash[String, T::Array[T::Hash[Symbol, String]]])) } - private def search_index - @rails_documents ||= T.let( - build_search_index, - T.nilable(T::Hash[String, T::Array[T::Hash[Symbol, String]]]), - ) - end - - sig { returns(T.nilable(T::Hash[String, T::Array[T::Hash[Symbol, String]]])) } - private def build_search_index - return unless RAILTIES_VERSION - - warn("Fetching Rails Documents...") - - response = Net::HTTP.get_response(URI("#{RAILS_DOC_HOST}/v#{RAILTIES_VERSION}/js/search_index.js")) - - if response.code == "302" - # If the version's doc is not found, e.g. Rails main, it'll be redirected - # In this case, we just fetch the latest doc - response = Net::HTTP.get_response(URI("#{RAILS_DOC_HOST}/js/search_index.js")) - end - - if response.code == "200" - process_search_index(response.body) - else - warn("Response failed: #{response.inspect}") - nil - end - rescue StandardError => e - warn("Exception occurred when fetching Rails document index: #{e.inspect}") - end - - sig { params(js: String).returns(T::Hash[String, T::Array[T::Hash[Symbol, String]]]) } - private def process_search_index(js) - raw_data = js.sub("var search_data = ", "") - info = JSON.parse(raw_data).dig("index", "info") - - # An entry looks like this: - # - # ["belongs_to", # method or module/class - # "ActiveRecord::Associations::ClassMethods", # method owner - # "classes/ActiveRecord/Associations/ClassMethods.html#method-i-belongs_to", # path to the document - # "(name, scope = nil, **options)", # method's parameters - # "

Specifies a one-to-one association with another class..."] # document preview - # - info.each_with_object({}) do |(method_or_class, method_owner, doc_path, _, doc_preview), table| - # If a method doesn't have documentation, there's no need to generate the link to it. - next if doc_preview.nil? || doc_preview.empty? - - # If the method or class/module is not from the supported namespace, reject it - next unless [method_or_class, method_owner].any? do |elem| - elem.match?(SUPPORTED_RAILS_DOC_NAMESPACES) - end - - owner = method_owner.empty? ? method_or_class : method_owner - table[method_or_class] ||= [] - # It's possible to have multiple modules defining the same method name. For example, - # both `ActiveRecord::FinderMethods` and `ActiveRecord::Associations::CollectionProxy` defines `#find` - table[method_or_class] << { owner: owner, url: "#{RAILS_DOC_HOST}/v#{RAILTIES_VERSION}/#{doc_path}" } - end - end - end - end - end - end -end diff --git a/lib/ruby_lsp/requests/workspace_symbol.rb b/lib/ruby_lsp/requests/workspace_symbol.rb index 63833c5ad..8b3822a3f 100644 --- a/lib/ruby_lsp/requests/workspace_symbol.rb +++ b/lib/ruby_lsp/requests/workspace_symbol.rb @@ -38,7 +38,12 @@ def run @index.fuzzy_search(@query).filter_map do |entry| # If the project is using Sorbet, we let Sorbet handle symbols defined inside the project itself and RBIs, but # we still return entries defined in gems to allow developers to jump directly to the source - next if DependencyDetector::HAS_TYPECHECKER && bundle_path && !entry.file_path.start_with?(bundle_path) + file_path = entry.file_path + if DependencyDetector::HAS_TYPECHECKER && bundle_path && !file_path.start_with?(bundle_path) && + !file_path.start_with?(RbConfig::CONFIG["rubylibdir"]) + + next + end kind = kind_for_entry(entry) loc = entry.location @@ -53,7 +58,7 @@ def run container_name: T.must(container).join("::"), kind: kind, location: Interface::Location.new( - uri: URI::Generic.from_path(path: entry.file_path).to_s, + uri: URI::Generic.from_path(path: file_path).to_s, range: Interface::Range.new( start: Interface::Position.new(line: loc.start_line - 1, character: loc.start_column), end: Interface::Position.new(line: loc.end_line - 1, character: loc.end_column), diff --git a/lib/ruby_lsp/setup_bundler.rb b/lib/ruby_lsp/setup_bundler.rb index e2dcafe87..71c417ea7 100644 --- a/lib/ruby_lsp/setup_bundler.rb +++ b/lib/ruby_lsp/setup_bundler.rb @@ -6,6 +6,7 @@ require "fileutils" require "pathname" require "digest" +require "time" # This file is a script that will configure a custom bundle for the Ruby LSP. The custom bundle allows developers to use # the Ruby LSP without including the gem in their application's Gemfile while at the same time giving us access to the @@ -17,6 +18,8 @@ class SetupBundler class BundleNotLocked < StandardError; end + FOUR_HOURS = T.let(4 * 60 * 60, Integer) + sig { params(project_path: String, branch: T.nilable(String)).void } def initialize(project_path, branch: nil) @project_path = project_path @@ -27,6 +30,7 @@ def initialize(project_path, branch: nil) @custom_gemfile = T.let(@custom_dir + "Gemfile", Pathname) @custom_lockfile = T.let(@custom_dir + "Gemfile.lock", Pathname) @lockfile_hash_path = T.let(@custom_dir + "main_lockfile_hash", Pathname) + @last_updated_path = T.let(@custom_dir + "last_updated", Pathname) # Regular bundle paths @gemfile = T.let( @@ -173,15 +177,16 @@ def run_bundle_install(bundle_gemfile = @gemfile) # custom `.ruby-lsp/Gemfile.lock` already exists and includes both gems command = +"" - if (@dependencies["ruby-lsp"] && @dependencies["debug"]) || - custom_bundle_dependencies["ruby-lsp"].nil? || custom_bundle_dependencies["debug"].nil? + if should_bundle_install? # Install gems using the custom bundle - command << "bundle install " + command << "(bundle check || bundle install) " else # If ruby-lsp or debug are not in the Gemfile, try to update them to the latest version command << "bundle update " command << "ruby-lsp " unless @dependencies["ruby-lsp"] command << "debug " unless @dependencies["debug"] + + @last_updated_path.write(Time.now.iso8601) end # Redirect stdout to stderr to prevent going into an infinite loop. The extension might confuse stdout output with @@ -193,5 +198,12 @@ def run_bundle_install(bundle_gemfile = @gemfile) system(env, command) [bundle_gemfile.to_s, expanded_path] end + + sig { returns(T::Boolean) } + def should_bundle_install? + (!@dependencies["ruby-lsp"].nil? && !@dependencies["debug"].nil?) || + custom_bundle_dependencies["ruby-lsp"].nil? || custom_bundle_dependencies["debug"].nil? || + (@last_updated_path.exist? && Time.parse(@last_updated_path.read) > (Time.now - FOUR_HOURS)) + end end end diff --git a/misc/hover.gif b/misc/hover.gif new file mode 100644 index 000000000..82a33c5a3 Binary files /dev/null and b/misc/hover.gif differ diff --git a/misc/rails_document_link_hover.gif b/misc/rails_document_link_hover.gif deleted file mode 100644 index 4dcce1cff..000000000 Binary files a/misc/rails_document_link_hover.gif and /dev/null differ diff --git a/ruby-lsp.gemspec b/ruby-lsp.gemspec index cef5f4a2a..69e0a0b93 100644 --- a/ruby-lsp.gemspec +++ b/ruby-lsp.gemspec @@ -20,7 +20,7 @@ Gem::Specification.new do |s| s.add_dependency("language_server-protocol", "~> 3.17.0") s.add_dependency("sorbet-runtime") s.add_dependency("syntax_tree", ">= 6.1.1", "< 7") - s.add_dependency("yarp", ">= 0.8", "< 0.10") + s.add_dependency("yarp", ">= 0.9", "< 0.10") s.required_ruby_version = ">= 3.0" end diff --git a/sorbet/rbi/gems/actionpack@7.0.5.rbi b/sorbet/rbi/gems/actionpack@7.0.5.rbi deleted file mode 100644 index be565d7a0..000000000 --- a/sorbet/rbi/gems/actionpack@7.0.5.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `actionpack` gem. -# Please instead update this file by running `bin/tapioca gem actionpack`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/actionview@7.0.5.rbi b/sorbet/rbi/gems/actionview@7.0.5.rbi deleted file mode 100644 index 79d7b03f7..000000000 --- a/sorbet/rbi/gems/actionview@7.0.5.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `actionview` gem. -# Please instead update this file by running `bin/tapioca gem actionview`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/activesupport@7.0.5.rbi b/sorbet/rbi/gems/activesupport@7.0.5.rbi deleted file mode 100644 index 9afcbd12c..000000000 --- a/sorbet/rbi/gems/activesupport@7.0.5.rbi +++ /dev/null @@ -1,14 +0,0 @@ -# typed: false - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `activesupport` gem. -# Please instead update this file by running `bin/tapioca gem activesupport`. - -class LoadError < ::ScriptError - include ::DidYouMean::Correctable -end - -class NameError < ::StandardError - include ::ErrorHighlight::CoreExt - include ::DidYouMean::Correctable -end diff --git a/sorbet/rbi/gems/base64@0.1.1.rbi b/sorbet/rbi/gems/base64@0.1.1.rbi new file mode 100644 index 000000000..58bcecc24 --- /dev/null +++ b/sorbet/rbi/gems/base64@0.1.1.rbi @@ -0,0 +1,172 @@ +# 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`. + +# The Base64 module provides for the encoding (#encode64, #strict_encode64, +# #urlsafe_encode64) and decoding (#decode64, #strict_decode64, +# #urlsafe_decode64) of binary data using a Base64 representation. +# +# == Example +# +# A simple encoding and decoding. +# +# require "base64" +# +# enc = Base64.encode64('Send reinforcements') +# # -> "U2VuZCByZWluZm9yY2VtZW50cw==\n" +# plain = Base64.decode64(enc) +# # -> "Send reinforcements" +# +# The purpose of using base64 to encode data is that it translates any +# binary data into purely printable characters. +module Base64 + private + + # Returns the Base64-decoded version of +str+. + # This method complies with RFC 2045. + # Characters outside the base alphabet are ignored. + # + # require 'base64' + # str = 'VGhpcyBpcyBsaW5lIG9uZQpUaGlzIG' + + # 'lzIGxpbmUgdHdvClRoaXMgaXMgbGlu' + + # 'ZSB0aHJlZQpBbmQgc28gb24uLi4K' + # puts Base64.decode64(str) + # + # Generates: + # + # This is line one + # This is line two + # This is line three + # And so on... + # + # source://base64//base64.rb#58 + def decode64(str); end + + # Returns the Base64-encoded version of +bin+. + # This method complies with RFC 2045. + # Line feeds are added to every 60 encoded characters. + # + # require 'base64' + # Base64.encode64("Now is the time for all good coders\nto learn Ruby") + # + # Generates: + # + # Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g + # UnVieQ== + # + # source://base64//base64.rb#38 + def encode64(bin); end + + # Returns the Base64-decoded version of +str+. + # This method complies with RFC 4648. + # ArgumentError is raised if +str+ is incorrectly padded or contains + # non-alphabet characters. Note that CR or LF are also rejected. + # + # source://base64//base64.rb#73 + def strict_decode64(str); end + + # Returns the Base64-encoded version of +bin+. + # This method complies with RFC 4648. + # No line feeds are added. + # + # source://base64//base64.rb#65 + def strict_encode64(bin); end + + # Returns the Base64-decoded version of +str+. + # This method complies with ``Base 64 Encoding with URL and Filename Safe + # Alphabet'' in RFC 4648. + # The alphabet uses '-' instead of '+' and '_' instead of '/'. + # + # The padding character is optional. + # This method accepts both correctly-padded and unpadded input. + # Note that it still rejects incorrectly-padded input. + # + # source://base64//base64.rb#98 + def urlsafe_decode64(str); end + + # Returns the Base64-encoded version of +bin+. + # This method complies with ``Base 64 Encoding with URL and Filename Safe + # Alphabet'' in RFC 4648. + # The alphabet uses '-' instead of '+' and '_' instead of '/'. + # Note that the result can still contain '='. + # You can remove the padding by setting +padding+ as false. + # + # source://base64//base64.rb#83 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + + class << self + # Returns the Base64-decoded version of +str+. + # This method complies with RFC 2045. + # Characters outside the base alphabet are ignored. + # + # require 'base64' + # str = 'VGhpcyBpcyBsaW5lIG9uZQpUaGlzIG' + + # 'lzIGxpbmUgdHdvClRoaXMgaXMgbGlu' + + # 'ZSB0aHJlZQpBbmQgc28gb24uLi4K' + # puts Base64.decode64(str) + # + # Generates: + # + # This is line one + # This is line two + # This is line three + # And so on... + # + # source://base64//base64.rb#58 + def decode64(str); end + + # Returns the Base64-encoded version of +bin+. + # This method complies with RFC 2045. + # Line feeds are added to every 60 encoded characters. + # + # require 'base64' + # Base64.encode64("Now is the time for all good coders\nto learn Ruby") + # + # Generates: + # + # Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g + # UnVieQ== + # + # source://base64//base64.rb#38 + def encode64(bin); end + + # Returns the Base64-decoded version of +str+. + # This method complies with RFC 4648. + # ArgumentError is raised if +str+ is incorrectly padded or contains + # non-alphabet characters. Note that CR or LF are also rejected. + # + # source://base64//base64.rb#73 + def strict_decode64(str); end + + # Returns the Base64-encoded version of +bin+. + # This method complies with RFC 4648. + # No line feeds are added. + # + # source://base64//base64.rb#65 + def strict_encode64(bin); end + + # Returns the Base64-decoded version of +str+. + # This method complies with ``Base 64 Encoding with URL and Filename Safe + # Alphabet'' in RFC 4648. + # The alphabet uses '-' instead of '+' and '_' instead of '/'. + # + # The padding character is optional. + # This method accepts both correctly-padded and unpadded input. + # Note that it still rejects incorrectly-padded input. + # + # source://base64//base64.rb#98 + def urlsafe_decode64(str); end + + # Returns the Base64-encoded version of +bin+. + # This method complies with ``Base 64 Encoding with URL and Filename Safe + # Alphabet'' in RFC 4648. + # The alphabet uses '-' instead of '+' and '_' instead of '/'. + # Note that the result can still contain '='. + # You can remove the padding by setting +padding+ as false. + # + # source://base64//base64.rb#83 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + end +end diff --git a/sorbet/rbi/gems/concurrent-ruby@1.2.2.rbi b/sorbet/rbi/gems/concurrent-ruby@1.2.2.rbi deleted file mode 100644 index 5b0aa746b..000000000 --- a/sorbet/rbi/gems/concurrent-ruby@1.2.2.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `concurrent-ruby` gem. -# Please instead update this file by running `bin/tapioca gem concurrent-ruby`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/crass@1.0.6.rbi b/sorbet/rbi/gems/crass@1.0.6.rbi deleted file mode 100644 index 0df5a2e40..000000000 --- a/sorbet/rbi/gems/crass@1.0.6.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `crass` gem. -# Please instead update this file by running `bin/tapioca gem crass`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/erubi@1.12.0.rbi b/sorbet/rbi/gems/erubi@1.12.0.rbi index d4a12f53e..c52738faa 100644 --- a/sorbet/rbi/gems/erubi@1.12.0.rbi +++ b/sorbet/rbi/gems/erubi@1.12.0.rbi @@ -4,5 +4,142 @@ # This is an autogenerated file for types exported from the `erubi` gem. # Please instead update this file by running `bin/tapioca gem erubi`. -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem +# source://erubi//lib/erubi.rb#3 +module Erubi + class << self + def h(_arg0); end + end +end + +# source://erubi//lib/erubi.rb#54 +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#94 + def initialize(input, properties = T.unsafe(nil)); end + + # The variable name used for the buffer variable. + # + # source://erubi//lib/erubi.rb#65 + def bufvar; end + + # The filename of the template, if one was given. + # + # source://erubi//lib/erubi.rb#62 + def filename; end + + # The frozen ruby source code generated from the template, which can be evaled. + # + # source://erubi//lib/erubi.rb#59 + def src; end + + private + + # Add ruby code to the template + # + # source://erubi//lib/erubi.rb#226 + 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#235 + def add_expression(indicator, code); end + + # Add the result of Ruby expression to the template + # + # source://erubi//lib/erubi.rb#244 + def add_expression_result(code); end + + # Add the escaped result of Ruby expression to the template + # + # source://erubi//lib/erubi.rb#249 + 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#255 + 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#213 + 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#261 + 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#289 + 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#271 + def with_buffer; end +end + +# The default regular expression used for scanning. +# +# source://erubi//lib/erubi.rb#56 +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/sorbet/rbi/gems/i18n@1.13.0.rbi b/sorbet/rbi/gems/i18n@1.13.0.rbi deleted file mode 100644 index 49dd358b5..000000000 --- a/sorbet/rbi/gems/i18n@1.13.0.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `i18n` gem. -# Please instead update this file by running `bin/tapioca gem i18n`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/loofah@2.21.3.rbi b/sorbet/rbi/gems/loofah@2.21.3.rbi deleted file mode 100644 index 844c389fa..000000000 --- a/sorbet/rbi/gems/loofah@2.21.3.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `loofah` gem. -# Please instead update this file by running `bin/tapioca gem loofah`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/method_source@1.0.0.rbi b/sorbet/rbi/gems/method_source@1.0.0.rbi deleted file mode 100644 index fe08676ba..000000000 --- a/sorbet/rbi/gems/method_source@1.0.0.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# 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`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/mini_portile2@2.8.2.rbi b/sorbet/rbi/gems/mini_portile2@2.8.2.rbi deleted file mode 100644 index 8029498f3..000000000 --- a/sorbet/rbi/gems/mini_portile2@2.8.2.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `mini_portile2` gem. -# Please instead update this file by running `bin/tapioca gem mini_portile2`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/minitest-reporters@1.6.0.rbi b/sorbet/rbi/gems/minitest-reporters@1.6.1.rbi similarity index 96% rename from sorbet/rbi/gems/minitest-reporters@1.6.0.rbi rename to sorbet/rbi/gems/minitest-reporters@1.6.1.rbi index bcc1b1db6..b5edefb27 100644 --- a/sorbet/rbi/gems/minitest-reporters@1.6.0.rbi +++ b/sorbet/rbi/gems/minitest-reporters@1.6.1.rbi @@ -7,73 +7,73 @@ # source://minitest-reporters//lib/minitest/reporters.rb#3 module Minitest class << self - # source://minitest/5.18.0/lib/minitest.rb#173 + # source://minitest/5.19.0/lib/minitest.rb#173 def __run(reporter, options); end - # source://minitest/5.18.0/lib/minitest.rb#94 + # source://minitest/5.19.0/lib/minitest.rb#94 def after_run(&block); end - # source://minitest/5.18.0/lib/minitest.rb#66 + # source://minitest/5.19.0/lib/minitest.rb#66 def autorun; end - # source://minitest/5.18.0/lib/minitest.rb#19 + # source://minitest/5.19.0/lib/minitest.rb#19 def backtrace_filter; end - # source://minitest/5.18.0/lib/minitest.rb#19 + # source://minitest/5.19.0/lib/minitest.rb#19 def backtrace_filter=(_arg0); end - # source://minitest/5.18.0/lib/minitest.rb#18 + # source://minitest/5.19.0/lib/minitest.rb#18 def cattr_accessor(name); end - # source://minitest/5.18.0/lib/minitest.rb#1059 + # source://minitest/5.19.0/lib/minitest.rb#1099 def clock_time; end - # source://minitest/5.18.0/lib/minitest.rb#19 + # source://minitest/5.19.0/lib/minitest.rb#19 def extensions; end - # source://minitest/5.18.0/lib/minitest.rb#19 + # source://minitest/5.19.0/lib/minitest.rb#19 def extensions=(_arg0); end - # source://minitest/5.18.0/lib/minitest.rb#264 + # source://minitest/5.19.0/lib/minitest.rb#264 def filter_backtrace(bt); end - # source://minitest/5.18.0/lib/minitest.rb#19 + # source://minitest/5.19.0/lib/minitest.rb#19 def info_signal; end - # source://minitest/5.18.0/lib/minitest.rb#19 + # source://minitest/5.19.0/lib/minitest.rb#19 def info_signal=(_arg0); end - # source://minitest/5.18.0/lib/minitest.rb#98 + # source://minitest/5.19.0/lib/minitest.rb#98 def init_plugins(options); end - # source://minitest/5.18.0/lib/minitest.rb#105 + # source://minitest/5.19.0/lib/minitest.rb#105 def load_plugins; end - # source://minitest/5.18.0/lib/minitest.rb#19 + # source://minitest/5.19.0/lib/minitest.rb#19 def parallel_executor; end - # source://minitest/5.18.0/lib/minitest.rb#19 + # source://minitest/5.19.0/lib/minitest.rb#19 def parallel_executor=(_arg0); end - # source://minitest/5.18.0/lib/minitest.rb#186 + # source://minitest/5.19.0/lib/minitest.rb#186 def process_args(args = T.unsafe(nil)); end - # source://minitest/5.18.0/lib/minitest.rb#19 + # source://minitest/5.19.0/lib/minitest.rb#19 def reporter; end - # source://minitest/5.18.0/lib/minitest.rb#19 + # source://minitest/5.19.0/lib/minitest.rb#19 def reporter=(_arg0); end - # source://minitest/5.18.0/lib/minitest.rb#140 + # source://minitest/5.19.0/lib/minitest.rb#140 def run(args = T.unsafe(nil)); end - # source://minitest/5.18.0/lib/minitest.rb#1050 + # source://minitest/5.19.0/lib/minitest.rb#1090 def run_one_method(klass, method_name); end - # source://minitest/5.18.0/lib/minitest.rb#19 + # source://minitest/5.19.0/lib/minitest.rb#19 def seed; end - # source://minitest/5.18.0/lib/minitest.rb#19 + # source://minitest/5.19.0/lib/minitest.rb#19 def seed=(_arg0); end end end diff --git a/sorbet/rbi/gems/minitest@5.18.0.rbi b/sorbet/rbi/gems/minitest@5.19.0.rbi similarity index 85% rename from sorbet/rbi/gems/minitest@5.18.0.rbi rename to sorbet/rbi/gems/minitest@5.19.0.rbi index ad726b1d0..cf760e917 100644 --- a/sorbet/rbi/gems/minitest@5.18.0.rbi +++ b/sorbet/rbi/gems/minitest@5.19.0.rbi @@ -37,7 +37,7 @@ module Minitest # source://minitest//lib/minitest.rb#18 def cattr_accessor(name); end - # source://minitest//lib/minitest.rb#1059 + # source://minitest//lib/minitest.rb#1099 def clock_time; end # source://minitest//lib/minitest.rb#19 @@ -95,7 +95,7 @@ module Minitest # source://minitest//lib/minitest.rb#140 def run(args = T.unsafe(nil)); end - # source://minitest//lib/minitest.rb#1050 + # source://minitest//lib/minitest.rb#1090 def run_one_method(klass, method_name); end # source://minitest//lib/minitest.rb#19 @@ -109,7 +109,7 @@ end # Defines the API for Reporters. Subclass this and override whatever # you want. Go nuts. # -# source://minitest//lib/minitest.rb#578 +# source://minitest//lib/minitest.rb#618 class Minitest::AbstractReporter include ::Mutex_m @@ -123,13 +123,13 @@ class Minitest::AbstractReporter # # @return [Boolean] # - # source://minitest//lib/minitest.rb#612 + # source://minitest//lib/minitest.rb#652 def passed?; end # About to start running a test. This allows a reporter to show # that it is starting or that we are in the middle of a test run. # - # source://minitest//lib/minitest.rb#591 + # source://minitest//lib/minitest.rb#631 def prerecord(klass, name); end # Output and record the result of the test. Call @@ -137,17 +137,17 @@ class Minitest::AbstractReporter # result character string. Stores the result of the run if the run # did not pass. # - # source://minitest//lib/minitest.rb#600 + # source://minitest//lib/minitest.rb#640 def record(result); end # Outputs the summary of the run. # - # source://minitest//lib/minitest.rb#606 + # source://minitest//lib/minitest.rb#646 def report; end # Starts reporting on the run. # - # source://minitest//lib/minitest.rb#584 + # source://minitest//lib/minitest.rb#624 def start; end # source://mutex_m/0.1.2/mutex_m.rb#78 @@ -162,20 +162,20 @@ end # Represents run failures. # -# source://minitest//lib/minitest.rb#895 +# source://minitest//lib/minitest.rb#935 class Minitest::Assertion < ::Exception - # source://minitest//lib/minitest.rb#896 + # source://minitest//lib/minitest.rb#936 def error; end # Where was this run before an assertion was raised? # - # source://minitest//lib/minitest.rb#903 + # source://minitest//lib/minitest.rb#943 def location; end - # source://minitest//lib/minitest.rb#912 + # source://minitest//lib/minitest.rb#952 def result_code; end - # source://minitest//lib/minitest.rb#916 + # source://minitest//lib/minitest.rb#956 def result_label; end end @@ -618,60 +618,60 @@ Minitest::Assertions::UNDEFINED = T.let(T.unsafe(nil), Object) # # See Minitest.backtrace_filter=. # -# source://minitest//lib/minitest.rb#1027 +# source://minitest//lib/minitest.rb#1067 class Minitest::BacktraceFilter # Filter +bt+ to something useful. Returns the whole thing if # $DEBUG (ruby) or $MT_DEBUG (env). # - # source://minitest//lib/minitest.rb#1035 + # source://minitest//lib/minitest.rb#1075 def filter(bt); end end -# source://minitest//lib/minitest.rb#1029 +# source://minitest//lib/minitest.rb#1069 Minitest::BacktraceFilter::MT_RE = T.let(T.unsafe(nil), Regexp) # Dispatch to multiple reporters as one. # -# source://minitest//lib/minitest.rb#844 +# source://minitest//lib/minitest.rb#884 class Minitest::CompositeReporter < ::Minitest::AbstractReporter # @return [CompositeReporter] a new instance of CompositeReporter # - # source://minitest//lib/minitest.rb#850 + # source://minitest//lib/minitest.rb#890 def initialize(*reporters); end # Add another reporter to the mix. # - # source://minitest//lib/minitest.rb#862 + # source://minitest//lib/minitest.rb#902 def <<(reporter); end - # source://minitest//lib/minitest.rb#855 + # source://minitest//lib/minitest.rb#895 def io; end # @return [Boolean] # - # source://minitest//lib/minitest.rb#866 + # source://minitest//lib/minitest.rb#906 def passed?; end - # source://minitest//lib/minitest.rb#874 + # source://minitest//lib/minitest.rb#914 def prerecord(klass, name); end - # source://minitest//lib/minitest.rb#881 + # source://minitest//lib/minitest.rb#921 def record(result); end - # source://minitest//lib/minitest.rb#887 + # source://minitest//lib/minitest.rb#927 def report; end # The list of reporters to dispatch to. # - # source://minitest//lib/minitest.rb#848 + # source://minitest//lib/minitest.rb#888 def reporters; end # The list of reporters to dispatch to. # - # source://minitest//lib/minitest.rb#848 + # source://minitest//lib/minitest.rb#888 def reporters=(_arg0); end - # source://minitest//lib/minitest.rb#870 + # source://minitest//lib/minitest.rb#910 def start; end end @@ -689,48 +689,48 @@ end # # ... lots of test methods ... # end # -# source://minitest//lib/minitest.rb#971 +# source://minitest//lib/minitest.rb#1011 module Minitest::Guard # Is this running on jruby? # # @return [Boolean] # - # source://minitest//lib/minitest.rb#976 + # source://minitest//lib/minitest.rb#1016 def jruby?(platform = T.unsafe(nil)); end # Is this running on maglev? # # @return [Boolean] # - # source://minitest//lib/minitest.rb#983 + # source://minitest//lib/minitest.rb#1023 def maglev?(platform = T.unsafe(nil)); end # Is this running on mri? # # @return [Boolean] # - # source://minitest//lib/minitest.rb#993 + # source://minitest//lib/minitest.rb#1033 def mri?(platform = T.unsafe(nil)); end # Is this running on macOS? # # @return [Boolean] # - # source://minitest//lib/minitest.rb#1000 + # source://minitest//lib/minitest.rb#1040 def osx?(platform = T.unsafe(nil)); end # Is this running on rubinius? # # @return [Boolean] # - # source://minitest//lib/minitest.rb#1007 + # source://minitest//lib/minitest.rb#1047 def rubinius?(platform = T.unsafe(nil)); end # Is this running on windows? # # @return [Boolean] # - # source://minitest//lib/minitest.rb#1017 + # source://minitest//lib/minitest.rb#1057 def windows?(platform = T.unsafe(nil)); end end @@ -793,36 +793,36 @@ end # plugin, pull this out of the composite and replace it with your # own. # -# source://minitest//lib/minitest.rb#643 +# source://minitest//lib/minitest.rb#683 class Minitest::ProgressReporter < ::Minitest::Reporter - # source://minitest//lib/minitest.rb#644 + # source://minitest//lib/minitest.rb#684 def prerecord(klass, name); end - # source://minitest//lib/minitest.rb#651 + # source://minitest//lib/minitest.rb#691 def record(result); end end # Shared code for anything that can get passed to a Reporter. See # Minitest::Test & Minitest::Result. # -# source://minitest//lib/minitest.rb#475 +# source://minitest//lib/minitest.rb#514 module Minitest::Reportable # @raise [NotImplementedError] # - # source://minitest//lib/minitest.rb#495 + # source://minitest//lib/minitest.rb#534 def class_name; end # Did this run error? # # @return [Boolean] # - # source://minitest//lib/minitest.rb#516 + # source://minitest//lib/minitest.rb#555 def error?; end # The location identifier of this test. Depends on a method # existing called class_name. # - # source://minitest//lib/minitest.rb#490 + # source://minitest//lib/minitest.rb#529 def location; end # Did this run pass? @@ -832,47 +832,47 @@ module Minitest::Reportable # # @return [Boolean] # - # source://minitest//lib/minitest.rb#482 + # source://minitest//lib/minitest.rb#521 def passed?; end # Returns ".", "F", or "E" based on the result of the run. # - # source://minitest//lib/minitest.rb#502 + # source://minitest//lib/minitest.rb#541 def result_code; end # Was this run skipped? # # @return [Boolean] # - # source://minitest//lib/minitest.rb#509 + # source://minitest//lib/minitest.rb#548 def skipped?; end end -# source://minitest//lib/minitest.rb#619 +# source://minitest//lib/minitest.rb#659 class Minitest::Reporter < ::Minitest::AbstractReporter # @return [Reporter] a new instance of Reporter # - # source://minitest//lib/minitest.rb#628 + # source://minitest//lib/minitest.rb#668 def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end # The IO used to report. # - # source://minitest//lib/minitest.rb#621 + # source://minitest//lib/minitest.rb#661 def io; end # The IO used to report. # - # source://minitest//lib/minitest.rb#621 + # source://minitest//lib/minitest.rb#661 def io=(_arg0); end # Command-line options for this run. # - # source://minitest//lib/minitest.rb#626 + # source://minitest//lib/minitest.rb#666 def options; end # Command-line options for this run. # - # source://minitest//lib/minitest.rb#626 + # source://minitest//lib/minitest.rb#666 def options=(_arg0); end end @@ -882,40 +882,40 @@ end # blow up. By using Result.from(a_test) you can be reasonably sure # that the test result can be marshalled. # -# source://minitest//lib/minitest.rb#528 +# source://minitest//lib/minitest.rb#567 class Minitest::Result < ::Minitest::Runnable include ::Minitest::Reportable - # source://minitest//lib/minitest.rb#561 + # source://minitest//lib/minitest.rb#601 def class_name; end # The class name of the test result. # - # source://minitest//lib/minitest.rb#537 + # source://minitest//lib/minitest.rb#576 def klass; end # The class name of the test result. # - # source://minitest//lib/minitest.rb#537 + # source://minitest//lib/minitest.rb#576 def klass=(_arg0); end # The location of the test method. # - # source://minitest//lib/minitest.rb#542 + # source://minitest//lib/minitest.rb#581 def source_location; end # The location of the test method. # - # source://minitest//lib/minitest.rb#542 + # source://minitest//lib/minitest.rb#581 def source_location=(_arg0); end - # source://minitest//lib/minitest.rb#565 + # source://minitest//lib/minitest.rb#605 def to_s; end class << self # Create a new test result from a Runnable instance. # - # source://minitest//lib/minitest.rb#547 + # source://minitest//lib/minitest.rb#586 def from(runnable); end end end @@ -926,7 +926,7 @@ end class Minitest::Runnable # @return [Runnable] a new instance of Runnable # - # source://minitest//lib/minitest.rb#431 + # source://minitest//lib/minitest.rb#445 def initialize(name); end # Number of assertions executed in this run. @@ -939,7 +939,7 @@ class Minitest::Runnable # source://minitest//lib/minitest.rb#281 def assertions=(_arg0); end - # source://minitest//lib/minitest.rb#427 + # source://minitest//lib/minitest.rb#441 def failure; end # An assertion raised during the run, if any. @@ -952,12 +952,34 @@ class Minitest::Runnable # source://minitest//lib/minitest.rb#286 def failures=(_arg0); end - # source://minitest//lib/minitest.rb#413 + # source://minitest//lib/minitest.rb#427 def marshal_dump; end - # source://minitest//lib/minitest.rb#423 + # source://minitest//lib/minitest.rb#437 def marshal_load(ary); end + # Metadata you attach to the test results that get sent to the reporter. + # + # Lazily initializes to a hash, to keep memory down. + # + # NOTE: this data *must* be plain (read: marshal-able) data! + # Hashes! Arrays! Strings! + # + # source://minitest//lib/minitest.rb#460 + def metadata; end + + # Sets metadata, mainly used for +Result.from+. + # + # source://minitest//lib/minitest.rb#467 + def metadata=(_arg0); end + + # Returns true if metadata exists. + # + # @return [Boolean] + # + # source://minitest//lib/minitest.rb#472 + def metadata?; end + # Name of the run. # # source://minitest//lib/minitest.rb#304 @@ -976,7 +998,7 @@ class Minitest::Runnable # @raise [NotImplementedError] # @return [Boolean] # - # source://minitest//lib/minitest.rb#450 + # source://minitest//lib/minitest.rb#489 def passed?; end # Returns a single character string to print based on the result @@ -985,14 +1007,14 @@ class Minitest::Runnable # # @raise [NotImplementedError] # - # source://minitest//lib/minitest.rb#459 + # source://minitest//lib/minitest.rb#498 def result_code; end # Runs a single method. Needs to return self. # # @raise [NotImplementedError] # - # source://minitest//lib/minitest.rb#440 + # source://minitest//lib/minitest.rb#479 def run; end # Was this run skipped? See #passed? for more information. @@ -1000,7 +1022,7 @@ class Minitest::Runnable # @raise [NotImplementedError] # @return [Boolean] # - # source://minitest//lib/minitest.rb#466 + # source://minitest//lib/minitest.rb#505 def skipped?; end # The time it took to run. @@ -1017,7 +1039,7 @@ class Minitest::Runnable def time_it; end class << self - # source://minitest//lib/minitest.rb#1069 + # source://minitest//lib/minitest.rb#1109 def inherited(klass); end # Returns all instance methods matching the pattern +re+. @@ -1025,7 +1047,7 @@ class Minitest::Runnable # source://minitest//lib/minitest.rb#318 def methods_matching(re); end - # source://minitest//lib/minitest.rb#383 + # source://minitest//lib/minitest.rb#397 def on_signal(name, action); end # source://minitest//lib/minitest.rb#322 @@ -1043,7 +1065,7 @@ class Minitest::Runnable # that subclasses can specialize the running of an individual # test. See Minitest::ParallelTest::ClassMethods for an example. # - # source://minitest//lib/minitest.rb#363 + # source://minitest//lib/minitest.rb#369 def run_one_method(klass, method_name, reporter); end # Each subclass of Runnable is responsible for overriding this @@ -1051,27 +1073,33 @@ class Minitest::Runnable # # @raise [NotImplementedError] # - # source://minitest//lib/minitest.rb#400 + # source://minitest//lib/minitest.rb#414 def runnable_methods; end # Returns all subclasses of Runnable. # - # source://minitest//lib/minitest.rb#407 + # source://minitest//lib/minitest.rb#421 def runnables; end - # source://minitest//lib/minitest.rb#368 + # Defines the order to run tests (:random by default). Override + # this or use a convenience method to change it for your tests. + # + # source://minitest//lib/minitest.rb#378 + def test_order; end + + # source://minitest//lib/minitest.rb#382 def with_info_handler(reporter, &block); end end end -# source://minitest//lib/minitest.rb#381 +# source://minitest//lib/minitest.rb#395 Minitest::Runnable::SIGNALS = T.let(T.unsafe(nil), Hash) # Assertion raised when skipping a run. # -# source://minitest//lib/minitest.rb#924 +# source://minitest//lib/minitest.rb#964 class Minitest::Skip < ::Minitest::Assertion - # source://minitest//lib/minitest.rb#925 + # source://minitest//lib/minitest.rb#965 def result_label; end end @@ -1095,113 +1123,113 @@ end # end # end # -# source://minitest//lib/minitest.rb#679 +# source://minitest//lib/minitest.rb#719 class Minitest::StatisticsReporter < ::Minitest::Reporter # @return [StatisticsReporter] a new instance of StatisticsReporter # - # source://minitest//lib/minitest.rb#723 + # source://minitest//lib/minitest.rb#763 def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end # Total number of assertions. # - # source://minitest//lib/minitest.rb#683 + # source://minitest//lib/minitest.rb#723 def assertions; end # Total number of assertions. # - # source://minitest//lib/minitest.rb#683 + # source://minitest//lib/minitest.rb#723 def assertions=(_arg0); end # Total number of test cases. # - # source://minitest//lib/minitest.rb#688 + # source://minitest//lib/minitest.rb#728 def count; end # Total number of test cases. # - # source://minitest//lib/minitest.rb#688 + # source://minitest//lib/minitest.rb#728 def count=(_arg0); end # Total number of tests that erred. # - # source://minitest//lib/minitest.rb#716 + # source://minitest//lib/minitest.rb#756 def errors; end # Total number of tests that erred. # - # source://minitest//lib/minitest.rb#716 + # source://minitest//lib/minitest.rb#756 def errors=(_arg0); end # Total number of tests that failed. # - # source://minitest//lib/minitest.rb#711 + # source://minitest//lib/minitest.rb#751 def failures; end # Total number of tests that failed. # - # source://minitest//lib/minitest.rb#711 + # source://minitest//lib/minitest.rb#751 def failures=(_arg0); end # @return [Boolean] # - # source://minitest//lib/minitest.rb#736 + # source://minitest//lib/minitest.rb#776 def passed?; end - # source://minitest//lib/minitest.rb#744 + # source://minitest//lib/minitest.rb#784 def record(result); end # Report on the tracked statistics. # - # source://minitest//lib/minitest.rb#754 + # source://minitest//lib/minitest.rb#794 def report; end # An +Array+ of test cases that failed or were skipped. # - # source://minitest//lib/minitest.rb#693 + # source://minitest//lib/minitest.rb#733 def results; end # An +Array+ of test cases that failed or were skipped. # - # source://minitest//lib/minitest.rb#693 + # source://minitest//lib/minitest.rb#733 def results=(_arg0); end # Total number of tests that where skipped. # - # source://minitest//lib/minitest.rb#721 + # source://minitest//lib/minitest.rb#761 def skips; end # Total number of tests that where skipped. # - # source://minitest//lib/minitest.rb#721 + # source://minitest//lib/minitest.rb#761 def skips=(_arg0); end - # source://minitest//lib/minitest.rb#740 + # source://minitest//lib/minitest.rb#780 def start; end # Time the test run started. If available, the monotonic clock is # used and this is a +Float+, otherwise it's an instance of # +Time+. # - # source://minitest//lib/minitest.rb#700 + # source://minitest//lib/minitest.rb#740 def start_time; end # Time the test run started. If available, the monotonic clock is # used and this is a +Float+, otherwise it's an instance of # +Time+. # - # source://minitest//lib/minitest.rb#700 + # source://minitest//lib/minitest.rb#740 def start_time=(_arg0); end # Test run time. If available, the monotonic clock is used and # this is a +Float+, otherwise it's an instance of +Time+. # - # source://minitest//lib/minitest.rb#706 + # source://minitest//lib/minitest.rb#746 def total_time; end # Test run time. If available, the monotonic clock is used and # this is a +Float+, otherwise it's an instance of +Time+. # - # source://minitest//lib/minitest.rb#706 + # source://minitest//lib/minitest.rb#746 def total_time=(_arg0); end end @@ -1213,48 +1241,48 @@ end # plugin, pull this out of the composite and replace it with your # own. # -# source://minitest//lib/minitest.rb#774 +# source://minitest//lib/minitest.rb#814 class Minitest::SummaryReporter < ::Minitest::StatisticsReporter - # source://minitest//lib/minitest.rb#809 + # source://minitest//lib/minitest.rb#849 def aggregated_results(io); end # Returns the value of attribute old_sync. # - # source://minitest//lib/minitest.rb#777 + # source://minitest//lib/minitest.rb#817 def old_sync; end # Sets the attribute old_sync # # @param value the value to set the attribute old_sync to. # - # source://minitest//lib/minitest.rb#777 + # source://minitest//lib/minitest.rb#817 def old_sync=(_arg0); end - # source://minitest//lib/minitest.rb#792 + # source://minitest//lib/minitest.rb#832 def report; end # :startdoc: # - # source://minitest//lib/minitest.rb#780 + # source://minitest//lib/minitest.rb#820 def start; end - # source://minitest//lib/minitest.rb#804 + # source://minitest//lib/minitest.rb#844 def statistics; end - # source://minitest//lib/minitest.rb#829 + # source://minitest//lib/minitest.rb#869 def summary; end # :stopdoc: # - # source://minitest//lib/minitest.rb#776 + # source://minitest//lib/minitest.rb#816 def sync; end # :stopdoc: # - # source://minitest//lib/minitest.rb#776 + # source://minitest//lib/minitest.rb#816 def sync=(_arg0); end - # source://minitest//lib/minitest.rb#825 + # source://minitest//lib/minitest.rb#865 def to_s; end end @@ -1276,27 +1304,27 @@ class Minitest::Test < ::Minitest::Runnable # LifecycleHooks # - # source://minitest//lib/minitest/test.rb#198 + # source://minitest//lib/minitest/test.rb#190 def capture_exceptions; end # source://minitest//lib/minitest/test.rb#15 def class_name; end - # source://minitest//lib/minitest/test.rb#215 + # source://minitest//lib/minitest/test.rb#207 def neuter_exception(e); end - # source://minitest//lib/minitest/test.rb#226 + # source://minitest//lib/minitest/test.rb#218 def new_exception(klass, msg, bt, kill = T.unsafe(nil)); end # Runs a single test with setup/teardown hooks. # - # source://minitest//lib/minitest/test.rb#94 + # source://minitest//lib/minitest/test.rb#86 def run; end - # source://minitest//lib/minitest/test.rb#208 + # source://minitest//lib/minitest/test.rb#200 def sanitize_exception(e); end - # source://minitest//lib/minitest/test.rb#240 + # source://minitest//lib/minitest/test.rb#232 def with_info_handler(&block); end class << self @@ -1340,12 +1368,6 @@ class Minitest::Test < ::Minitest::Runnable # # source://minitest//lib/minitest/test.rb#69 def runnable_methods; end - - # Defines the order to run tests (:random by default). Override - # this or use a convenience method to change it for your tests. - # - # source://minitest//lib/minitest/test.rb#87 - def test_order; end end end @@ -1353,7 +1375,7 @@ end # meant for library writers, NOT for regular test authors. See # #before_setup for an example. # -# source://minitest//lib/minitest/test.rb#121 +# source://minitest//lib/minitest/test.rb#113 module Minitest::Test::LifecycleHooks # Runs before every test, after setup. This hook is meant for # libraries to extend minitest. It is not meant to be used by @@ -1361,7 +1383,7 @@ module Minitest::Test::LifecycleHooks # # See #before_setup for an example. # - # source://minitest//lib/minitest/test.rb#171 + # source://minitest//lib/minitest/test.rb#163 def after_setup; end # Runs after every test, after teardown. This hook is meant for @@ -1370,7 +1392,7 @@ module Minitest::Test::LifecycleHooks # # See #before_setup for an example. # - # source://minitest//lib/minitest/test.rb#195 + # source://minitest//lib/minitest/test.rb#187 def after_teardown; end # Runs before every test, before setup. This hook is meant for @@ -1401,11 +1423,11 @@ module Minitest::Test::LifecycleHooks # end # end # - # class MiniTest::Test + # class Minitest::Test # include MyMinitestPlugin # end # - # source://minitest//lib/minitest/test.rb#156 + # source://minitest//lib/minitest/test.rb#148 def before_setup; end # Runs after every test, before teardown. This hook is meant for @@ -1414,19 +1436,19 @@ module Minitest::Test::LifecycleHooks # # See #before_setup for an example. # - # source://minitest//lib/minitest/test.rb#180 + # source://minitest//lib/minitest/test.rb#172 def before_teardown; end # Runs before every test. Use this to set up before each test # run. # - # source://minitest//lib/minitest/test.rb#162 + # source://minitest//lib/minitest/test.rb#154 def setup; end # Runs after every test. Use this to clean up after each test # run. # - # source://minitest//lib/minitest/test.rb#186 + # source://minitest//lib/minitest/test.rb#178 def teardown; end end @@ -1441,54 +1463,32 @@ Minitest::Test::TEARDOWN_METHODS = T.let(T.unsafe(nil), Array) # Assertion wrapping an unexpected error that was raised during a run. # -# source://minitest//lib/minitest.rb#933 +# source://minitest//lib/minitest.rb#973 class Minitest::UnexpectedError < ::Minitest::Assertion # @return [UnexpectedError] a new instance of UnexpectedError # - # source://minitest//lib/minitest.rb#937 + # source://minitest//lib/minitest.rb#977 def initialize(error); end - # source://minitest//lib/minitest.rb#942 + # source://minitest//lib/minitest.rb#982 def backtrace; end # TODO: figure out how to use `cause` instead # - # source://minitest//lib/minitest.rb#935 + # source://minitest//lib/minitest.rb#975 def error; end # TODO: figure out how to use `cause` instead # - # source://minitest//lib/minitest.rb#935 + # source://minitest//lib/minitest.rb#975 def error=(_arg0); end - # source://minitest//lib/minitest.rb#946 + # source://minitest//lib/minitest.rb#986 def message; end - # source://minitest//lib/minitest.rb#951 + # source://minitest//lib/minitest.rb#991 def result_label; end end -# source://minitest//lib/minitest/unit.rb#20 -class Minitest::Unit - class << self - # source://minitest//lib/minitest/unit.rb#36 - def after_tests(&b); end - - # source://minitest//lib/minitest/unit.rb#30 - def autorun; end - end -end - -# source://minitest//lib/minitest/unit.rb#22 -class Minitest::Unit::TestCase < ::Minitest::Test - class << self - # source://minitest//lib/minitest/unit.rb#23 - def inherited(klass); end - end -end - -# source://minitest//lib/minitest/unit.rb#21 -Minitest::Unit::VERSION = T.let(T.unsafe(nil), String) - # source://minitest//lib/minitest.rb#12 Minitest::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/mocha@2.0.4.rbi b/sorbet/rbi/gems/mocha@2.1.0.rbi similarity index 100% rename from sorbet/rbi/gems/mocha@2.0.4.rbi rename to sorbet/rbi/gems/mocha@2.1.0.rbi diff --git a/sorbet/rbi/gems/nokogiri@1.15.2.rbi b/sorbet/rbi/gems/nokogiri@1.15.2.rbi deleted file mode 100644 index 6b293e4de..000000000 --- a/sorbet/rbi/gems/nokogiri@1.15.2.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `nokogiri` gem. -# Please instead update this file by running `bin/tapioca gem nokogiri`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/racc@1.6.2.rbi b/sorbet/rbi/gems/racc@1.7.1.rbi similarity index 62% rename from sorbet/rbi/gems/racc@1.6.2.rbi rename to sorbet/rbi/gems/racc@1.7.1.rbi index e3ff20a08..d01a4f515 100644 --- a/sorbet/rbi/gems/racc@1.6.2.rbi +++ b/sorbet/rbi/gems/racc@1.7.1.rbi @@ -4,33 +4,37 @@ # This is an autogenerated file for types exported from the `racc` gem. # Please instead update this file by running `bin/tapioca gem racc`. -# source://racc//racc/parser.rb#23 +# source://racc//lib/racc/parser.rb#23 ParseError = Racc::ParseError -# source://racc//racc/info.rb#16 +# source://racc//lib/racc/info.rb#16 Racc::Copyright = T.let(T.unsafe(nil), String) +# source://racc//lib/racc/parser.rb#186 class Racc::Parser - # source://racc//racc/parser.rb#281 + # source://racc//lib/racc/parser.rb#281 def _racc_do_parse_rb(arg, in_debug); end - # source://racc//racc/parser.rb#481 + # source://racc//lib/racc/parser.rb#481 def _racc_do_reduce(arg, act); end # common # - # source://racc//racc/parser.rb#384 + # source://racc//lib/racc/parser.rb#384 def _racc_evalact(act, arg); end - # source://racc//racc/parser.rb#234 + # source://racc//lib/racc/parser.rb#234 def _racc_init_sysvars; end - # source://racc//racc/parser.rb#222 + # source://racc//lib/racc/parser.rb#222 def _racc_setup; end - # source://racc//racc/parser.rb#331 + # source://racc//lib/racc/parser.rb#331 def _racc_yyparse_rb(recv, mid, arg, c_debug); end + # source://racc//lib/racc/parser.rb#264 + def do_parse; end + # The method to fetch next token. # If you use #do_parse method, you must implement #next_token. # @@ -42,7 +46,7 @@ class Racc::Parser # # @raise [NotImplementedError] # - # source://racc//racc/parser.rb#277 + # source://racc//lib/racc/parser.rb#277 def next_token; end # This method is called when a parse error is found. @@ -62,89 +66,96 @@ class Racc::Parser # # @raise [ParseError] # - # source://racc//racc/parser.rb#537 + # source://racc//lib/racc/parser.rb#537 def on_error(t, val, vstack); end - # source://racc//racc/parser.rb#586 + # source://racc//lib/racc/parser.rb#586 def racc_accept; end - # source://racc//racc/parser.rb#591 + # source://racc//lib/racc/parser.rb#591 def racc_e_pop(state, tstack, vstack); end - # source://racc//racc/parser.rb#598 + # source://racc//lib/racc/parser.rb#598 def racc_next_state(curstate, state); end - # source://racc//racc/parser.rb#604 + # source://racc//lib/racc/parser.rb#604 def racc_print_stacks(t, v); end - # source://racc//racc/parser.rb#613 + # source://racc//lib/racc/parser.rb#613 def racc_print_states(s); end # For debugging output # - # source://racc//racc/parser.rb#560 + # source://racc//lib/racc/parser.rb#560 def racc_read_token(t, tok, val); end - # source://racc//racc/parser.rb#573 + # source://racc//lib/racc/parser.rb#573 def racc_reduce(toks, sim, tstack, vstack); end - # source://racc//racc/parser.rb#567 + # source://racc//lib/racc/parser.rb#567 def racc_shift(tok, tstack, vstack); end - # source://racc//racc/parser.rb#620 + # source://racc//lib/racc/parser.rb#620 def racc_token2str(tok); end # Convert internal ID of token symbol to the string. # - # source://racc//racc/parser.rb#626 + # source://racc//lib/racc/parser.rb#626 def token_to_str(t); end # Exit parser. # Return value is +Symbol_Value_Stack[0]+. # - # source://racc//racc/parser.rb#550 + # source://racc//lib/racc/parser.rb#550 def yyaccept; end # Leave error recovering mode. # - # source://racc//racc/parser.rb#555 + # source://racc//lib/racc/parser.rb#555 def yyerrok; end # Enter error recovering mode. # This method does not call #on_error. # - # source://racc//racc/parser.rb#544 + # source://racc//lib/racc/parser.rb#544 def yyerror; end + # source://racc//lib/racc/parser.rb#326 + def yyparse(recv, mid); end + class << self - # source://racc//racc/parser.rb#218 + # source://racc//lib/racc/parser.rb#218 def racc_runtime_type; end end end -# source://racc//racc/parser.rb#207 +# source://racc//lib/racc/parser.rb#207 Racc::Parser::Racc_Main_Parsing_Routine = T.let(T.unsafe(nil), Symbol) -# source://racc//racc/parser.rb#209 +Racc::Parser::Racc_Runtime_Core_Id_C = T.let(T.unsafe(nil), String) + +# source://racc//lib/racc/parser.rb#209 Racc::Parser::Racc_Runtime_Core_Version = T.let(T.unsafe(nil), String) -# source://racc//racc/parser.rb#189 +Racc::Parser::Racc_Runtime_Core_Version_C = T.let(T.unsafe(nil), String) + +# source://racc//lib/racc/parser.rb#189 Racc::Parser::Racc_Runtime_Core_Version_R = T.let(T.unsafe(nil), String) -# source://racc//racc/parser.rb#210 +# source://racc//lib/racc/parser.rb#210 Racc::Parser::Racc_Runtime_Type = T.let(T.unsafe(nil), String) -# source://racc//racc/parser.rb#188 +# source://racc//lib/racc/parser.rb#188 Racc::Parser::Racc_Runtime_Version = T.let(T.unsafe(nil), String) -# source://racc//racc/parser.rb#208 +# source://racc//lib/racc/parser.rb#208 Racc::Parser::Racc_YY_Parse_Method = T.let(T.unsafe(nil), Symbol) -# source://racc//racc/parser.rb#183 +# source://racc//lib/racc/parser.rb#183 Racc::Racc_No_Extensions = T.let(T.unsafe(nil), FalseClass) -# source://racc//racc/info.rb#14 +# source://racc//lib/racc/info.rb#14 Racc::VERSION = T.let(T.unsafe(nil), String) -# source://racc//racc/info.rb#15 +# source://racc//lib/racc/info.rb#15 Racc::Version = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/rack-test@2.1.0.rbi b/sorbet/rbi/gems/rack-test@2.1.0.rbi deleted file mode 100644 index 16907a294..000000000 --- a/sorbet/rbi/gems/rack-test@2.1.0.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# 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`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/rack@2.2.7.rbi b/sorbet/rbi/gems/rack@2.2.7.rbi deleted file mode 100644 index 9af5e4d29..000000000 --- a/sorbet/rbi/gems/rack@2.2.7.rbi +++ /dev/null @@ -1,5614 +0,0 @@ -# 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://rack//lib/rack/common_logger.rb#36 - def call(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 - - # 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#719 - def check_content_length(status, headers); end - - # === The Content-Type - # - # source://rack//lib/rack/lint.rb#705 - def check_content_type(status, headers); end - - # == The Environment - # - # source://rack//lib/rack/lint.rb#77 - def check_env(env); end - - # === The Error Stream - # - # source://rack//lib/rack/lint.rb#497 - def check_error(error); end - - # === The Headers - # - # source://rack//lib/rack/lint.rb#668 - 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#562 - 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#609 - 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#377 - def check_input(input); end - - # === The Status - # - # source://rack//lib/rack/lint.rb#661 - def check_status(status); end - - # source://rack//lib/rack/lint.rb#792 - def close; end - - # === The Body - # - # source://rack//lib/rack/lint.rb#745 - def each; end - - # source://rack//lib/rack/lint.rb#732 - 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#506 -class Rack::Lint::ErrorWrapper - include ::Rack::Lint::Assertion - - # @return [ErrorWrapper] a new instance of ErrorWrapper - # - # source://rack//lib/rack/lint.rb#509 - def initialize(error); end - - # * +close+ must never be called on the error stream. - # - # source://rack//lib/rack/lint.rb#531 - 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#526 - def flush; end - - # * +puts+ must be called with a single argument that responds to +to_s+. - # - # source://rack//lib/rack/lint.rb#514 - def puts(str); end - - # * +write+ must be called with a single argument that is a String. - # - # source://rack//lib/rack/lint.rb#519 - def write(str); end -end - -# source://rack//lib/rack/lint.rb#536 -class Rack::Lint::HijackWrapper - include ::Rack::Lint::Assertion - extend ::Forwardable - - # @return [HijackWrapper] a new instance of HijackWrapper - # - # source://rack//lib/rack/lint.rb#547 - 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#540 -Rack::Lint::HijackWrapper::REQUIRED_METHODS = T.let(T.unsafe(nil), Array) - -# source://rack//lib/rack/lint.rb#395 -class Rack::Lint::InputWrapper - include ::Rack::Lint::Assertion - - # @return [InputWrapper] a new instance of InputWrapper - # - # source://rack//lib/rack/lint.rb#398 - def initialize(input); end - - # * +close+ must never be called on the input stream. - # - # source://rack//lib/rack/lint.rb#491 - def close(*args); end - - # * +each+ must be called without arguments and only yield Strings. - # - # source://rack//lib/rack/lint.rb#463 - def each(*args); end - - # * +gets+ must be called without arguments and return a string, - # or +nil+ on EOF. - # - # source://rack//lib/rack/lint.rb#404 - 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#430 - 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. - # - # source://rack//lib/rack/lint.rb#478 - 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#26 - 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#38 - 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#178 - def initialize(boundary, tempfile, bufsize, query_parser); end - - # source://rack//lib/rack/multipart/parser.rb#196 - def on_read(content); end - - # source://rack//lib/rack/multipart/parser.rb#202 - def result; end - - # Returns the value of attribute state. - # - # source://rack//lib/rack/multipart/parser.rb#176 - def state; end - - private - - # source://rack//lib/rack/multipart/parser.rb#294 - def consume_boundary; end - - # source://rack//lib/rack/multipart/parser.rb#292 - def full_boundary; end - - # source://rack//lib/rack/multipart/parser.rb#304 - def get_filename(head); end - - # source://rack//lib/rack/multipart/parser.rb#240 - def handle_consume_token; end - - # source://rack//lib/rack/multipart/parser.rb#369 - def handle_empty_content!(content); end - - # source://rack//lib/rack/multipart/parser.rb#231 - def handle_fast_forward; end - - # source://rack//lib/rack/multipart/parser.rb#273 - def handle_mime_body; end - - # source://rack//lib/rack/multipart/parser.rb#250 - def handle_mime_head; end - - # source://rack//lib/rack/multipart/parser.rb#214 - def run_parser; end - - # source://rack//lib/rack/multipart/parser.rb#341 - def tag_multipart_encoding(filename, content_type, name, body); end - - class << self - # source://rack//lib/rack/multipart/parser.rb#64 - def parse(io, content_length, content_type, tmpfile, bufsize, qp); end - - # source://rack//lib/rack/multipart/parser.rb#57 - def parse_boundary(content_type); end - end -end - -# source://rack//lib/rack/multipart/parser.rb#19 -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#21 -class Rack::Multipart::Parser::BoundedIO - # @return [BoundedIO] a new instance of BoundedIO - # - # source://rack//lib/rack/multipart/parser.rb#22 - def initialize(io, content_length); end - - # source://rack//lib/rack/multipart/parser.rb#28 - def read(size, outbuf = T.unsafe(nil)); end - - # source://rack//lib/rack/multipart/parser.rb#49 - def rewind; end -end - -# source://rack//lib/rack/multipart/parser.rb#339 -Rack::Multipart::Parser::CHARSET = T.let(T.unsafe(nil), String) - -# source://rack//lib/rack/multipart/parser.rb#85 -class Rack::Multipart::Parser::Collector - include ::Enumerable - - # @return [Collector] a new instance of Collector - # - # source://rack//lib/rack/multipart/parser.rb#121 - def initialize(tempfile); end - - # source://rack//lib/rack/multipart/parser.rb#127 - def each; end - - # source://rack//lib/rack/multipart/parser.rb#147 - def on_mime_body(mime_index, content); end - - # source://rack//lib/rack/multipart/parser.rb#151 - def on_mime_finish(mime_index); end - - # source://rack//lib/rack/multipart/parser.rb#131 - def on_mime_head(mime_index, head, filename, content_type, name); end - - private - - # source://rack//lib/rack/multipart/parser.rb#156 - def check_part_limits; end -end - -# source://rack//lib/rack/multipart/parser.rb#109 -class Rack::Multipart::Parser::Collector::BufferPart < ::Rack::Multipart::Parser::Collector::MimePart - # source://rack//lib/rack/multipart/parser.rb#111 - def close; end - - # @return [Boolean] - # - # source://rack//lib/rack/multipart/parser.rb#110 - def file?; end -end - -# source://rack//lib/rack/multipart/parser.rb#86 -class Rack::Multipart::Parser::Collector::MimePart < ::Struct - # @yield [data] - # - # source://rack//lib/rack/multipart/parser.rb#87 - def get_data; end -end - -# source://rack//lib/rack/multipart/parser.rb#114 -class Rack::Multipart::Parser::Collector::TempfilePart < ::Rack::Multipart::Parser::Collector::MimePart - # source://rack//lib/rack/multipart/parser.rb#116 - def close; end - - # @return [Boolean] - # - # source://rack//lib/rack/multipart/parser.rb#115 - def file?; end -end - -# source://rack//lib/rack/multipart/parser.rb#55 -Rack::Multipart::Parser::EMPTY = T.let(T.unsafe(nil), Rack::Multipart::Parser::MultipartInfo) - -# source://rack//lib/rack/multipart/parser.rb#54 -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.34/lib/yard/server/rack_adapter.rb#94 - def version_supplied; end - - # source://yard/0.9.34/lib/yard/server/rack_adapter.rb#94 - def version_supplied=(_arg0); end - - # source://yard/0.9.34/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#49 -class Rack::Session::Cookie < ::Rack::Session::Abstract::PersistedSecure - # @return [Cookie] a new instance of Cookie - # - # source://rack//lib/rack/session/cookie.rb#107 - def initialize(app, options = T.unsafe(nil)); end - - # Returns the value of attribute coder. - # - # source://rack//lib/rack/session/cookie.rb#105 - def coder; end - - private - - # source://rack//lib/rack/session/cookie.rb#180 - def delete_session(req, session_id, options); end - - # @return [Boolean] - # - # source://rack//lib/rack/session/cookie.rb#185 - def digest_match?(data, digest); end - - # source://rack//lib/rack/session/cookie.rb#132 - def extract_session_id(request); end - - # source://rack//lib/rack/session/cookie.rb#126 - def find_session(req, sid); end - - # source://rack//lib/rack/session/cookie.rb#192 - def generate_hmac(data, secret); end - - # source://rack//lib/rack/session/cookie.rb#149 - def persistent_session_id!(data, sid = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rack//lib/rack/session/cookie.rb#196 - def secure?(options); end - - # source://rack//lib/rack/session/cookie.rb#136 - def unpacked_cookie_data(request); end - - # source://rack//lib/rack/session/cookie.rb#164 - def write_session(req, session_id, session, options); end -end - -# Encode session cookies as Base64 -# -# source://rack//lib/rack/session/cookie.rb#51 -class Rack::Session::Cookie::Base64 - # source://rack//lib/rack/session/cookie.rb#56 - def decode(str); end - - # source://rack//lib/rack/session/cookie.rb#52 - 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#74 -class Rack::Session::Cookie::Base64::JSON < ::Rack::Session::Cookie::Base64 - # source://rack//lib/rack/session/cookie.rb#79 - def decode(str); end - - # source://rack//lib/rack/session/cookie.rb#75 - def encode(obj); end -end - -# Encode session cookies as Marshaled Base64 data -# -# source://rack//lib/rack/session/cookie.rb#61 -class Rack::Session::Cookie::Base64::Marshal < ::Rack::Session::Cookie::Base64 - # source://rack//lib/rack/session/cookie.rb#66 - def decode(str); end - - # source://rack//lib/rack/session/cookie.rb#62 - def encode(str); end -end - -# source://rack//lib/rack/session/cookie.rb#85 -class Rack::Session::Cookie::Base64::ZipJSON < ::Rack::Session::Cookie::Base64 - # source://rack//lib/rack/session/cookie.rb#90 - def decode(str); end - - # source://rack//lib/rack/session/cookie.rb#86 - def encode(obj); end -end - -# Use no encoding for session cookies -# -# source://rack//lib/rack/session/cookie.rb#100 -class Rack::Session::Cookie::Identity - # source://rack//lib/rack/session/cookie.rb#102 - def decode(str); end - - # source://rack//lib/rack/session/cookie.rb#101 - def encode(str); end -end - -# source://rack//lib/rack/session/cookie.rb#155 -class Rack::Session::Cookie::SessionId - # @return [SessionId] a new instance of SessionId - # - # source://rack//lib/rack/session/cookie.rb#158 - def initialize(session_id, cookie_value); end - - # Returns the value of attribute cookie_value. - # - # source://rack//lib/rack/session/cookie.rb#156 - 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#606 - 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#392 - 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#596 - 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#623 - 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#606 - 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#392 - 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#596 - 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#623 - 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#407 -class Rack::Utils::Context - # @return [Context] a new instance of Context - # - # source://rack//lib/rack/utils.rb#410 - def initialize(app_f, app_r); end - - # Returns the value of attribute app. - # - # source://rack//lib/rack/utils.rb#408 - def app; end - - # source://rack//lib/rack/utils.rb#415 - def call(env); end - - # source://rack//lib/rack/utils.rb#423 - def context(env, app = T.unsafe(nil)); end - - # Returns the value of attribute for. - # - # source://rack//lib/rack/utils.rb#408 - def for; end - - # source://rack//lib/rack/utils.rb#419 - 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#523 -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#432 -class Rack::Utils::HeaderHash < ::Hash - # @api private - # @return [HeaderHash] a new instance of HeaderHash - # - # source://rack//lib/rack/utils.rb#441 - def initialize(hash = T.unsafe(nil)); end - - # @api private - # - # source://rack//lib/rack/utils.rb#471 - def [](k); end - - # @api private - # - # source://rack//lib/rack/utils.rb#475 - def []=(k, v); end - - # on clear, we need to clear @names hash - # - # @api private - # - # source://rack//lib/rack/utils.rb#454 - def clear; end - - # @api private - # - # source://rack//lib/rack/utils.rb#482 - def delete(k); end - - # @api private - # - # source://rack//lib/rack/utils.rb#459 - def each; end - - # @api private - # @return [Boolean] - # - # source://rack//lib/rack/utils.rb#488 - def has_key?(k); end - - # @api private - # @return [Boolean] - # - # source://rack//lib/rack/utils.rb#488 - def include?(k); end - - # @api private - # @return [Boolean] - # - # source://rack//lib/rack/utils.rb#488 - def key?(k); end - - # @api private - # @return [Boolean] - # - # source://rack//lib/rack/utils.rb#488 - def member?(k); end - - # @api private - # - # source://rack//lib/rack/utils.rb#501 - def merge(other); end - - # @api private - # - # source://rack//lib/rack/utils.rb#496 - def merge!(other); end - - # @api private - # - # source://rack//lib/rack/utils.rb#506 - def replace(other); end - - # @api private - # - # source://rack//lib/rack/utils.rb#465 - def to_hash; end - - protected - - # @api private - # - # source://rack//lib/rack/utils.rb#513 - def names; end - - private - - # on dup/clone, we need to duplicate @names hash - # - # @api private - # - # source://rack//lib/rack/utils.rb#448 - def initialize_copy(other); end - - class << self - # @api private - # - # source://rack//lib/rack/utils.rb#433 - 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#621 -Rack::Utils::NULL_BYTE = T.let(T.unsafe(nil), String) - -# source://rack//lib/rack/utils.rb#604 -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#590 -Rack::Utils::STATUS_WITH_NO_ENTITY_BODY = T.let(T.unsafe(nil), Hash) - -# source://rack//lib/rack/utils.rb#592 -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/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi b/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi deleted file mode 100644 index 5510de9c2..000000000 --- a/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `rails-dom-testing` gem. -# Please instead update this file by running `bin/tapioca gem rails-dom-testing`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/rails-html-sanitizer@1.6.0.rbi b/sorbet/rbi/gems/rails-html-sanitizer@1.6.0.rbi deleted file mode 100644 index 75b177163..000000000 --- a/sorbet/rbi/gems/rails-html-sanitizer@1.6.0.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `rails-html-sanitizer` gem. -# Please instead update this file by running `bin/tapioca gem rails-html-sanitizer`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/railties@7.0.5.rbi b/sorbet/rbi/gems/railties@7.0.5.rbi deleted file mode 100644 index 5ccc04d4b..000000000 --- a/sorbet/rbi/gems/railties@7.0.5.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `railties` gem. -# Please instead update this file by running `bin/tapioca gem railties`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/rbi@0.0.16.rbi b/sorbet/rbi/gems/rbi@0.0.17.rbi similarity index 74% rename from sorbet/rbi/gems/rbi@0.0.16.rbi rename to sorbet/rbi/gems/rbi@0.0.17.rbi index ec4c7b201..5b17afade 100644 --- a/sorbet/rbi/gems/rbi@0.0.16.rbi +++ b/sorbet/rbi/gems/rbi@0.0.17.rbi @@ -4,60 +4,55 @@ # 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 +# source://rbi//lib/rbi/loc.rb#4 module RBI; end # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # -# source://rbi//lib/rbi/parser.rb#129 +# source://rbi//lib/rbi/parser.rb#133 class RBI::ASTVisitor abstract! # @abstract # - # source://rbi//lib/rbi/parser.rb#141 + # source://rbi//lib/rbi/parser.rb#145 sig { abstract.params(node: T.nilable(::AST::Node)).void } def visit(node); end - # source://rbi//lib/rbi/parser.rb#136 + # source://rbi//lib/rbi/parser.rb#140 sig { params(nodes: T::Array[::AST::Node]).void } def visit_all(nodes); end private - # source://rbi//lib/rbi/parser.rb#151 + # source://rbi//lib/rbi/parser.rb#155 sig { params(node: ::AST::Node).returns(::String) } def parse_expr(node); end - # source://rbi//lib/rbi/parser.rb#146 + # source://rbi//lib/rbi/parser.rb#150 sig { params(node: ::AST::Node).returns(::String) } def parse_name(node); end - - class << self - # source://sorbet-runtime/0.5.10875/lib/types/private/abstract/declare.rb#37 - def new(*args, **_arg1, &blk); end - end end -# source://rbi//lib/rbi/model.rb#960 +# source://rbi//lib/rbi/model.rb#968 class RBI::Arg < ::RBI::Node - # source://rbi//lib/rbi/model.rb#972 + # source://rbi//lib/rbi/model.rb#980 sig { params(value: ::String, loc: T.nilable(::RBI::Loc)).void } def initialize(value, loc: T.unsafe(nil)); end - # source://rbi//lib/rbi/model.rb#978 + # source://rbi//lib/rbi/model.rb#986 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/printer.rb#611 + # source://rbi//lib/rbi/printer.rb#613 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/model.rb#983 + # source://rbi//lib/rbi/model.rb#991 sig { returns(::String) } def to_s; end - # source://rbi//lib/rbi/model.rb#964 + # source://rbi//lib/rbi/model.rb#972 sig { returns(::String) } def value; end end @@ -66,13 +61,13 @@ end # # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # -# source://rbi//lib/rbi/model.rb#341 +# source://rbi//lib/rbi/model.rb#349 class RBI::Attr < ::RBI::NodeWithComments include ::RBI::Indexable abstract! - # source://rbi//lib/rbi/model.rb#366 + # source://rbi//lib/rbi/model.rb#374 sig do params( name: ::Symbol, @@ -85,63 +80,58 @@ class RBI::Attr < ::RBI::NodeWithComments 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/printer.rb#346 + # source://rbi//lib/rbi/printer.rb#348 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#406 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#412 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end # @abstract # - # source://rbi//lib/rbi/model.rb#374 + # source://rbi//lib/rbi/model.rb#382 sig { abstract.returns(T::Array[::String]) } def fully_qualified_names; end - # source://rbi//lib/rbi/index.rb#109 + # 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#413 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#420 sig { override.params(other: ::RBI::Node).void } def merge_with(other); end - # source://rbi//lib/rbi/model.rb#348 + # source://rbi//lib/rbi/model.rb#356 sig { returns(T::Array[::Symbol]) } def names; end # @return [Array] # - # source://rbi//lib/rbi/model.rb#348 + # source://rbi//lib/rbi/model.rb#356 def names=(_arg0); end - # source://rbi//lib/rbi/printer.rb#373 + # source://rbi//lib/rbi/printer.rb#375 sig { override.returns(T::Boolean) } def oneline?; end - # source://rbi//lib/rbi/model.rb#354 + # source://rbi//lib/rbi/model.rb#362 sig { returns(T::Array[::RBI::Sig]) } def sigs; end - # source://rbi//lib/rbi/model.rb#351 + # source://rbi//lib/rbi/model.rb#359 sig { returns(::RBI::Visibility) } def visibility; end # @return [Visibility] # - # source://rbi//lib/rbi/model.rb#351 + # source://rbi//lib/rbi/model.rb#359 def visibility=(_arg0); end - - class << self - # source://sorbet-runtime/0.5.10875/lib/types/private/abstract/declare.rb#37 - def new(*args, **_arg1, &blk); end - end end -# source://rbi//lib/rbi/model.rb#377 +# source://rbi//lib/rbi/model.rb#385 class RBI::AttrAccessor < ::RBI::Attr - # source://rbi//lib/rbi/model.rb#391 + # source://rbi//lib/rbi/model.rb#399 sig do params( name: ::Symbol, @@ -155,22 +145,22 @@ class RBI::AttrAccessor < ::RBI::Attr 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#444 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#452 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#397 + # source://rbi//lib/rbi/model.rb#405 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end - # source://rbi//lib/rbi/model.rb#403 + # source://rbi//lib/rbi/model.rb#411 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#409 +# source://rbi//lib/rbi/model.rb#417 class RBI::AttrReader < ::RBI::Attr - # source://rbi//lib/rbi/model.rb#423 + # source://rbi//lib/rbi/model.rb#431 sig do params( name: ::Symbol, @@ -184,22 +174,22 @@ class RBI::AttrReader < ::RBI::Attr 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#426 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#434 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#429 + # source://rbi//lib/rbi/model.rb#437 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end - # source://rbi//lib/rbi/model.rb#435 + # source://rbi//lib/rbi/model.rb#443 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#441 +# source://rbi//lib/rbi/model.rb#449 class RBI::AttrWriter < ::RBI::Attr - # source://rbi//lib/rbi/model.rb#455 + # source://rbi//lib/rbi/model.rb#463 sig do params( name: ::Symbol, @@ -213,35 +203,35 @@ class RBI::AttrWriter < ::RBI::Attr 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#435 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#443 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#461 + # source://rbi//lib/rbi/model.rb#469 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end - # source://rbi//lib/rbi/model.rb#467 + # source://rbi//lib/rbi/model.rb#475 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#70 +# source://rbi//lib/rbi/model.rb#74 class RBI::BlankLine < ::RBI::Comment - # source://rbi//lib/rbi/model.rb#74 + # source://rbi//lib/rbi/model.rb#78 sig { params(loc: T.nilable(::RBI::Loc)).void } def initialize(loc: T.unsafe(nil)); end - # source://rbi//lib/rbi/printer.rb#215 + # source://rbi//lib/rbi/printer.rb#217 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end end -# source://rbi//lib/rbi/model.rb#733 +# source://rbi//lib/rbi/model.rb#741 class RBI::BlockParam < ::RBI::Param - # source://rbi//lib/rbi/model.rb#744 + # source://rbi//lib/rbi/model.rb#752 sig do params( name: ::String, @@ -252,26 +242,26 @@ class RBI::BlockParam < ::RBI::Param end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#755 + # source://rbi//lib/rbi/model.rb#763 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/printer.rb#541 + # source://rbi//lib/rbi/printer.rb#543 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/printer.rb#546 + # source://rbi//lib/rbi/printer.rb#548 sig { override.params(v: ::RBI::Printer, last: T::Boolean).void } def print_comment_leading_space(v, last:); end - # source://rbi//lib/rbi/model.rb#750 + # source://rbi//lib/rbi/model.rb#758 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#213 +# source://rbi//lib/rbi/model.rb#218 class RBI::Class < ::RBI::Scope - # source://rbi//lib/rbi/model.rb#231 + # source://rbi//lib/rbi/model.rb#236 sig do params( name: ::String, @@ -283,58 +273,58 @@ class RBI::Class < ::RBI::Scope 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#370 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#376 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#239 + # source://rbi//lib/rbi/model.rb#244 sig { override.returns(::String) } def fully_qualified_name; end - # source://rbi//lib/rbi/model.rb#217 + # source://rbi//lib/rbi/model.rb#222 sig { returns(::String) } def name; end # @return [String] # - # source://rbi//lib/rbi/model.rb#217 + # source://rbi//lib/rbi/model.rb#222 def name=(_arg0); end - # source://rbi//lib/rbi/printer.rb#282 + # source://rbi//lib/rbi/printer.rb#284 sig { override.params(v: ::RBI::Printer).void } def print_header(v); end - # source://rbi//lib/rbi/model.rb#220 + # source://rbi//lib/rbi/model.rb#225 sig { returns(T.nilable(::String)) } def superclass_name; end # @return [String, nil] # - # source://rbi//lib/rbi/model.rb#220 + # source://rbi//lib/rbi/model.rb#225 def superclass_name=(_arg0); end end -# source://rbi//lib/rbi/model.rb#50 +# source://rbi//lib/rbi/model.rb#53 class RBI::Comment < ::RBI::Node - # source://rbi//lib/rbi/model.rb#57 + # source://rbi//lib/rbi/model.rb#60 sig { params(text: ::String, loc: T.nilable(::RBI::Loc)).void } def initialize(text, loc: T.unsafe(nil)); end - # source://rbi//lib/rbi/model.rb#63 + # source://rbi//lib/rbi/model.rb#66 sig { params(other: ::Object).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/printer.rb#195 + # source://rbi//lib/rbi/printer.rb#197 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/model.rb#54 + # source://rbi//lib/rbi/model.rb#57 sig { returns(::String) } def text; end # @return [String] # - # source://rbi//lib/rbi/model.rb#54 + # source://rbi//lib/rbi/model.rb#57 def text=(_arg0); end end @@ -353,33 +343,33 @@ end # end # ~~~ # -# source://rbi//lib/rbi/rewriters/merge_trees.rb#578 +# source://rbi//lib/rbi/rewriters/merge_trees.rb#589 class RBI::ConflictTree < ::RBI::Tree - # source://rbi//lib/rbi/rewriters/merge_trees.rb#585 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#596 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#596 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#607 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#582 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#593 sig { returns(::RBI::Tree) } def left; end # @return [Tree] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#582 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#593 def right; end end # Consts # -# source://rbi//lib/rbi/model.rb#305 +# source://rbi//lib/rbi/model.rb#312 class RBI::Const < ::RBI::NodeWithComments include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#320 + # source://rbi//lib/rbi/model.rb#327 sig do params( name: ::String, @@ -391,70 +381,67 @@ class RBI::Const < ::RBI::NodeWithComments end def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/printer.rb#333 + # source://rbi//lib/rbi/printer.rb#335 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#397 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#403 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#328 + # source://rbi//lib/rbi/model.rb#335 sig { returns(::String) } def fully_qualified_name; end - # source://rbi//lib/rbi/index.rb#99 + # source://rbi//lib/rbi/index.rb#103 sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#309 + # source://rbi//lib/rbi/model.rb#316 sig { returns(::String) } def name; end - # source://rbi//lib/rbi/model.rb#334 + # source://rbi//lib/rbi/model.rb#342 sig { override.returns(::String) } def to_s; end # @return [String] # - # source://rbi//lib/rbi/model.rb#309 + # source://rbi//lib/rbi/model.rb#316 def value; end end -# source://rbi//lib/rbi/parser.rb#600 +# source://rbi//lib/rbi/parser.rb#627 class RBI::ConstBuilder < ::RBI::ASTVisitor - # source://rbi//lib/rbi/parser.rb#615 + # source://rbi//lib/rbi/parser.rb#634 sig { void } def initialize; end - # source://rbi//lib/rbi/parser.rb#612 + # source://rbi//lib/rbi/parser.rb#631 sig { returns(T::Array[::String]) } def names; end # @return [Array] # - # source://rbi//lib/rbi/parser.rb#612 + # source://rbi//lib/rbi/parser.rb#631 def names=(_arg0); end - # source://rbi//lib/rbi/parser.rb#621 + # source://rbi//lib/rbi/parser.rb#653 sig { override.params(node: T.nilable(::AST::Node)).void } def visit(node); end class << self - # source://rbi//lib/rbi/parser.rb#604 + # source://rbi//lib/rbi/parser.rb#643 sig { params(node: T.nilable(::AST::Node)).returns(T.nilable(::String)) } def visit(node); end end end -# source://rbi//lib/rbi.rb#8 -class RBI::Error < ::StandardError; end - -# source://rbi//lib/rbi/model.rb#808 +# source://rbi//lib/rbi/model.rb#816 class RBI::Extend < ::RBI::Mixin include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#820 + # source://rbi//lib/rbi/model.rb#828 sig do params( name: ::String, @@ -466,22 +453,22 @@ class RBI::Extend < ::RBI::Mixin end def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#492 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#502 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/index.rb#139 + # source://rbi//lib/rbi/index.rb#143 sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#826 + # source://rbi//lib/rbi/model.rb#834 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#133 +# source://rbi//lib/rbi/model.rb#137 class RBI::File - # source://rbi//lib/rbi/model.rb#152 + # source://rbi//lib/rbi/model.rb#156 sig do params( strictness: T.nilable(::String), @@ -491,28 +478,28 @@ class RBI::File end def initialize(strictness: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#160 + # source://rbi//lib/rbi/model.rb#164 sig { params(node: ::RBI::Node).void } def <<(node); end - # source://rbi//lib/rbi/printer.rb#104 + # source://rbi//lib/rbi/printer.rb#105 sig { params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/model.rb#143 + # source://rbi//lib/rbi/model.rb#147 sig { returns(T::Array[::RBI::Comment]) } def comments; end # @return [Array] # - # source://rbi//lib/rbi/model.rb#143 + # source://rbi//lib/rbi/model.rb#147 def comments=(_arg0); end - # source://rbi//lib/rbi/model.rb#165 + # source://rbi//lib/rbi/model.rb#169 sig { returns(T::Boolean) } def empty?; end - # source://rbi//lib/rbi/printer.rb#128 + # source://rbi//lib/rbi/printer.rb#129 sig do params( out: T.any(::IO, ::StringIO), @@ -523,32 +510,32 @@ class RBI::File 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#137 + # source://rbi//lib/rbi/model.rb#141 sig { returns(::RBI::Tree) } def root; end # @return [Tree] # - # source://rbi//lib/rbi/model.rb#137 + # source://rbi//lib/rbi/model.rb#141 def root=(_arg0); end - # source://rbi//lib/rbi/model.rb#140 + # source://rbi//lib/rbi/model.rb#144 sig { returns(T.nilable(::String)) } def strictness; end # @return [String, nil] # - # source://rbi//lib/rbi/model.rb#140 + # source://rbi//lib/rbi/model.rb#144 def strictness=(_arg0); end - # source://rbi//lib/rbi/printer.rb#134 + # source://rbi//lib/rbi/printer.rb#135 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 + # source://rbi//lib/rbi/formatter.rb#36 sig do params( add_sig_templates: T::Boolean, @@ -561,79 +548,46 @@ class RBI::Formatter 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#9 - sig { returns(T::Boolean) } - def add_sig_templates; end + # source://rbi//lib/rbi/formatter.rb#15 + sig { params(add_sig_templates: T::Boolean).returns(T::Boolean) } + def add_sig_templates=(add_sig_templates); end - # @return [Boolean] - # - # source://rbi//lib/rbi/formatter.rb#9 - def add_sig_templates=(_arg0); end - - # source://rbi//lib/rbi/formatter.rb#53 + # source://rbi//lib/rbi/formatter.rb#59 sig { params(file: ::RBI::File).void } def format_file(file); end - # source://rbi//lib/rbi/formatter.rb#58 + # source://rbi//lib/rbi/formatter.rb#64 sig { params(tree: ::RBI::Tree).void } def format_tree(tree); end - # @return [Boolean] - # - # source://rbi//lib/rbi/formatter.rb#9 - def group_nodes; end - - # @return [Boolean] - # - # source://rbi//lib/rbi/formatter.rb#9 - def group_nodes=(_arg0); end + # source://rbi//lib/rbi/formatter.rb#18 + sig { params(group_nodes: T::Boolean).returns(T::Boolean) } + def group_nodes=(group_nodes); end - # source://rbi//lib/rbi/formatter.rb#12 + # source://rbi//lib/rbi/formatter.rb#24 sig { returns(T.nilable(::Integer)) } def max_line_length; end # @return [Integer, nil] # - # source://rbi//lib/rbi/formatter.rb#12 + # source://rbi//lib/rbi/formatter.rb#24 def max_line_length=(_arg0); end - # @return [Boolean] - # - # source://rbi//lib/rbi/formatter.rb#9 - def nest_non_public_methods; end + # source://rbi//lib/rbi/formatter.rb#21 + sig { params(nest_non_public_methods: T::Boolean).returns(T::Boolean) } + def nest_non_public_methods=(nest_non_public_methods); end - # @return [Boolean] - # - # source://rbi//lib/rbi/formatter.rb#9 - def nest_non_public_methods=(_arg0); end - - # @return [Boolean] - # - # source://rbi//lib/rbi/formatter.rb#9 - def nest_singleton_methods; end - - # @return [Boolean] - # - # source://rbi//lib/rbi/formatter.rb#9 - def nest_singleton_methods=(_arg0); end + # source://rbi//lib/rbi/formatter.rb#12 + sig { params(nest_singleton_methods: T::Boolean).returns(T::Boolean) } + def nest_singleton_methods=(nest_singleton_methods); end - # source://rbi//lib/rbi/formatter.rb#41 + # source://rbi//lib/rbi/formatter.rb#53 sig { params(file: ::RBI::File).returns(::String) } def print_file(file); end - # source://rbi//lib/rbi/formatter.rb#47 - sig { params(tree: ::RBI::Tree).returns(::String) } - def print_tree(tree); end - - # @return [Boolean] - # # source://rbi//lib/rbi/formatter.rb#9 - def sort_nodes; end - - # @return [Boolean] - # - # source://rbi//lib/rbi/formatter.rb#9 - def sort_nodes=(_arg0); end + sig { params(sort_nodes: T::Boolean).returns(T::Boolean) } + def sort_nodes=(sort_nodes); end end # source://rbi//lib/rbi/rewriters/group_nodes.rb#88 @@ -642,7 +596,7 @@ class RBI::Group < ::RBI::Tree sig { params(kind: ::RBI::Group::Kind).void } def initialize(kind); end - # source://rbi//lib/rbi/printer.rb#836 + # source://rbi//lib/rbi/printer.rb#838 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end @@ -672,11 +626,11 @@ end # Sorbet's misc. # -# source://rbi//lib/rbi/model.rb#1285 +# source://rbi//lib/rbi/model.rb#1294 class RBI::Helper < ::RBI::NodeWithComments include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#1299 + # source://rbi//lib/rbi/model.rb#1308 sig do params( name: ::String, @@ -687,32 +641,32 @@ class RBI::Helper < ::RBI::NodeWithComments end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/printer.rb#823 + # source://rbi//lib/rbi/printer.rb#825 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#510 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#520 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/index.rb#169 + # source://rbi//lib/rbi/index.rb#173 sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#1289 + # source://rbi//lib/rbi/model.rb#1298 sig { returns(::String) } def name; end - # source://rbi//lib/rbi/model.rb#1306 + # source://rbi//lib/rbi/model.rb#1315 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#785 +# source://rbi//lib/rbi/model.rb#793 class RBI::Include < ::RBI::Mixin include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#797 + # source://rbi//lib/rbi/model.rb#805 sig do params( name: ::String, @@ -724,49 +678,49 @@ class RBI::Include < ::RBI::Mixin end def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#483 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#493 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/index.rb#129 + # source://rbi//lib/rbi/index.rb#133 sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#803 + # source://rbi//lib/rbi/model.rb#811 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#17 + # source://rbi//lib/rbi/index.rb#21 sig { void } def initialize; end - # source://rbi//lib/rbi/index.rb#28 + # 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#33 + # source://rbi//lib/rbi/index.rb#37 sig { params(nodes: ::RBI::Node).void } def index(*nodes); end - # source://rbi//lib/rbi/index.rb#23 + # source://rbi//lib/rbi/index.rb#27 sig { returns(T::Array[::String]) } def keys; end - # source://rbi//lib/rbi/index.rb#38 + # 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#55 + # 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#10 + # source://rbi//lib/rbi/index.rb#13 sig { params(node: ::RBI::Node).returns(::RBI::Index) } def index(*node); end end @@ -776,7 +730,7 @@ end # # @abstract Subclasses must implement the `abstract` methods below. # -# source://rbi//lib/rbi/index.rb#70 +# source://rbi//lib/rbi/index.rb#74 module RBI::Indexable interface! @@ -787,37 +741,37 @@ module RBI::Indexable # # @abstract # - # source://rbi//lib/rbi/index.rb#81 + # source://rbi//lib/rbi/index.rb#85 sig { abstract.returns(T::Array[::String]) } def index_ids; end end -# source://rbi//lib/rbi/model.rb#988 +# source://rbi//lib/rbi/model.rb#996 class RBI::KwArg < ::RBI::Arg - # source://rbi//lib/rbi/model.rb#1001 + # source://rbi//lib/rbi/model.rb#1009 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#1007 + # source://rbi//lib/rbi/model.rb#1015 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/printer.rb#620 + # source://rbi//lib/rbi/printer.rb#622 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/model.rb#992 + # source://rbi//lib/rbi/model.rb#1000 sig { returns(::String) } def keyword; end - # source://rbi//lib/rbi/model.rb#1012 + # source://rbi//lib/rbi/model.rb#1020 sig { returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#674 +# source://rbi//lib/rbi/model.rb#682 class RBI::KwOptParam < ::RBI::Param - # source://rbi//lib/rbi/model.rb#689 + # source://rbi//lib/rbi/model.rb#697 sig do params( name: ::String, @@ -829,30 +783,30 @@ class RBI::KwOptParam < ::RBI::Param end def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#701 + # source://rbi//lib/rbi/model.rb#709 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/printer.rb#511 + # source://rbi//lib/rbi/printer.rb#513 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/printer.rb#516 + # source://rbi//lib/rbi/printer.rb#518 sig { override.params(v: ::RBI::Printer, last: T::Boolean).void } def print_comment_leading_space(v, last:); end - # source://rbi//lib/rbi/model.rb#696 + # source://rbi//lib/rbi/model.rb#704 sig { override.returns(::String) } def to_s; end - # source://rbi//lib/rbi/model.rb#678 + # source://rbi//lib/rbi/model.rb#686 sig { returns(::String) } def value; end end -# source://rbi//lib/rbi/model.rb#647 +# source://rbi//lib/rbi/model.rb#655 class RBI::KwParam < ::RBI::Param - # source://rbi//lib/rbi/model.rb#658 + # source://rbi//lib/rbi/model.rb#666 sig do params( name: ::String, @@ -863,26 +817,26 @@ class RBI::KwParam < ::RBI::Param end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#669 + # source://rbi//lib/rbi/model.rb#677 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/printer.rb#496 + # source://rbi//lib/rbi/printer.rb#498 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/printer.rb#501 + # source://rbi//lib/rbi/printer.rb#503 sig { override.params(v: ::RBI::Printer, last: T::Boolean).void } def print_comment_leading_space(v, last:); end - # source://rbi//lib/rbi/model.rb#664 + # source://rbi//lib/rbi/model.rb#672 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#706 +# source://rbi//lib/rbi/model.rb#714 class RBI::KwRestParam < ::RBI::Param - # source://rbi//lib/rbi/model.rb#717 + # source://rbi//lib/rbi/model.rb#725 sig do params( name: ::String, @@ -893,19 +847,19 @@ class RBI::KwRestParam < ::RBI::Param end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#728 + # source://rbi//lib/rbi/model.rb#736 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/printer.rb#526 + # source://rbi//lib/rbi/printer.rb#528 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/printer.rb#531 + # source://rbi//lib/rbi/printer.rb#533 sig { override.params(v: ::RBI::Printer, last: T::Boolean).void } def print_comment_leading_space(v, last:); end - # source://rbi//lib/rbi/model.rb#723 + # source://rbi//lib/rbi/model.rb#731 sig { override.returns(::String) } def to_s; end end @@ -956,7 +910,7 @@ class RBI::Loc def to_s; end class << self - # source://rbi//lib/rbi/parser.rb#707 + # source://rbi//lib/rbi/parser.rb#748 sig { params(file: ::String, ast_loc: T.any(::Parser::Source::Map, ::Parser::Source::Range)).returns(::RBI::Loc) } def from_ast_loc(file, ast_loc); end end @@ -964,9 +918,9 @@ end # A tree that _might_ contain conflicts # -# source://rbi//lib/rbi/rewriters/merge_trees.rb#324 +# source://rbi//lib/rbi/rewriters/merge_trees.rb#330 class RBI::MergeTree < ::RBI::Tree - # source://rbi//lib/rbi/rewriters/merge_trees.rb#338 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#344 sig do params( loc: T.nilable(::RBI::Loc), @@ -977,18 +931,18 @@ class RBI::MergeTree < ::RBI::Tree 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#328 + # 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#475 +# source://rbi//lib/rbi/model.rb#483 class RBI::Method < ::RBI::NodeWithComments include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#505 + # source://rbi//lib/rbi/model.rb#513 sig do params( name: ::String, @@ -1003,88 +957,88 @@ class RBI::Method < ::RBI::NodeWithComments 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#525 + # source://rbi//lib/rbi/model.rb#533 sig { params(param: ::RBI::Param).void } def <<(param); end - # source://rbi//lib/rbi/printer.rb#382 + # source://rbi//lib/rbi/printer.rb#384 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#453 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#461 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#530 + # source://rbi//lib/rbi/model.rb#538 sig { returns(::String) } def fully_qualified_name; end - # source://rbi//lib/rbi/index.rb#119 + # source://rbi//lib/rbi/index.rb#123 sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/printer.rb#435 + # source://rbi//lib/rbi/printer.rb#437 sig { returns(T::Boolean) } def inline_params?; end - # source://rbi//lib/rbi/model.rb#485 + # source://rbi//lib/rbi/model.rb#493 sig { returns(T::Boolean) } def is_singleton; end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#485 + # source://rbi//lib/rbi/model.rb#493 def is_singleton=(_arg0); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#461 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#470 sig { override.params(other: ::RBI::Node).void } def merge_with(other); end - # source://rbi//lib/rbi/model.rb#479 + # source://rbi//lib/rbi/model.rb#487 sig { returns(::String) } def name; end # @return [String] # - # source://rbi//lib/rbi/model.rb#479 + # source://rbi//lib/rbi/model.rb#487 def name=(_arg0); end - # source://rbi//lib/rbi/printer.rb#430 + # source://rbi//lib/rbi/printer.rb#432 sig { override.returns(T::Boolean) } def oneline?; end - # source://rbi//lib/rbi/model.rb#482 + # source://rbi//lib/rbi/model.rb#490 sig { returns(T::Array[::RBI::Param]) } def params; end - # source://rbi//lib/rbi/model.rb#491 + # source://rbi//lib/rbi/model.rb#499 sig { returns(T::Array[::RBI::Sig]) } def sigs; end # @return [Array] # - # source://rbi//lib/rbi/model.rb#491 + # source://rbi//lib/rbi/model.rb#499 def sigs=(_arg0); end - # source://rbi//lib/rbi/model.rb#539 + # source://rbi//lib/rbi/model.rb#547 sig { override.returns(::String) } def to_s; end - # source://rbi//lib/rbi/model.rb#488 + # source://rbi//lib/rbi/model.rb#496 sig { returns(::RBI::Visibility) } def visibility; end # @return [Visibility] # - # source://rbi//lib/rbi/model.rb#488 + # source://rbi//lib/rbi/model.rb#496 def visibility=(_arg0); end end -# source://rbi//lib/rbi/model.rb#1345 +# source://rbi//lib/rbi/model.rb#1355 class RBI::MixesInClassMethods < ::RBI::Mixin include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#1357 + # source://rbi//lib/rbi/model.rb#1367 sig do params( name: ::String, @@ -1096,15 +1050,15 @@ class RBI::MixesInClassMethods < ::RBI::Mixin end def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#501 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#511 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/index.rb#149 + # source://rbi//lib/rbi/index.rb#153 sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#1363 + # source://rbi//lib/rbi/model.rb#1373 sig { override.returns(::String) } def to_s; end end @@ -1113,11 +1067,11 @@ end # # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # -# source://rbi//lib/rbi/model.rb#762 +# source://rbi//lib/rbi/model.rb#770 class RBI::Mixin < ::RBI::NodeWithComments abstract! - # source://rbi//lib/rbi/model.rb#779 + # source://rbi//lib/rbi/model.rb#787 sig do params( name: ::String, @@ -1128,32 +1082,27 @@ class RBI::Mixin < ::RBI::NodeWithComments end def initialize(name, names, loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # source://rbi//lib/rbi/printer.rb#556 + # source://rbi//lib/rbi/printer.rb#558 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#474 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#484 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#769 + # source://rbi//lib/rbi/model.rb#777 sig { returns(T::Array[::String]) } def names; end # @return [Array] # - # source://rbi//lib/rbi/model.rb#769 + # source://rbi//lib/rbi/model.rb#777 def names=(_arg0); end - - class << self - # source://sorbet-runtime/0.5.10875/lib/types/private/abstract/declare.rb#37 - def new(*args, **_arg1, &blk); end - end end -# source://rbi//lib/rbi/model.rb#186 +# source://rbi//lib/rbi/model.rb#190 class RBI::Module < ::RBI::Scope - # source://rbi//lib/rbi/model.rb#200 + # source://rbi//lib/rbi/model.rb#204 sig do params( name: ::String, @@ -1164,24 +1113,24 @@ class RBI::Module < ::RBI::Scope end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#379 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#385 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#207 + # source://rbi//lib/rbi/model.rb#211 sig { override.returns(::String) } def fully_qualified_name; end - # source://rbi//lib/rbi/model.rb#190 + # source://rbi//lib/rbi/model.rb#194 sig { returns(::String) } def name; end # @return [String] # - # source://rbi//lib/rbi/model.rb#190 + # source://rbi//lib/rbi/model.rb#194 def name=(_arg0); end - # source://rbi//lib/rbi/printer.rb#268 + # source://rbi//lib/rbi/printer.rb#270 sig { override.params(v: ::RBI::Printer).void } def print_header(v); end end @@ -1198,13 +1147,13 @@ class RBI::Node # @abstract # - # source://rbi//lib/rbi/printer.rb#145 + # source://rbi//lib/rbi/printer.rb#146 sig { abstract.params(v: ::RBI::Printer).void } def accept_printer(v); end # Can `self` and `_other` be merged into a single definition? # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#283 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#287 sig { params(_other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(_other); end @@ -1227,19 +1176,19 @@ class RBI::Node # Merge `self` and `other` into a single definition # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#289 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#293 sig { params(other: ::RBI::Node).void } def merge_with(other); end - # source://rbi//lib/rbi/printer.rb#177 + # source://rbi//lib/rbi/printer.rb#179 sig { returns(T::Boolean) } def oneline?; end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#292 + # 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#43 + # source://rbi//lib/rbi/model.rb#46 sig { returns(T.nilable(::RBI::Scope)) } def parent_scope; end @@ -1252,7 +1201,7 @@ class RBI::Node # source://rbi//lib/rbi/model.rb#12 def parent_tree=(_arg0); end - # source://rbi//lib/rbi/printer.rb#155 + # source://rbi//lib/rbi/printer.rb#156 sig do params( out: T.any(::IO, ::StringIO), @@ -1263,64 +1212,54 @@ class RBI::Node 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/printer.rb#168 + # source://rbi//lib/rbi/printer.rb#169 sig { params(v: ::RBI::Printer).void } def print_blank_line_before(v); end - # source://rbi//lib/rbi/model.rb#32 + # source://rbi//lib/rbi/model.rb#33 sig { params(node: ::RBI::Node).void } def replace(node); end - # source://rbi//lib/rbi/printer.rb#161 + # 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 - - class << self - # source://sorbet-runtime/0.5.10875/lib/types/private/abstract/declare.rb#37 - def new(*args, **_arg1, &blk); end - end end # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # -# source://rbi//lib/rbi/model.rb#79 +# source://rbi//lib/rbi/model.rb#83 class RBI::NodeWithComments < ::RBI::Node abstract! - # source://rbi//lib/rbi/model.rb#89 + # source://rbi//lib/rbi/model.rb#93 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#95 + # source://rbi//lib/rbi/model.rb#99 sig { returns(T::Array[::String]) } def annotations; end - # source://rbi//lib/rbi/model.rb#86 + # source://rbi//lib/rbi/model.rb#90 sig { returns(T::Array[::RBI::Comment]) } def comments; end # @return [Array] # - # source://rbi//lib/rbi/model.rb#86 + # source://rbi//lib/rbi/model.rb#90 def comments=(_arg0); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#306 + # 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/printer.rb#186 + # source://rbi//lib/rbi/printer.rb#188 sig { override.returns(T::Boolean) } def oneline?; end - - class << self - # source://sorbet-runtime/0.5.10875/lib/types/private/abstract/declare.rb#37 - def new(*args, **_arg1, &blk); end - end end -# source://rbi//lib/rbi/model.rb#593 +# source://rbi//lib/rbi/model.rb#601 class RBI::OptParam < ::RBI::Param - # source://rbi//lib/rbi/model.rb#608 + # source://rbi//lib/rbi/model.rb#616 sig do params( name: ::String, @@ -1332,57 +1271,52 @@ class RBI::OptParam < ::RBI::Param end def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#615 + # source://rbi//lib/rbi/model.rb#623 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/printer.rb#466 + # source://rbi//lib/rbi/printer.rb#468 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/printer.rb#471 + # source://rbi//lib/rbi/printer.rb#473 sig { override.params(v: ::RBI::Printer, last: T::Boolean).void } def print_comment_leading_space(v, last:); end - # source://rbi//lib/rbi/model.rb#597 + # source://rbi//lib/rbi/model.rb#605 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#544 +# source://rbi//lib/rbi/model.rb#552 class RBI::Param < ::RBI::NodeWithComments abstract! - # source://rbi//lib/rbi/model.rb#560 + # source://rbi//lib/rbi/model.rb#568 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/printer.rb#444 + # source://rbi//lib/rbi/printer.rb#446 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/printer.rb#457 + # source://rbi//lib/rbi/printer.rb#459 sig { returns(T::Array[::String]) } def comments_lines; end - # source://rbi//lib/rbi/model.rb#551 + # source://rbi//lib/rbi/model.rb#559 sig { returns(::String) } def name; end - # source://rbi//lib/rbi/printer.rb#449 + # source://rbi//lib/rbi/printer.rb#451 sig { params(v: ::RBI::Printer, last: T::Boolean).void } def print_comment_leading_space(v, last:); end - # source://rbi//lib/rbi/model.rb#566 + # source://rbi//lib/rbi/model.rb#574 sig { override.returns(::String) } def to_s; end - - class << self - # source://sorbet-runtime/0.5.10875/lib/types/private/abstract/declare.rb#37 - def new(*args, **_arg1, &blk); end - end end # source://rbi//lib/rbi/parser.rb#7 @@ -1402,34 +1336,34 @@ class RBI::Parser sig { void } def initialize; end - # source://rbi//lib/rbi/parser.rb#97 + # source://rbi//lib/rbi/parser.rb#101 sig { params(path: ::String).returns(::RBI::Tree) } def parse_file(path); end - # source://rbi//lib/rbi/parser.rb#86 + # source://rbi//lib/rbi/parser.rb#96 sig { params(string: ::String).returns(::RBI::Tree) } def parse_string(string); end private - # source://rbi//lib/rbi/parser.rb#104 + # source://rbi//lib/rbi/parser.rb#108 sig { params(content: ::String, file: ::String).returns(::RBI::Tree) } def parse(content, file:); end class << self - # source://rbi//lib/rbi/parser.rb#75 + # source://rbi//lib/rbi/parser.rb#78 sig { params(path: ::String).returns(::RBI::Tree) } def parse_file(path); end - # source://rbi//lib/rbi/parser.rb#80 + # source://rbi//lib/rbi/parser.rb#83 sig { params(paths: T::Array[::String]).returns(T::Array[::RBI::Tree]) } def parse_files(paths); end - # source://rbi//lib/rbi/parser.rb#70 + # source://rbi//lib/rbi/parser.rb#73 sig { params(string: ::String).returns(::RBI::Tree) } def parse_string(string); end - # source://rbi//lib/rbi/parser.rb#91 + # source://rbi//lib/rbi/parser.rb#89 sig { params(strings: T::Array[::String]).returns(T::Array[::RBI::Tree]) } def parse_strings(strings); end end @@ -1517,7 +1451,7 @@ class RBI::Printer < ::RBI::Visitor sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end - # source://rbi//lib/rbi/printer.rb#89 + # source://rbi//lib/rbi/printer.rb#90 sig { override.params(nodes: T::Array[::RBI::Node]).void } def visit_all(nodes); end @@ -1526,9 +1460,9 @@ class RBI::Printer < ::RBI::Visitor def visit_file(file); end end -# source://rbi//lib/rbi/model.rb#901 +# source://rbi//lib/rbi/model.rb#909 class RBI::Private < ::RBI::Visibility - # source://rbi//lib/rbi/model.rb#911 + # source://rbi//lib/rbi/model.rb#919 sig do params( loc: T.nilable(::RBI::Loc), @@ -1539,9 +1473,9 @@ class RBI::Private < ::RBI::Visibility def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#885 +# source://rbi//lib/rbi/model.rb#893 class RBI::Protected < ::RBI::Visibility - # source://rbi//lib/rbi/model.rb#895 + # source://rbi//lib/rbi/model.rb#903 sig do params( loc: T.nilable(::RBI::Loc), @@ -1552,9 +1486,9 @@ class RBI::Protected < ::RBI::Visibility def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#869 +# source://rbi//lib/rbi/model.rb#877 class RBI::Public < ::RBI::Visibility - # source://rbi//lib/rbi/model.rb#879 + # source://rbi//lib/rbi/model.rb#887 sig do params( loc: T.nilable(::RBI::Loc), @@ -1565,9 +1499,9 @@ class RBI::Public < ::RBI::Visibility def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#571 +# source://rbi//lib/rbi/model.rb#579 class RBI::ReqParam < ::RBI::Param - # source://rbi//lib/rbi/model.rb#582 + # source://rbi//lib/rbi/model.rb#590 sig do params( name: ::String, @@ -1578,39 +1512,39 @@ class RBI::ReqParam < ::RBI::Param end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#588 + # source://rbi//lib/rbi/model.rb#596 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end end -# source://rbi//lib/rbi/model.rb#1368 +# source://rbi//lib/rbi/model.rb#1378 class RBI::RequiresAncestor < ::RBI::NodeWithComments include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#1381 + # source://rbi//lib/rbi/model.rb#1391 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/printer.rb#868 + # source://rbi//lib/rbi/printer.rb#870 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/index.rb#159 + # source://rbi//lib/rbi/index.rb#163 sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#1372 + # source://rbi//lib/rbi/model.rb#1382 sig { returns(::String) } def name; end - # source://rbi//lib/rbi/model.rb#1387 + # source://rbi//lib/rbi/model.rb#1397 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#620 +# source://rbi//lib/rbi/model.rb#628 class RBI::RestParam < ::RBI::Param - # source://rbi//lib/rbi/model.rb#631 + # source://rbi//lib/rbi/model.rb#639 sig do params( name: ::String, @@ -1621,19 +1555,19 @@ class RBI::RestParam < ::RBI::Param end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#642 + # source://rbi//lib/rbi/model.rb#650 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/printer.rb#481 + # source://rbi//lib/rbi/printer.rb#483 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/printer.rb#486 + # source://rbi//lib/rbi/printer.rb#488 sig { override.params(v: ::RBI::Printer, last: T::Boolean).void } def print_comment_leading_space(v, last:); end - # source://rbi//lib/rbi/model.rb#637 + # source://rbi//lib/rbi/model.rb#645 sig { override.returns(::String) } def to_s; end end @@ -1682,7 +1616,7 @@ class RBI::Rewriters::Annotate < ::RBI::Visitor sig { params(node: ::RBI::NodeWithComments).void } def annotate_node(node); end - # source://rbi//lib/rbi/rewriters/annotate.rb#37 + # source://rbi//lib/rbi/rewriters/annotate.rb#38 sig { params(node: ::RBI::Node).returns(T::Boolean) } def root?(node); end end @@ -1747,20 +1681,20 @@ end # # source://rbi//lib/rbi/rewriters/merge_trees.rb#39 class RBI::Rewriters::Merge - # source://rbi//lib/rbi/rewriters/merge_trees.rb#66 + # 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#75 + # 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#63 + # 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#51 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#54 sig do params( left: ::RBI::Tree, @@ -1776,19 +1710,19 @@ end # Used for logging / error displaying purpose # -# source://rbi//lib/rbi/rewriters/merge_trees.rb#82 +# 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#91 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#95 sig { returns(::String) } def to_s; end class << self - # source://sorbet-runtime/0.5.10875/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.10978/lib/types/struct.rb#13 def inherited(s); end end end @@ -1824,19 +1758,19 @@ end # end # ~~~ # -# source://rbi//lib/rbi/rewriters/merge_trees.rb#241 +# source://rbi//lib/rbi/rewriters/merge_trees.rb#245 class RBI::Rewriters::Merge::ConflictTreeMerger < ::RBI::Visitor - # source://rbi//lib/rbi/rewriters/merge_trees.rb#243 + # 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#248 + # 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#269 + # 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 @@ -1850,9 +1784,9 @@ class RBI::Rewriters::Merge::Keep < ::T::Enum end end -# source://rbi//lib/rbi/rewriters/merge_trees.rb#96 +# source://rbi//lib/rbi/rewriters/merge_trees.rb#100 class RBI::Rewriters::Merge::TreeMerger < ::RBI::Visitor - # source://rbi//lib/rbi/rewriters/merge_trees.rb#103 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#107 sig do params( output: ::RBI::Tree, @@ -1863,33 +1797,33 @@ class RBI::Rewriters::Merge::TreeMerger < ::RBI::Visitor 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#100 + # 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#115 + # 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#164 + # 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#181 + # 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#188 + # 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#169 + # 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#200 + # 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 @@ -1953,38 +1887,38 @@ end # # 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#67 + # 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#64 + # 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#79 + # 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#74 + # 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#107 + # 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#125 + # 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#98 + # 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#57 + # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#70 sig do params( tree: ::RBI::Tree, @@ -1995,17 +1929,17 @@ class RBI::Rewriters::RemoveKnownDefinitions < ::RBI::Visitor end end -# source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#130 +# 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#137 + # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#141 sig { returns(::String) } def to_s; end class << self - # source://sorbet-runtime/0.5.10875/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.10978/lib/types/struct.rb#13 def inherited(s); end end end @@ -2018,19 +1952,19 @@ class RBI::Rewriters::SortNodes < ::RBI::Visitor private - # source://rbi//lib/rbi/rewriters/sort_nodes.rb#61 + # 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#82 + # 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#33 + # 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#94 + # source://rbi//lib/rbi/rewriters/sort_nodes.rb#106 sig { params(node: ::RBI::Node).void } def sort_node_names!(node); end end @@ -2039,50 +1973,45 @@ end # # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # -# source://rbi//lib/rbi/model.rb#172 +# source://rbi//lib/rbi/model.rb#176 class RBI::Scope < ::RBI::Tree include ::RBI::Indexable abstract! - # source://rbi//lib/rbi/printer.rb#240 + # source://rbi//lib/rbi/printer.rb#242 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end # Duplicate `self` scope without its body # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#350 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#356 sig { returns(T.self_type) } def dup_empty; end # @abstract # - # source://rbi//lib/rbi/model.rb#178 + # source://rbi//lib/rbi/model.rb#182 sig { abstract.returns(::String) } def fully_qualified_name; end - # source://rbi//lib/rbi/index.rb#89 + # source://rbi//lib/rbi/index.rb#93 sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/printer.rb#254 + # source://rbi//lib/rbi/printer.rb#256 sig { params(v: ::RBI::Printer).void } def print_body(v); end # @abstract # - # source://rbi//lib/rbi/printer.rb#251 + # source://rbi//lib/rbi/printer.rb#253 sig { abstract.params(v: ::RBI::Printer).void } def print_header(v); end - # source://rbi//lib/rbi/model.rb#181 + # source://rbi//lib/rbi/model.rb#185 sig { override.returns(::String) } def to_s; end - - class << self - # source://sorbet-runtime/0.5.10875/lib/types/private/abstract/declare.rb#37 - def new(*args, **_arg1, &blk); end - end end # A conflict between two scope headers @@ -2098,37 +2027,37 @@ end # end # ~~~ # -# source://rbi//lib/rbi/rewriters/merge_trees.rb#617 +# source://rbi//lib/rbi/rewriters/merge_trees.rb#628 class RBI::ScopeConflict < ::RBI::Tree - # source://rbi//lib/rbi/rewriters/merge_trees.rb#631 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#642 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#640 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#651 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#621 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#632 sig { returns(::RBI::Scope) } def left; end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#656 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#667 sig { override.returns(T::Boolean) } def oneline?; end # @return [Scope] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#621 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#632 def right; end end # Sends # -# source://rbi//lib/rbi/model.rb#919 +# source://rbi//lib/rbi/model.rb#927 class RBI::Send < ::RBI::NodeWithComments include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#937 + # source://rbi//lib/rbi/model.rb#945 sig do params( method: ::String, @@ -2140,44 +2069,44 @@ class RBI::Send < ::RBI::NodeWithComments end def initialize(method, args = T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#945 + # source://rbi//lib/rbi/model.rb#953 sig { params(arg: ::RBI::Arg).void } def <<(arg); end - # source://rbi//lib/rbi/model.rb#950 + # source://rbi//lib/rbi/model.rb#958 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/printer.rb#590 + # source://rbi//lib/rbi/printer.rb#592 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/model.rb#926 + # source://rbi//lib/rbi/model.rb#934 sig { returns(T::Array[::RBI::Arg]) } def args; end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#519 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#529 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/index.rb#179 + # source://rbi//lib/rbi/index.rb#193 sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#923 + # source://rbi//lib/rbi/model.rb#931 sig { returns(::String) } def method; end - # source://rbi//lib/rbi/model.rb#955 + # source://rbi//lib/rbi/model.rb#963 sig { returns(::String) } def to_s; end end # Sorbet's sigs # -# source://rbi//lib/rbi/model.rb#1019 +# source://rbi//lib/rbi/model.rb#1027 class RBI::Sig < ::RBI::Node - # source://rbi//lib/rbi/model.rb#1051 + # source://rbi//lib/rbi/model.rb#1059 sig do params( params: T::Array[::RBI::SigParam], @@ -2194,139 +2123,134 @@ class RBI::Sig < ::RBI::Node 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#1076 + # source://rbi//lib/rbi/model.rb#1084 sig { params(param: ::RBI::SigParam).void } def <<(param); end - # source://rbi//lib/rbi/model.rb#1081 + # source://rbi//lib/rbi/model.rb#1089 sig { params(other: ::Object).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/printer.rb#631 + # source://rbi//lib/rbi/printer.rb#633 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/model.rb#1035 + # source://rbi//lib/rbi/model.rb#1043 sig { returns(T.nilable(::Symbol)) } def checked; end # @return [Symbol, nil] # - # source://rbi//lib/rbi/model.rb#1035 + # source://rbi//lib/rbi/model.rb#1043 def checked=(_arg0); end - # source://rbi//lib/rbi/printer.rb#654 + # source://rbi//lib/rbi/printer.rb#656 sig { returns(T::Boolean) } def inline_params?; end - # source://rbi//lib/rbi/model.rb#1029 + # source://rbi//lib/rbi/model.rb#1037 sig { returns(T::Boolean) } def is_abstract; end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1029 + # source://rbi//lib/rbi/model.rb#1037 def is_abstract=(_arg0); end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1029 + # source://rbi//lib/rbi/model.rb#1037 def is_final; end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1029 + # source://rbi//lib/rbi/model.rb#1037 def is_final=(_arg0); end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1029 + # source://rbi//lib/rbi/model.rb#1037 def is_overridable; end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1029 + # source://rbi//lib/rbi/model.rb#1037 def is_overridable=(_arg0); end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1029 + # source://rbi//lib/rbi/model.rb#1037 def is_override; end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1029 + # source://rbi//lib/rbi/model.rb#1037 def is_override=(_arg0); end - # source://rbi//lib/rbi/printer.rb#649 + # source://rbi//lib/rbi/printer.rb#651 sig { override.returns(T::Boolean) } def oneline?; end - # source://rbi//lib/rbi/model.rb#1023 + # source://rbi//lib/rbi/model.rb#1031 sig { returns(T::Array[::RBI::SigParam]) } def params; end - # source://rbi//lib/rbi/model.rb#1026 + # source://rbi//lib/rbi/model.rb#1034 sig { returns(T.nilable(::String)) } def return_type; end # @return [String, nil] # - # source://rbi//lib/rbi/model.rb#1026 + # source://rbi//lib/rbi/model.rb#1034 def return_type=(_arg0); end - # source://rbi//lib/rbi/model.rb#1032 + # source://rbi//lib/rbi/model.rb#1040 sig { returns(T::Array[::String]) } def type_params; end private - # source://rbi//lib/rbi/printer.rb#696 + # source://rbi//lib/rbi/printer.rb#698 sig { params(v: ::RBI::Printer).void } def print_as_block(v); end - # source://rbi//lib/rbi/printer.rb#672 + # source://rbi//lib/rbi/printer.rb#674 sig { params(v: ::RBI::Printer).void } def print_as_line(v); end - # source://rbi//lib/rbi/printer.rb#661 + # source://rbi//lib/rbi/printer.rb#663 sig { returns(T::Array[::String]) } def sig_modifiers; end end -# source://rbi//lib/rbi/parser.rb#635 +# source://rbi//lib/rbi/parser.rb#668 class RBI::SigBuilder < ::RBI::ASTVisitor - # source://rbi//lib/rbi/parser.rb#649 + # source://rbi//lib/rbi/parser.rb#675 sig { void } def initialize; end - # source://rbi//lib/rbi/parser.rb#646 + # source://rbi//lib/rbi/parser.rb#672 sig { returns(::RBI::Sig) } def current; end - # @return [Sig] - # - # source://rbi//lib/rbi/parser.rb#646 - def current=(_arg0); end - - # source://rbi//lib/rbi/parser.rb#655 + # source://rbi//lib/rbi/parser.rb#692 sig { override.params(node: T.nilable(::AST::Node)).void } def visit(node); end - # source://rbi//lib/rbi/parser.rb#664 + # source://rbi//lib/rbi/parser.rb#702 sig { params(node: ::AST::Node).void } def visit_send(node); end class << self - # source://rbi//lib/rbi/parser.rb#639 + # source://rbi//lib/rbi/parser.rb#684 sig { params(node: ::AST::Node).returns(::RBI::Sig) } def build(node); end end end -# source://rbi//lib/rbi/model.rb#1089 +# source://rbi//lib/rbi/model.rb#1098 class RBI::SigParam < ::RBI::NodeWithComments - # source://rbi//lib/rbi/model.rb#1104 + # source://rbi//lib/rbi/model.rb#1113 sig do params( name: ::String, @@ -2338,35 +2262,35 @@ class RBI::SigParam < ::RBI::NodeWithComments end def initialize(name, type, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#1112 + # source://rbi//lib/rbi/model.rb#1121 sig { params(other: ::Object).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/printer.rb#749 + # source://rbi//lib/rbi/printer.rb#751 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/printer.rb#762 + # source://rbi//lib/rbi/printer.rb#764 sig { returns(T::Array[::String]) } def comments_lines; end - # source://rbi//lib/rbi/model.rb#1093 + # source://rbi//lib/rbi/model.rb#1102 sig { returns(::String) } def name; end - # source://rbi//lib/rbi/printer.rb#754 + # source://rbi//lib/rbi/printer.rb#756 sig { params(v: ::RBI::Printer, last: T::Boolean).void } def print_comment_leading_space(v, last:); end # @return [String] # - # source://rbi//lib/rbi/model.rb#1093 + # source://rbi//lib/rbi/model.rb#1102 def type; end end -# source://rbi//lib/rbi/model.rb#245 +# source://rbi//lib/rbi/model.rb#251 class RBI::SingletonClass < ::RBI::Scope - # source://rbi//lib/rbi/model.rb#255 + # source://rbi//lib/rbi/model.rb#261 sig do params( loc: T.nilable(::RBI::Loc), @@ -2376,18 +2300,18 @@ class RBI::SingletonClass < ::RBI::Scope end def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#261 + # source://rbi//lib/rbi/model.rb#267 sig { override.returns(::String) } def fully_qualified_name; end - # source://rbi//lib/rbi/printer.rb#319 + # source://rbi//lib/rbi/printer.rb#321 sig { override.params(v: ::RBI::Printer).void } def print_header(v); end end -# source://rbi//lib/rbi/model.rb#266 +# source://rbi//lib/rbi/model.rb#272 class RBI::Struct < ::RBI::Scope - # source://rbi//lib/rbi/model.rb#288 + # source://rbi//lib/rbi/model.rb#294 sig do params( name: ::String, @@ -2400,51 +2324,51 @@ class RBI::Struct < ::RBI::Scope 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#388 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#394 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#297 + # source://rbi//lib/rbi/model.rb#303 sig { override.returns(::String) } def fully_qualified_name; end - # source://rbi//lib/rbi/model.rb#276 + # source://rbi//lib/rbi/model.rb#282 sig { returns(T::Boolean) } def keyword_init; end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#276 + # source://rbi//lib/rbi/model.rb#282 def keyword_init=(_arg0); end - # source://rbi//lib/rbi/model.rb#273 + # source://rbi//lib/rbi/model.rb#279 sig { returns(T::Array[::Symbol]) } def members; end # @return [Array] # - # source://rbi//lib/rbi/model.rb#273 + # source://rbi//lib/rbi/model.rb#279 def members=(_arg0); end - # source://rbi//lib/rbi/model.rb#270 + # source://rbi//lib/rbi/model.rb#276 sig { returns(::String) } def name; end # @return [String] # - # source://rbi//lib/rbi/model.rb#270 + # source://rbi//lib/rbi/model.rb#276 def name=(_arg0); end - # source://rbi//lib/rbi/printer.rb#298 + # source://rbi//lib/rbi/printer.rb#300 sig { override.params(v: ::RBI::Printer).void } def print_header(v); end end # Sorbet's T::Enum # -# source://rbi//lib/rbi/model.rb#1230 +# source://rbi//lib/rbi/model.rb#1239 class RBI::TEnum < ::RBI::Class - # source://rbi//lib/rbi/model.rb#1241 + # source://rbi//lib/rbi/model.rb#1250 sig do params( name: ::String, @@ -2456,11 +2380,11 @@ class RBI::TEnum < ::RBI::Class def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#1247 +# source://rbi//lib/rbi/model.rb#1256 class RBI::TEnumBlock < ::RBI::NodeWithComments include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#1261 + # source://rbi//lib/rbi/model.rb#1270 sig do params( names: T::Array[::String], @@ -2471,40 +2395,40 @@ class RBI::TEnumBlock < ::RBI::NodeWithComments end def initialize(names = T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#1273 + # source://rbi//lib/rbi/model.rb#1282 sig { params(name: ::String).void } def <<(name); end - # source://rbi//lib/rbi/printer.rb#793 + # source://rbi//lib/rbi/printer.rb#795 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/model.rb#1268 + # source://rbi//lib/rbi/model.rb#1277 sig { returns(T::Boolean) } def empty?; end - # source://rbi//lib/rbi/index.rb#209 + # 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#546 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#556 sig { override.params(other: ::RBI::Node).void } def merge_with(other); end - # source://rbi//lib/rbi/model.rb#1251 + # source://rbi//lib/rbi/model.rb#1260 sig { returns(T::Array[::String]) } def names; end - # source://rbi//lib/rbi/model.rb#1278 + # source://rbi//lib/rbi/model.rb#1287 sig { override.returns(::String) } def to_s; end end # Sorbet's T::Struct # -# source://rbi//lib/rbi/model.rb#1119 +# source://rbi//lib/rbi/model.rb#1128 class RBI::TStruct < ::RBI::Class - # source://rbi//lib/rbi/model.rb#1130 + # source://rbi//lib/rbi/model.rb#1139 sig do params( name: ::String, @@ -2516,11 +2440,11 @@ class RBI::TStruct < ::RBI::Class def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#1168 +# source://rbi//lib/rbi/model.rb#1177 class RBI::TStructConst < ::RBI::TStructField include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#1181 + # source://rbi//lib/rbi/model.rb#1190 sig do params( name: ::String, @@ -2533,30 +2457,30 @@ class RBI::TStructConst < ::RBI::TStructField 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#537 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#547 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#1187 + # source://rbi//lib/rbi/model.rb#1196 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end - # source://rbi//lib/rbi/index.rb#189 + # source://rbi//lib/rbi/index.rb#203 sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#1193 + # source://rbi//lib/rbi/model.rb#1202 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#1136 +# source://rbi//lib/rbi/model.rb#1145 class RBI::TStructField < ::RBI::NodeWithComments abstract! - # source://rbi//lib/rbi/model.rb#1157 + # source://rbi//lib/rbi/model.rb#1166 sig do params( name: ::String, @@ -2568,59 +2492,54 @@ class RBI::TStructField < ::RBI::NodeWithComments end def initialize(name, type, default: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # source://rbi//lib/rbi/printer.rb#771 + # source://rbi//lib/rbi/printer.rb#773 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#528 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#538 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#1146 + # source://rbi//lib/rbi/model.rb#1155 sig { returns(T.nilable(::String)) } def default; end # @return [String, nil] # - # source://rbi//lib/rbi/model.rb#1146 + # source://rbi//lib/rbi/model.rb#1155 def default=(_arg0); end # @abstract # - # source://rbi//lib/rbi/model.rb#1165 + # source://rbi//lib/rbi/model.rb#1174 sig { abstract.returns(T::Array[::String]) } def fully_qualified_names; end - # source://rbi//lib/rbi/model.rb#1143 + # source://rbi//lib/rbi/model.rb#1152 sig { returns(::String) } def name; end # @return [String] # - # source://rbi//lib/rbi/model.rb#1143 + # source://rbi//lib/rbi/model.rb#1152 def name=(_arg0); end # @return [String] # - # source://rbi//lib/rbi/model.rb#1143 + # source://rbi//lib/rbi/model.rb#1152 def type; end # @return [String] # - # source://rbi//lib/rbi/model.rb#1143 + # source://rbi//lib/rbi/model.rb#1152 def type=(_arg0); end - - class << self - # source://sorbet-runtime/0.5.10875/lib/types/private/abstract/declare.rb#37 - def new(*args, **_arg1, &blk); end - end end -# source://rbi//lib/rbi/model.rb#1198 +# source://rbi//lib/rbi/model.rb#1207 class RBI::TStructProp < ::RBI::TStructField include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#1211 + # source://rbi//lib/rbi/model.rb#1220 sig do params( name: ::String, @@ -2633,26 +2552,26 @@ class RBI::TStructProp < ::RBI::TStructField 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#559 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#570 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#1217 + # source://rbi//lib/rbi/model.rb#1226 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end - # source://rbi//lib/rbi/index.rb#199 + # source://rbi//lib/rbi/index.rb#213 sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#1223 + # source://rbi//lib/rbi/model.rb#1232 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#102 +# source://rbi//lib/rbi/model.rb#106 class RBI::Tree < ::RBI::NodeWithComments - # source://rbi//lib/rbi/model.rb#115 + # source://rbi//lib/rbi/model.rb#119 sig do params( loc: T.nilable(::RBI::Loc), @@ -2662,11 +2581,11 @@ class RBI::Tree < ::RBI::NodeWithComments end def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#122 + # source://rbi//lib/rbi/model.rb#126 sig { params(node: ::RBI::Node).void } def <<(node); end - # source://rbi//lib/rbi/printer.rb#224 + # source://rbi//lib/rbi/printer.rb#226 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end @@ -2674,11 +2593,11 @@ class RBI::Tree < ::RBI::NodeWithComments 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#48 + # 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.11.6/lib/tapioca/rbi_ext/model.rb#38 + # source://tapioca/0.11.8/lib/tapioca/rbi_ext/model.rb#38 sig do params( name: ::String, @@ -2688,19 +2607,19 @@ class RBI::Tree < ::RBI::NodeWithComments end def create_class(name, superclass_name: T.unsafe(nil), &block); end - # source://tapioca/0.11.6/lib/tapioca/rbi_ext/model.rb#45 + # source://tapioca/0.11.8/lib/tapioca/rbi_ext/model.rb#45 sig { params(name: ::String, value: ::String).void } def create_constant(name, value:); end - # source://tapioca/0.11.6/lib/tapioca/rbi_ext/model.rb#55 + # source://tapioca/0.11.8/lib/tapioca/rbi_ext/model.rb#55 sig { params(name: ::String).void } def create_extend(name); end - # source://tapioca/0.11.6/lib/tapioca/rbi_ext/model.rb#50 + # source://tapioca/0.11.8/lib/tapioca/rbi_ext/model.rb#50 sig { params(name: ::String).void } def create_include(name); end - # source://tapioca/0.11.6/lib/tapioca/rbi_ext/model.rb#89 + # source://tapioca/0.11.8/lib/tapioca/rbi_ext/model.rb#89 sig do params( name: ::String, @@ -2713,19 +2632,19 @@ class RBI::Tree < ::RBI::NodeWithComments 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.11.6/lib/tapioca/rbi_ext/model.rb#60 + # source://tapioca/0.11.8/lib/tapioca/rbi_ext/model.rb#60 sig { params(name: ::String).void } def create_mixes_in_class_methods(name); end - # source://tapioca/0.11.6/lib/tapioca/rbi_ext/model.rb#25 + # source://tapioca/0.11.8/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.11.6/lib/tapioca/rbi_ext/model.rb#9 + # source://tapioca/0.11.8/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.11.6/lib/tapioca/rbi_ext/model.rb#74 + # source://tapioca/0.11.8/lib/tapioca/rbi_ext/model.rb#74 sig do params( name: ::String, @@ -2738,11 +2657,11 @@ class RBI::Tree < ::RBI::NodeWithComments 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#40 + # source://rbi//lib/rbi/rewriters/deannotate.rb#41 sig { params(annotation: ::String).void } def deannotate!(annotation); end - # source://rbi//lib/rbi/model.rb#128 + # source://rbi//lib/rbi/model.rb#132 sig { returns(T::Boolean) } def empty?; end @@ -2750,11 +2669,11 @@ class RBI::Tree < ::RBI::NodeWithComments sig { void } def group_nodes!; end - # source://rbi//lib/rbi/index.rb#64 + # source://rbi//lib/rbi/index.rb#68 sig { returns(::RBI::Index) } def index; end - # source://rbi//lib/rbi/rewriters/merge_trees.rb#318 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#324 sig do params( other: ::RBI::Tree, @@ -2765,40 +2684,40 @@ class RBI::Tree < ::RBI::NodeWithComments 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#45 + # 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#35 + # source://rbi//lib/rbi/rewriters/nest_singleton_methods.rb#36 sig { void } def nest_singleton_methods!; end - # source://rbi//lib/rbi/model.rb#106 + # source://rbi//lib/rbi/model.rb#110 sig { returns(T::Array[::RBI::Node]) } def nodes; end - # source://rbi//lib/rbi/printer.rb#231 + # source://rbi//lib/rbi/printer.rb#233 sig { override.returns(T::Boolean) } def oneline?; end - # source://rbi//lib/rbi/rewriters/sort_nodes.rb#107 + # source://rbi//lib/rbi/rewriters/sort_nodes.rb#119 sig { void } def sort_nodes!; end private - # source://tapioca/0.11.6/lib/tapioca/rbi_ext/model.rb#116 + # source://tapioca/0.11.8/lib/tapioca/rbi_ext/model.rb#116 sig { params(node: ::RBI::Node).returns(::RBI::Node) } def create_node(node); end - # source://tapioca/0.11.6/lib/tapioca/rbi_ext/model.rb#111 + # source://tapioca/0.11.8/lib/tapioca/rbi_ext/model.rb#111 sig { returns(T::Hash[::String, ::RBI::Node]) } def nodes_cache; end end -# source://rbi//lib/rbi/parser.rb#156 +# source://rbi//lib/rbi/parser.rb#160 class RBI::TreeBuilder < ::RBI::ASTVisitor - # source://rbi//lib/rbi/parser.rb#172 + # source://rbi//lib/rbi/parser.rb#176 sig do params( file: ::String, @@ -2808,112 +2727,122 @@ class RBI::TreeBuilder < ::RBI::ASTVisitor end def initialize(file:, comments: T.unsafe(nil), nodes_comments_assoc: T.unsafe(nil)); end - # source://rbi//lib/rbi/parser.rb#163 + # source://rbi//lib/rbi/parser.rb#167 sig { returns(T.nilable(::AST::Node)) } def last_node; end - # source://rbi//lib/rbi/parser.rb#187 + # source://rbi//lib/rbi/parser.rb#191 sig { void } def post_process; end - # source://rbi//lib/rbi/parser.rb#160 + # source://rbi//lib/rbi/parser.rb#164 sig { returns(::RBI::Tree) } def tree; end - # source://rbi//lib/rbi/parser.rb#193 + # source://rbi//lib/rbi/parser.rb#197 sig { override.params(node: T.nilable(::Object)).void } def visit(node); end private - # source://rbi//lib/rbi/parser.rb#546 + # source://rbi//lib/rbi/parser.rb#573 sig { void } def assoc_dangling_comments; end - # source://rbi//lib/rbi/parser.rb#527 + # source://rbi//lib/rbi/parser.rb#554 sig { returns(::RBI::Tree) } def current_scope; end - # source://rbi//lib/rbi/parser.rb#532 + # source://rbi//lib/rbi/parser.rb#559 sig { returns(T::Array[::RBI::Sig]) } def current_sigs; end - # source://rbi//lib/rbi/parser.rb#539 + # source://rbi//lib/rbi/parser.rb#566 sig { returns(T::Array[::RBI::Comment]) } def current_sigs_comments; end - # source://rbi//lib/rbi/parser.rb#516 + # source://rbi//lib/rbi/parser.rb#542 sig { params(node: ::AST::Node).returns(T::Array[::RBI::Comment]) } def node_comments(node); end - # source://rbi//lib/rbi/parser.rb#511 + # source://rbi//lib/rbi/parser.rb#537 sig { params(node: ::AST::Node).returns(::RBI::Loc) } def node_loc(node); end - # source://rbi//lib/rbi/parser.rb#402 + # source://rbi//lib/rbi/parser.rb#410 sig { params(node: ::AST::Node).returns(T.nilable(::RBI::Node)) } def parse_block(node); end - # source://rbi//lib/rbi/parser.rb#249 + # source://rbi//lib/rbi/parser.rb#254 sig { params(node: ::AST::Node).returns(::RBI::Node) } def parse_const_assign(node); end - # source://rbi//lib/rbi/parser.rb#263 + # source://rbi//lib/rbi/parser.rb#270 sig { params(node: ::AST::Node).returns(::RBI::Method) } def parse_def(node); end - # source://rbi//lib/rbi/parser.rb#486 + # source://rbi//lib/rbi/parser.rb#512 sig { params(node: ::AST::Node).returns(::RBI::TEnumBlock) } def parse_enum(node); end - # source://rbi//lib/rbi/parser.rb#290 + # source://rbi//lib/rbi/parser.rb#297 sig { params(node: ::AST::Node).returns(::RBI::Param) } def parse_param(node); end - # source://rbi//lib/rbi/parser.rb#503 + # source://rbi//lib/rbi/parser.rb#529 sig { params(node: ::AST::Node).returns(::RBI::RequiresAncestor) } def parse_requires_ancestor(node); end - # source://rbi//lib/rbi/parser.rb#229 + # source://rbi//lib/rbi/parser.rb#234 sig { params(node: ::AST::Node).returns(::RBI::Scope) } def parse_scope(node); end - # source://rbi//lib/rbi/parser.rb#318 + # source://rbi//lib/rbi/parser.rb#325 sig { params(node: ::AST::Node).returns(T.nilable(::RBI::Node)) } def parse_send(node); end - # source://rbi//lib/rbi/parser.rb#385 + # source://rbi//lib/rbi/parser.rb#393 sig { params(node: ::AST::Node).returns(T::Array[::RBI::Arg]) } def parse_send_args(node); end - # source://rbi//lib/rbi/parser.rb#479 + # source://rbi//lib/rbi/parser.rb#505 sig { params(node: ::AST::Node).returns(::RBI::Sig) } def parse_sig(node); end - # source://rbi//lib/rbi/parser.rb#424 + # source://rbi//lib/rbi/parser.rb#432 sig { params(node: ::AST::Node).returns(::RBI::Struct) } def parse_struct(node); end - # source://rbi//lib/rbi/parser.rb#463 + # source://rbi//lib/rbi/parser.rb#489 sig { params(node: ::AST::Node).returns([::String, ::String, T.nilable(::String)]) } def parse_tstruct_prop(node); end - # source://rbi//lib/rbi/parser.rb#564 + # source://rbi//lib/rbi/parser.rb#478 + sig { params(node: ::AST::Node).returns(::RBI::TypeMember) } + def parse_type_variable(node); end + + # source://rbi//lib/rbi/parser.rb#591 sig { void } def separate_header_comments; end - # source://rbi//lib/rbi/parser.rb#586 + # source://rbi//lib/rbi/parser.rb#613 sig { void } def set_root_tree_loc; end - # source://rbi//lib/rbi/parser.rb#418 + # source://rbi//lib/rbi/parser.rb#426 sig { params(node: ::AST::Node).returns(T::Boolean) } def struct_definition?(node); end + + # source://rbi//lib/rbi/parser.rb#471 + sig { params(node: ::AST::Node).returns(T::Boolean) } + def type_variable_definition?(node); end end -# source://rbi//lib/rbi/model.rb#1311 +# source://rbi//lib/rbi/model.rb#1320 class RBI::TypeMember < ::RBI::NodeWithComments - # source://rbi//lib/rbi/model.rb#1326 + include ::RBI::Indexable + + # source://rbi//lib/rbi/model.rb#1335 sig do params( name: ::String, @@ -2925,25 +2854,29 @@ class RBI::TypeMember < ::RBI::NodeWithComments end def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/printer.rb#810 + # source://rbi//lib/rbi/printer.rb#812 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/model.rb#1334 + # source://rbi//lib/rbi/model.rb#1343 sig { returns(::String) } def fully_qualified_name; end - # source://rbi//lib/rbi/model.rb#1315 + # source://rbi//lib/rbi/index.rb#183 + sig { override.returns(T::Array[::String]) } + def index_ids; end + + # source://rbi//lib/rbi/model.rb#1324 sig { returns(::String) } def name; end - # source://rbi//lib/rbi/model.rb#1340 + # source://rbi//lib/rbi/model.rb#1350 sig { override.returns(::String) } def to_s; end # @return [String] # - # source://rbi//lib/rbi/model.rb#1315 + # source://rbi//lib/rbi/model.rb#1324 def value; end end @@ -2969,59 +2902,54 @@ RBI::VERSION = T.let(T.unsafe(nil), String) # # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # -# source://rbi//lib/rbi/model.rb#833 +# source://rbi//lib/rbi/model.rb#841 class RBI::Visibility < ::RBI::NodeWithComments abstract! - # source://rbi//lib/rbi/model.rb#843 + # source://rbi//lib/rbi/model.rb#851 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#849 + # source://rbi//lib/rbi/model.rb#857 sig { params(other: ::RBI::Visibility).returns(T::Boolean) } def ==(other); end - # source://rbi//lib/rbi/printer.rb#577 + # source://rbi//lib/rbi/printer.rb#579 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/model.rb#864 + # source://rbi//lib/rbi/model.rb#872 sig { returns(T::Boolean) } def private?; end - # source://rbi//lib/rbi/model.rb#859 + # source://rbi//lib/rbi/model.rb#867 sig { returns(T::Boolean) } def protected?; end - # source://rbi//lib/rbi/model.rb#854 + # source://rbi//lib/rbi/model.rb#862 sig { returns(T::Boolean) } def public?; end - # source://rbi//lib/rbi/model.rb#840 + # source://rbi//lib/rbi/model.rb#848 sig { returns(::Symbol) } def visibility; end - - class << self - # source://sorbet-runtime/0.5.10875/lib/types/private/abstract/declare.rb#37 - def new(*args, **_arg1, &blk); end - end end -# source://rbi//lib/rbi/rewriters/nest_non_public_methods.rb#51 +# 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#58 + # 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/printer.rb#846 + # source://rbi//lib/rbi/printer.rb#848 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/printer.rb#859 + # source://rbi//lib/rbi/printer.rb#861 sig { override.returns(T::Boolean) } def oneline?; end - # source://rbi//lib/rbi/rewriters/nest_non_public_methods.rb#55 + # source://rbi//lib/rbi/rewriters/nest_non_public_methods.rb#56 sig { returns(::RBI::Visibility) } def visibility; end end @@ -3041,9 +2969,4 @@ class RBI::Visitor # source://rbi//lib/rbi/visitor.rb#15 sig { params(nodes: T::Array[::RBI::Node]).void } def visit_all(nodes); end - - class << self - # source://sorbet-runtime/0.5.10875/lib/types/private/abstract/declare.rb#37 - def new(*args, **_arg1, &blk); end - end end diff --git a/sorbet/rbi/gems/tzinfo@2.0.6.rbi b/sorbet/rbi/gems/tzinfo@2.0.6.rbi deleted file mode 100644 index 349290815..000000000 --- a/sorbet/rbi/gems/tzinfo@2.0.6.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `tzinfo` gem. -# Please instead update this file by running `bin/tapioca gem tzinfo`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/zeitwerk@2.6.8.rbi b/sorbet/rbi/gems/zeitwerk@2.6.8.rbi deleted file mode 100644 index 5307e2aca..000000000 --- a/sorbet/rbi/gems/zeitwerk@2.6.8.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `zeitwerk` gem. -# Please instead update this file by running `bin/tapioca gem zeitwerk`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/shims/rack.rbi b/sorbet/rbi/shims/rack.rbi new file mode 100644 index 000000000..8a56d33eb --- /dev/null +++ b/sorbet/rbi/shims/rack.rbi @@ -0,0 +1,5 @@ +# typed: true + +# We don't have Rack as a dependency, but YARD references one of its constants + +class Rack::Server; end diff --git a/sorbet/tapioca/config.yml b/sorbet/tapioca/config.yml index 886ae5870..f69d732b6 100644 --- a/sorbet/tapioca/config.yml +++ b/sorbet/tapioca/config.yml @@ -1,4 +1,6 @@ gem: + typed_overrides: + "psych": "false" # Add your `gem` command parameters here: # # exclude: diff --git a/test/executor_test.rb b/test/executor_test.rb index 52312e1a8..550595de0 100644 --- a/test/executor_test.rb +++ b/test/executor_test.rb @@ -115,6 +115,19 @@ def test_initialized_populates_index refute_empty(index.instance_variable_get(:@entries)) end + def test_initialized_recovers_from_indexing_failures + @store.experimental_features = true + RubyIndexer::Index.any_instance.expects(:index_all).once.raises(StandardError, "boom!") + + @executor.execute({ method: "initialized", params: {} }) + notification = T.must(@message_queue.pop) + assert_equal("window/showMessage", notification.message) + assert_equal( + "Error while indexing: boom!", + T.cast(notification.params, RubyLsp::Interface::ShowMessageParams).message, + ) + end + def test_rubocop_errors_push_window_notification @executor.expects(:formatting).raises(StandardError, "boom").once diff --git a/test/expectations/definition/class_reference.exp.json b/test/expectations/definition/class_reference.exp.json index 3f1c189d4..5c2b6f09e 100644 --- a/test/expectations/definition/class_reference.exp.json +++ b/test/expectations/definition/class_reference.exp.json @@ -8,7 +8,7 @@ "character": 2 }, "end": { - "line": 179, + "line": 185, "character": 4 } } diff --git a/test/expectations/expectations_test_runner.rb b/test/expectations/expectations_test_runner.rb index 557ff4ce4..8d6828391 100644 --- a/test/expectations/expectations_test_runner.rb +++ b/test/expectations/expectations_test_runner.rb @@ -53,6 +53,9 @@ def default_args # temporarily skip until we figure out comment handling next if handler_class == RubyLsp::Requests::DocumentLink && path == "test/fixtures/source_comment.rb" + # temporarily skip until we figure out nesting here + next if handler_class == RubyLsp::Requests::Hover && path == "test/fixtures/documented_namespaced_class.rb" + test_name = File.basename(path, ".rb") expectations_dir = File.join(TEST_EXP_DIR, expectation_suffix) diff --git a/test/expectations/hover/controller.exp.json b/test/expectations/hover/controller.exp.json deleted file mode 100644 index 56fc891f9..000000000 --- a/test/expectations/hover/controller.exp.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "result": { - "contents": { - "kind": "markdown", - "value": "[Rails Document: `AbstractController::Callbacks::ClassMethods#before_action`](https://api.rubyonrails.org/vRAILTIES_VERSION/classes/AbstractController/Callbacks/ClassMethods.html#method-i-before_action)" - }, - "range": { - "start": { - "line": 1, - "character": 2 - }, - "end": { - "line": 1, - "character": 14 - } - } - }, - "params": [ - { - "line": 1, - "character": 3 - } - ] -} diff --git a/test/expectations/hover/documented_class.exp.json b/test/expectations/hover/documented_class.exp.json new file mode 100644 index 000000000..be39d5e9d --- /dev/null +++ b/test/expectations/hover/documented_class.exp.json @@ -0,0 +1,24 @@ +{ + "params": [ + { + "line": 1, + "character": 6 + } + ], + "result": { + "contents": { + "kind": "markdown", + "value": "```ruby\nBar\n```\n\n**Definitions**: [fake.rb](file:///fake.rb#L2,1-3,3) | [fake.rb](file:///fake.rb#L6,1-7,3)\n\n\n\nThis is the documentation for Bar\n\nThis is more documentation for Bar" + }, + "range": { + "start": { + "line": 1, + "character": 6 + }, + "end": { + "line": 1, + "character": 8 + } + } + } +} diff --git a/test/expectations/hover/documented_constant.exp.json b/test/expectations/hover/documented_constant.exp.json new file mode 100644 index 000000000..f2ecf5edb --- /dev/null +++ b/test/expectations/hover/documented_constant.exp.json @@ -0,0 +1,24 @@ +{ + "params": [ + { + "line": 1, + "character": 0 + } + ], + "result": { + "contents": { + "kind": "markdown", + "value": "```ruby\nBAZ\n```\n\n**Definitions**: [fake.rb](file:///fake.rb#L2,1-2,9)\n\n\n\nThis is the documentation for Baz" + }, + "range": { + "start": { + "line": 1, + "character": 0 + }, + "end": { + "line": 1, + "character": 2 + } + } + } +} diff --git a/test/expectations/hover/documented_module.exp.json b/test/expectations/hover/documented_module.exp.json new file mode 100644 index 000000000..96a24743b --- /dev/null +++ b/test/expectations/hover/documented_module.exp.json @@ -0,0 +1,24 @@ +{ + "params": [ + { + "line": 1, + "character": 7 + } + ], + "result": { + "contents": { + "kind": "markdown", + "value": "```ruby\nFoo\n```\n\n**Definitions**: [fake.rb](file:///fake.rb#L2,1-3,3)\n\n\n\nThis is the documentation for Foo" + }, + "range": { + "start": { + "line": 1, + "character": 7 + }, + "end": { + "line": 1, + "character": 9 + } + } + } +} diff --git a/test/expectations/hover/documented_namespaced_class.exp.json b/test/expectations/hover/documented_namespaced_class.exp.json new file mode 100644 index 000000000..463f0294c --- /dev/null +++ b/test/expectations/hover/documented_namespaced_class.exp.json @@ -0,0 +1,24 @@ +{ + "params": [ + { + "line": 1, + "character": 6 + } + ], + "result": { + "contents": { + "kind": "markdown", + "value": "```ruby\nFoo::Bar\n```\n\n**Definitions**: [fake.rb](file:///fake.rb#L2,1-3,3) | [fake.rb](file:///fake.rb#L6,1-7,3) | [fake.rb](file:///fake.rb#L11,3-12,5)\n\n\n\nThis is the documentation for Foo::Bar\n\nThis is more documentation for Foo::Bar\n\nThis is even more documentation for Foo::Bar" + }, + "range": { + "start": { + "line": 1, + "character": 6 + }, + "end": { + "line": 1, + "character": 14 + } + } + } +} diff --git a/test/expectations/hover/job.exp.json b/test/expectations/hover/job.exp.json deleted file mode 100644 index 10fb82b9a..000000000 --- a/test/expectations/hover/job.exp.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "result": { - "contents": { - "kind": "markdown", - "value": "[Rails Document: `ActiveJob::QueueName::ClassMethods#queue_as`](https://api.rubyonrails.org/vRAILTIES_VERSION/classes/ActiveJob/QueueName/ClassMethods.html#method-i-queue_as)" - }, - "range": { - "start": { - "line": 1, - "character": 2 - }, - "end": { - "line": 1, - "character": 9 - } - } - }, - "params": [ - { - "line": 1, - "character": 3 - } - ] -} diff --git a/test/expectations/hover/model.exp.json b/test/expectations/hover/model.exp.json deleted file mode 100644 index c1ba3329e..000000000 --- a/test/expectations/hover/model.exp.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "result": { - "contents": { - "kind": "markdown", - "value": "[Rails Document: `ActiveModel::EachValidator#validate`](https://api.rubyonrails.org/vRAILTIES_VERSION/classes/ActiveModel/EachValidator.html#method-i-validate)\n\n[Rails Document: `ActiveModel::Validations::ClassMethods#validate`](https://api.rubyonrails.org/vRAILTIES_VERSION/classes/ActiveModel/Validations/ClassMethods.html#method-i-validate)\n\n[Rails Document: `ActiveModel::Validator#validate`](https://api.rubyonrails.org/vRAILTIES_VERSION/classes/ActiveModel/Validator.html#method-i-validate)" - }, - "range": { - "start": { - "line": 1, - "character": 2 - }, - "end": { - "line": 1, - "character": 9 - } - } - }, - "params": [ - { - "line": 1, - "character": 3 - } - ] -} diff --git a/test/expectations/hover/model_action_text.exp.json b/test/expectations/hover/model_action_text.exp.json deleted file mode 100644 index 9238c8c84..000000000 --- a/test/expectations/hover/model_action_text.exp.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "result": { - "contents": { - "kind": "markdown", - "value": "[Rails Document: `ActionText::Attribute#has_rich_text`](https://api.rubyonrails.org/vRAILTIES_VERSION/classes/ActionText/Attribute.html#method-i-has_rich_text)" - }, - "range": { - "start": { - "line": 1, - "character": 2 - }, - "end": { - "line": 1, - "character": 14 - } - } - }, - "params": [ - { - "line": 1, - "character": 3 - } - ] -} diff --git a/test/expectations/hover/model_active_record_constant.exp.json b/test/expectations/hover/model_active_record_constant.exp.json deleted file mode 100644 index 91b4659fa..000000000 --- a/test/expectations/hover/model_active_record_constant.exp.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "result": { - "contents": { - "kind": "markdown", - "value": "[Rails Document: `ActiveRecord::Base`](https://api.rubyonrails.org/vRAILTIES_VERSION/classes/ActiveRecord/Base.html)" - }, - "range": { - "start": { - "line": 0, - "character": 13 - }, - "end": { - "line": 0, - "character": 30 - } - } - }, - "params": [ - { - "line": 0, - "character": 27 - } - ] -} diff --git a/test/expectations/hover/model_active_storage.exp.json b/test/expectations/hover/model_active_storage.exp.json deleted file mode 100644 index 438de30a6..000000000 --- a/test/expectations/hover/model_active_storage.exp.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "result": { - "contents": { - "kind": "markdown", - "value": "[Rails Document: `ActiveStorage::Attached::Model#has_one_attached`](https://api.rubyonrails.org/vRAILTIES_VERSION/classes/ActiveStorage/Attached/Model.html#method-i-has_one_attached)" - }, - "range": { - "start": { - "line": 1, - "character": 2 - }, - "end": { - "line": 1, - "character": 17 - } - } - }, - "params": [ - { - "line": 1, - "character": 3 - } - ] -} diff --git a/test/expectations/hover/routes.exp.json b/test/expectations/hover/routes.exp.json deleted file mode 100644 index 1d211924f..000000000 --- a/test/expectations/hover/routes.exp.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "result": { - "contents": { - "kind": "markdown", - "value": "[Rails Document: `ActionDispatch::Routing::Mapper::Resources#root`](https://api.rubyonrails.org/vRAILTIES_VERSION/classes/ActionDispatch/Routing/Mapper/Resources.html#method-i-root)" - }, - "range": { - "start": { - "line": 1, - "character": 2 - }, - "end": { - "line": 1, - "character": 5 - } - } - }, - "params": [ - { - "line": 1, - "character": 3 - } - ] -} diff --git a/test/fixtures/documented_class.rb b/test/fixtures/documented_class.rb new file mode 100644 index 000000000..26adbf5e2 --- /dev/null +++ b/test/fixtures/documented_class.rb @@ -0,0 +1,7 @@ +# This is the documentation for Bar +class Bar +end + +# This is more documentation for Bar +class Bar +end diff --git a/test/fixtures/documented_constant.rb b/test/fixtures/documented_constant.rb new file mode 100644 index 000000000..35d3ef5d9 --- /dev/null +++ b/test/fixtures/documented_constant.rb @@ -0,0 +1,2 @@ +# This is the documentation for Baz +BAZ = 123 diff --git a/test/fixtures/documented_module.rb b/test/fixtures/documented_module.rb new file mode 100644 index 000000000..edad093c4 --- /dev/null +++ b/test/fixtures/documented_module.rb @@ -0,0 +1,3 @@ +# This is the documentation for Foo +module Foo +end diff --git a/test/fixtures/documented_namespaced_class.rb b/test/fixtures/documented_namespaced_class.rb new file mode 100644 index 000000000..839ca5f4f --- /dev/null +++ b/test/fixtures/documented_namespaced_class.rb @@ -0,0 +1,13 @@ +# This is the documentation for Foo::Bar +class Foo::Bar +end + +# This is more documentation for Foo::Bar +class Foo::Bar +end + +class Foo + # This is even more documentation for Foo::Bar + class Bar + end +end diff --git a/test/fixtures/rails_app/config/routes.rb b/test/fixtures/rails_app/config/routes.rb deleted file mode 100644 index 8dc26f43d..000000000 --- a/test/fixtures/rails_app/config/routes.rb +++ /dev/null @@ -1,3 +0,0 @@ -Rails.application.routes.draw do - root "projects#index" -end diff --git a/test/fixtures/rails_app/controllers/controller.rb b/test/fixtures/rails_app/controllers/controller.rb deleted file mode 100644 index 83f88b8ba..000000000 --- a/test/fixtures/rails_app/controllers/controller.rb +++ /dev/null @@ -1,3 +0,0 @@ -class ProjectsController < ActionController::Base - before_action :foo -end diff --git a/test/fixtures/rails_app/jobs/job.rb b/test/fixtures/rails_app/jobs/job.rb deleted file mode 100644 index ce5d709d7..000000000 --- a/test/fixtures/rails_app/jobs/job.rb +++ /dev/null @@ -1,4 +0,0 @@ -class PostJob < ApplicationJob - queue_as :default -end - diff --git a/test/fixtures/rails_app/models/model.rb b/test/fixtures/rails_app/models/model.rb deleted file mode 100644 index 7523b27db..000000000 --- a/test/fixtures/rails_app/models/model.rb +++ /dev/null @@ -1,3 +0,0 @@ -class Post < ActiveRecord::Base - validate(:foo) -end diff --git a/test/fixtures/rails_app/models/model_action_text.rb b/test/fixtures/rails_app/models/model_action_text.rb deleted file mode 100644 index 50120e822..000000000 --- a/test/fixtures/rails_app/models/model_action_text.rb +++ /dev/null @@ -1,3 +0,0 @@ -class Post < ActiveRecord::Base - has_rich_text :content -end diff --git a/test/fixtures/rails_app/models/model_active_record_constant.rb b/test/fixtures/rails_app/models/model_active_record_constant.rb deleted file mode 100644 index 791dcb567..000000000 --- a/test/fixtures/rails_app/models/model_active_record_constant.rb +++ /dev/null @@ -1,2 +0,0 @@ -class Post < ActiveRecord::Base -end diff --git a/test/fixtures/rails_app/models/model_active_storage.rb b/test/fixtures/rails_app/models/model_active_storage.rb deleted file mode 100644 index b08aee612..000000000 --- a/test/fixtures/rails_app/models/model_active_storage.rb +++ /dev/null @@ -1,3 +0,0 @@ -class Post < ActiveRecord::Base - has_one_attached :bar -end diff --git a/test/requests/definition_expectations_test.rb b/test/requests/definition_expectations_test.rb index 87fd5e540..86e17d3ba 100644 --- a/test/requests/definition_expectations_test.rb +++ b/test/requests/definition_expectations_test.rb @@ -49,4 +49,32 @@ def run_expectations(source) ensure T.must(message_queue).close end + + def test_jumping_to_default_gems + skip # restore the `ensure` when removing + + message_queue = Thread::Queue.new + position = { character: 0, line: 0 } + + path = "#{RbConfig::CONFIG["rubylibdir"]}/pathname.rb" + uri = URI::Generic.from_path(path: path) + + store = RubyLsp::Store.new + store.experimental_features = true + store.set(uri: URI("file:///folder/fake.rb"), source: <<~RUBY, version: 1) + Pathname + RUBY + + executor = RubyLsp::Executor.new(store, message_queue) + executor.instance_variable_get(:@index).index_single(T.must(uri.to_standardized_path)) + + response = executor.execute({ + method: "textDocument/definition", + params: { textDocument: { uri: "file:///folder/fake.rb" }, position: position }, + }).response + + refute_empty(response) + # ensure + # T.must(message_queue).close + end end diff --git a/test/requests/hover_expectations_test.rb b/test/requests/hover_expectations_test.rb index c74dfdc57..8b6bd14fe 100644 --- a/test/requests/hover_expectations_test.rb +++ b/test/requests/hover_expectations_test.rb @@ -2,85 +2,67 @@ # frozen_string_literal: true require "test_helper" -require "net/http" # for stubbing require "expectations/expectations_test_runner" class HoverExpectationsTest < ExpectationsTestRunner expectations_tests RubyLsp::Requests::Hover, "hover" - def assert_expectations(source, expected) - source = substitute(source) - actual = T.cast(run_expectations(source), T.nilable(LanguageServer::Protocol::Interface::Hover)) - actual_json = actual ? JSON.parse(actual.to_json) : nil - assert_equal(json_expectations(substitute(expected)), actual_json) - end - - def test_search_index_being_nil - message_queue = Thread::Queue.new - store = RubyLsp::Store.new - store.set(uri: URI("file:///fake.rb"), source: "belongs_to :foo", version: 1) - - RubyLsp::Requests::Support::RailsDocumentClient.stubs(search_index: nil) - RubyLsp::Executor.new(store, message_queue).execute({ - method: "textDocument/hover", - params: { textDocument: { uri: "file:///fake.rb" }, position: { line: 0, character: 0 } }, - }).response - ensure - T.must(message_queue).close - end - - class FakeHTTPResponse - attr_reader :code, :body - - def initialize(code, body) - @code = code - @body = body - end - end - def run_expectations(source) message_queue = Thread::Queue.new - js_content = File.read(File.join(TEST_FIXTURES_DIR, "rails_search_index.js")) - fake_response = FakeHTTPResponse.new("200", js_content) - position = @__params&.first || { character: 0, line: 0 } - Net::HTTP.stubs(get_response: fake_response) + uri = URI("file:///fake.rb") store = RubyLsp::Store.new - store.set(uri: URI("file:///fake.rb"), source: source, version: 1) - - RubyLsp::Executor.new(store, message_queue).execute({ - method: "textDocument/hover", - params: { textDocument: { uri: "file:///fake.rb" }, position: position }, - }).response - ensure - T.must(message_queue).close + store.set(uri: uri, source: source, version: 1) + + executor = RubyLsp::Executor.new(store, message_queue) + index = executor.instance_variable_get(:@index) + index.index_single(uri.to_standardized_path, source) + + begin + # We need to pretend that Sorbet is not a dependency or else we can't properly test + RubyLsp::DependencyDetector.const_set(:HAS_TYPECHECKER, false) + executor.execute({ + method: "textDocument/hover", + params: { textDocument: { uri: uri }, position: position }, + }).response + ensure + RubyLsp::DependencyDetector.const_set(:HAS_TYPECHECKER, true) + T.must(message_queue).close + end end def test_hover_extensions + skip + + RubyLsp::DependencyDetector.const_set(:HAS_TYPECHECKER, false) message_queue = Thread::Queue.new create_hover_extension - js_content = File.read(File.join(TEST_FIXTURES_DIR, "rails_search_index.js")) - fake_response = FakeHTTPResponse.new("200", js_content) - Net::HTTP.stubs(get_response: fake_response) store = RubyLsp::Store.new - store.set(uri: URI("file:///fake.rb"), source: <<~RUBY, version: 1) + source = <<~RUBY + # Hello class Post - belongs_to :user end + + Post RUBY + uri = URI::Generic.from_path(path: "/fake.rb") + store.set(uri: uri, source: source, version: 1) + + executor = RubyLsp::Executor.new(store, message_queue) + executor.instance_variable_get(:@index).index_single(uri.to_standardized_path, source) - response = RubyLsp::Executor.new(store, message_queue).execute({ + response = executor.execute({ method: "textDocument/hover", - params: { textDocument: { uri: "file:///fake.rb" }, position: { line: 1, character: 2 } }, + params: { textDocument: { uri: "file:///fake.rb" }, position: { line: 4, character: 0 } }, }).response - assert_match("Method from middleware: belongs_to", response.contents.value) - assert_match("[Rails Document: `ActiveRecord::Associations::ClassMethods#belongs_to`]", response.contents.value) - ensure - RubyLsp::Extension.extensions.clear - T.must(message_queue).close + assert_match("Hello\n\nHello from middleware: Post", response.contents.value) + # ensure + # RubyLsp::Extension.extensions.clear + # RubyLsp::DependencyDetector.const_set(:HAS_TYPECHECKER, true) + # T.must(message_queue).close end private @@ -99,14 +81,14 @@ def create_hover_listener(emitter, message_queue) def initialize(emitter, message_queue) super - emitter.register(self, :on_call) + emitter.register(self, :on_const) end - def on_call(node) + def on_const(node) T.bind(self, RubyLsp::Listener[T.untyped]) contents = RubyLsp::Interface::MarkupContent.new( kind: "markdown", - value: "Method from middleware: #{node.message}", + value: "Hello from middleware: #{node.value}", ) @response = RubyLsp::Interface::Hover.new(range: range_from_location(node.location), contents: contents) end @@ -116,8 +98,4 @@ def on_call(node) end end end - - def substitute(original) - original.gsub("RAILTIES_VERSION", Gem::Specification.find_by_name("railties").version.to_s) - end end diff --git a/test/requests/support/uri_test.rb b/test/requests/support/uri_test.rb index b492a3424..190b812d4 100644 --- a/test/requests/support/uri_test.rb +++ b/test/requests/support/uri_test.rb @@ -39,5 +39,16 @@ def test_to_standardized_path_on_windows_with_received_uri uri = URI("file:///c%3A/some/windows/path/to/file.rb") assert_equal("c:/some/windows/path/to/file.rb", uri.to_standardized_path) end + + def test_plus_signs_are_properly_unescaped + path = "/opt/rubies/3.3.0/lib/ruby/3.3.0+0/pathname.rb" + uri = URI::Generic.from_path(path: path) + assert_equal(path, uri.to_standardized_path) + end + + def test_from_path_with_fragment + uri = URI::Generic.from_path(path: "/some/unix/path/to/file.rb", fragment: "L1,3-2,9") + assert_equal("file:///some/unix/path/to/file.rb#L1,3-2,9", uri.to_s) + end end end diff --git a/test/requests/workspace_symbol_test.rb b/test/requests/workspace_symbol_test.rb index 1cdd595e1..90e9c312b 100644 --- a/test/requests/workspace_symbol_test.rb +++ b/test/requests/workspace_symbol_test.rb @@ -84,4 +84,11 @@ class Bar; end assert_equal(RubyLsp::Constant::SymbolKind::CLASS, T.must(result).kind) assert_equal("Foo", T.must(result).container_name) end + + def test_finds_default_gem_symbols + @index.index_single("#{RbConfig::CONFIG["rubylibdir"]}/pathname.rb") + + result = RubyLsp::Requests::WorkspaceSymbol.new("Pathname", @index).run + refute_empty(result) + end end diff --git a/test/setup_bundler_test.rb b/test/setup_bundler_test.rb index 64019f14f..ff163c60b 100644 --- a/test/setup_bundler_test.rb +++ b/test/setup_bundler_test.rb @@ -6,14 +6,14 @@ class SetupBundlerTest < Minitest::Test def test_does_nothing_if_both_ruby_lsp_and_debug_are_in_the_bundle - Object.any_instance.expects(:system).with(bundle_env, "bundle install 1>&2") + Object.any_instance.expects(:system).with(bundle_env, "(bundle check || bundle install) 1>&2") Bundler::LockfileParser.any_instance.expects(:dependencies).returns({ "ruby-lsp" => true, "debug" => true }) run_script refute_path_exists(".ruby-lsp") end def test_removes_ruby_lsp_folder_if_both_gems_were_added_to_the_bundle - Object.any_instance.expects(:system).with(bundle_env, "bundle install 1>&2") + Object.any_instance.expects(:system).with(bundle_env, "(bundle check || bundle install) 1>&2") Bundler::LockfileParser.any_instance.expects(:dependencies).returns({ "ruby-lsp" => true, "debug" => true }) FileUtils.mkdir(".ruby-lsp") run_script @@ -23,7 +23,7 @@ def test_removes_ruby_lsp_folder_if_both_gems_were_added_to_the_bundle end def test_creates_custom_bundle - Object.any_instance.expects(:system).with(bundle_env(".ruby-lsp/Gemfile"), "bundle install 1>&2") + Object.any_instance.expects(:system).with(bundle_env(".ruby-lsp/Gemfile"), "(bundle check || bundle install) 1>&2") Bundler::LockfileParser.any_instance.expects(:dependencies).returns({}).at_least_once run_script @@ -75,7 +75,10 @@ def test_changing_lockfile_causes_custom_bundle_to_be_rebuilt # ruby-lsp is a part of the custom lockfile and would try to run `bundle update ruby-lsp`, which would fail. If # we evaluate lazily, then we only find dependencies after the lockfile was copied, and then run bundle install # instead, which re-locks and adds the ruby-lsp - Object.any_instance.expects(:system).with(bundle_env(".ruby-lsp/Gemfile"), "bundle install 1>&2") + Object.any_instance.expects(:system).with( + bundle_env(".ruby-lsp/Gemfile"), + "(bundle check || bundle install) 1>&2", + ) Bundler.with_unbundled_env do run_script end @@ -120,9 +123,44 @@ def test_does_not_copy_gemfile_lock_when_not_modified end end + def test_does_only_updates_every_4_hours + Dir.mktmpdir do |dir| + Dir.chdir(dir) do + File.write(File.join(dir, "Gemfile"), <<~GEMFILE) + source "https://rubygems.org" + gem "rdoc" + GEMFILE + + capture_subprocess_io do + Bundler.with_unbundled_env do + # Run bundle install to generate the lockfile + system("bundle install") + + # Run the script once to generate a custom bundle + run_script + end + end + + File.write(File.join(dir, ".ruby-lsp", "last_updated"), (Time.now - 30 * 60).iso8601) + + capture_subprocess_io do + Object.any_instance.expects(:system).with( + bundle_env(".ruby-lsp/Gemfile"), + "(bundle check || bundle install) 1>&2", + ) + + Bundler.with_unbundled_env do + # Run the script again without having the lockfile modified + run_script + end + end + end + end + end + def test_uses_absolute_bundle_path_for_bundle_install Bundler.settings.set_global("path", "vendor/bundle") - Object.any_instance.expects(:system).with(bundle_env(".ruby-lsp/Gemfile"), "bundle install 1>&2") + Object.any_instance.expects(:system).with(bundle_env(".ruby-lsp/Gemfile"), "(bundle check || bundle install) 1>&2") Bundler::LockfileParser.any_instance.expects(:dependencies).returns({}).at_least_once run_script(expected_path: File.expand_path("vendor/bundle", Dir.pwd)) ensure @@ -136,7 +174,10 @@ def test_creates_custom_bundle_if_no_gemfile Dir.mktmpdir do |dir| Dir.chdir(dir) do bundle_gemfile = Pathname.new(".ruby-lsp").expand_path(Dir.pwd) + "Gemfile" - Object.any_instance.expects(:system).with(bundle_env(bundle_gemfile.to_s), "bundle install 1>&2") + Object.any_instance.expects(:system).with( + bundle_env(bundle_gemfile.to_s), + "(bundle check || bundle install) 1>&2", + ) Bundler.with_unbundled_env do run_script @@ -198,7 +239,7 @@ def test_does_nothing_if_both_ruby_lsp_and_debug_are_gemspec_dependencies FileUtils.touch(File.join(dir, "Gemfile.lock")) Bundler.with_unbundled_env do - Object.any_instance.expects(:system).with(bundle_env, "bundle install 1>&2") + Object.any_instance.expects(:system).with(bundle_env, "(bundle check || bundle install) 1>&2") Bundler::LockfileParser.any_instance.expects(:dependencies).returns({}) run_script end @@ -212,7 +253,10 @@ def test_creates_custom_bundle_with_specified_branch Dir.mktmpdir do |dir| Dir.chdir(dir) do bundle_gemfile = Pathname.new(".ruby-lsp").expand_path(Dir.pwd) + "Gemfile" - Object.any_instance.expects(:system).with(bundle_env(bundle_gemfile.to_s), "bundle install 1>&2") + Object.any_instance.expects(:system).with( + bundle_env(bundle_gemfile.to_s), + "(bundle check || bundle install) 1>&2", + ) Bundler.with_unbundled_env do run_script(branch: "test-branch") @@ -226,6 +270,21 @@ def test_creates_custom_bundle_with_specified_branch end end + def test_does_not_print_to_stdout + # Create a temporary directory with no Gemfile or Gemfile.lock + Dir.mktmpdir do |dir| + Dir.chdir(dir) do + stdout, _stderr = capture_subprocess_io do + Bundler.with_unbundled_env do + run_script + end + end + + assert_empty(stdout) + end + end + end + private # This method runs the script and then immediately unloads it. This allows us to make assertions against the effects